Import 2.3.28
[davej-history.git] / include / linux / linkage.h
blobb7657dd8a70f555919e1d5e8420b68330e04a659
1 #ifndef _LINUX_LINKAGE_H
2 #define _LINUX_LINKAGE_H
4 #ifdef __cplusplus
5 #define CPP_ASMLINKAGE extern "C"
6 #else
7 #define CPP_ASMLINKAGE
8 #endif
10 #if defined __i386__ && (__GNUC__ > 2 || __GNUC_MINOR__ > 7)
11 #define asmlinkage CPP_ASMLINKAGE __attribute__((regparm(0)))
12 #else
13 #define asmlinkage CPP_ASMLINKAGE
14 #endif
16 #ifdef __sh__
17 #define STRINGIFY(X) #X
18 #define SYMBOL_NAME_STR(X) STRINGIFY(SYMBOL_NAME(X))
19 #ifdef __STDC__
20 #define SYMBOL_NAME(X) _##X
21 #define SYMBOL_NAME_LABEL(X) _##X##:
22 #else
23 #define SYMBOL_NAME(X) _/**/X
24 #define SYMBOL_NAME_LABEL(X) _/**/X/**/:
25 #endif
26 #else
27 #define SYMBOL_NAME_STR(X) #X
28 #define SYMBOL_NAME(X) X
29 #ifdef __STDC__
30 #define SYMBOL_NAME_LABEL(X) X##:
31 #else
32 #define SYMBOL_NAME_LABEL(X) X/**/:
33 #endif
34 #endif
36 #ifdef __arm__
37 #define __ALIGN .align 0
38 #define __ALIGN_STR ".align 0"
39 #else
40 #ifdef __mc68000__
41 #define __ALIGN .align 4
42 #define __ALIGN_STR ".align 4"
43 #else
44 #ifdef __sh__
45 #define __ALIGN .balign 4
46 #define __ALIGN_STR ".balign 4"
47 #else
48 #if !defined(__i486__) && !defined(__i586__)
49 #define __ALIGN .align 4,0x90
50 #define __ALIGN_STR ".align 4,0x90"
51 #else /* __i486__/__i586__ */
52 #define __ALIGN .align 16,0x90
53 #define __ALIGN_STR ".align 16,0x90"
54 #endif /* __i486__/__i586__ */
55 #endif /* __sh__ */
56 #endif /* __mc68000__ */
57 #endif /* __arm__ */
59 #ifdef __ASSEMBLY__
61 #define ALIGN __ALIGN
62 #define ALIGN_STR __ALIGN_STR
64 #define ENTRY(name) \
65 .globl SYMBOL_NAME(name); \
66 ALIGN; \
67 SYMBOL_NAME_LABEL(name)
69 #endif
71 #endif