]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/l4sys/include/ARCH-arm/linkage.h
update
[l4.git] / l4 / pkg / l4sys / include / ARCH-arm / linkage.h
1 /**
2  * \file
3  * \brief   Linkage
4  * \ingroup l4sys_api
5  */
6 /*
7  * (c) 2008-2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de>,
8  *               Alexander Warg <warg@os.inf.tu-dresden.de>
9  *     economic rights: Technische Universität Dresden (Germany)
10  *
11  * This file is part of TUD:OS and distributed under the terms of the
12  * GNU General Public License 2.
13  * Please see the COPYING-GPL-2 file for details.
14  *
15  * As a special exception, you may use this file as part of a free software
16  * library without restriction.  Specifically, if other files instantiate
17  * templates or use macros or inline functions from this file, or you compile
18  * this file and link it with other files to produce an executable, this
19  * file does not by itself cause the resulting executable to be covered by
20  * the GNU General Public License.  This exception does not however
21  * invalidate any other reasons why the executable file might be covered by
22  * the GNU General Public License.
23  */
24 #ifndef __L4__SYS__ARCH_ARM__LINKAGE_H__
25 #define __L4__SYS__ARCH_ARM__LINKAGE_H__
26
27 #if defined(__PIC__) \
28     && ((__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 2))
29 # define PIC_SAVE_ASM    "str r10, [sp, #-4]!  \n\t"
30 # define PIC_RESTORE_ASM "ldr r10, [sp], #4    \n\t"
31 # define PIC_CLOBBER
32 #else
33 # define PIC_SAVE_ASM
34 # define PIC_RESTORE_ASM
35 # define PIC_CLOBBER ,"r10"
36 #endif
37
38 #ifdef __ASSEMBLY__
39 #ifndef ENTRY
40 #define ENTRY(name) \
41   .globl name; \
42   .p2align(2); \
43   name:
44 #endif
45 #endif
46
47 #define L4_FASTCALL(x)  x
48 #define l4_fastcall
49
50 /**
51  * Define calling convention.
52  * \ingroup l4sys_defines
53  * \hideinitializer
54  */
55 #define L4_CV
56
57 #ifdef __PIC__
58 # define L4_LONG_CALL
59 #else
60 # define L4_LONG_CALL __attribute__((long_call))
61 #endif
62
63 #endif /* ! __L4__SYS__ARCH_ARM__LINKAGE_H__ */