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