1
2 #ifndef _LINUX_LINKAGE_H
3 #define _LINUX_LINKAGE_H
4
5 #include <linux/compiler_types.h>
6 #include <linux/stringify.h>
7 #include <linux/export.h>
8 #include <asm/linkage.h>
9
10
11 #ifndef ASM_NL
12 #define ASM_NL ;
13 #endif
14
15 #ifdef __cplusplus
16 #define CPP_ASMLINKAGE extern "C"
17 #else
18 #define CPP_ASMLINKAGE
19 #endif
20
21 #ifndef asmlinkage
22 #define asmlinkage CPP_ASMLINKAGE
23 #endif
24
25 #ifndef cond_syscall
26 #define cond_syscall(x) asm( \
27 ".weak " __stringify(x) "\n\t" \
28 ".set " __stringify(x) "," \
29 __stringify(sys_ni_syscall))
30 #endif
31
32 #ifndef SYSCALL_ALIAS
33 #define SYSCALL_ALIAS(alias, name) asm( \
34 ".globl " __stringify(alias) "\n\t" \
35 ".set " __stringify(alias) "," \
36 __stringify(name))
37 #endif
38
39 #define __page_aligned_data __section(.data..page_aligned) __aligned(PAGE_SIZE)
40 #define __page_aligned_bss __section(.bss..page_aligned) __aligned(PAGE_SIZE)
41
42
43
44
45
46
47
48 #define __PAGE_ALIGNED_DATA .section ".data..page_aligned", "aw"
49 #define __PAGE_ALIGNED_BSS .section ".bss..page_aligned", "aw"
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65 #ifndef __ASSEMBLY__
66 #ifndef asmlinkage_protect
67 # define asmlinkage_protect(n, ret, args...) do { } while (0)
68 #endif
69 #endif
70
71 #ifndef __ALIGN
72 #define __ALIGN .align 4,0x90
73 #define __ALIGN_STR ".align 4,0x90"
74 #endif
75
76 #ifdef __ASSEMBLY__
77
78 #ifndef LINKER_SCRIPT
79 #define ALIGN __ALIGN
80 #define ALIGN_STR __ALIGN_STR
81
82 #ifndef GLOBAL
83 #define GLOBAL(name) \
84 .globl name ASM_NL \
85 name:
86 #endif
87
88 #ifndef ENTRY
89 #define ENTRY(name) \
90 .globl name ASM_NL \
91 ALIGN ASM_NL \
92 name:
93 #endif
94 #endif
95
96 #ifndef WEAK
97 #define WEAK(name) \
98 .weak name ASM_NL \
99 ALIGN ASM_NL \
100 name:
101 #endif
102
103 #ifndef END
104 #define END(name) \
105 .size name, .-name
106 #endif
107
108
109
110
111
112 #ifndef ENDPROC
113 #define ENDPROC(name) \
114 .type name, @function ASM_NL \
115 END(name)
116 #endif
117
118 #endif
119
120 #endif