Commit | Line | Data |
---|---|---|
1da177e4 LT |
1 | #ifndef _LINUX_LINKAGE_H |
2 | #define _LINUX_LINKAGE_H | |
3 | ||
1da177e4 LT |
4 | #include <asm/linkage.h> |
5 | ||
6 | #ifdef __cplusplus | |
7 | #define CPP_ASMLINKAGE extern "C" | |
8 | #else | |
9 | #define CPP_ASMLINKAGE | |
10 | #endif | |
11 | ||
12 | #ifndef asmlinkage | |
13 | #define asmlinkage CPP_ASMLINKAGE | |
14 | #endif | |
15 | ||
d50efc6c IM |
16 | #ifndef asmregparm |
17 | # define asmregparm | |
18 | #endif | |
19 | ||
1da177e4 LT |
20 | #ifndef prevent_tail_call |
21 | # define prevent_tail_call(ret) do { } while (0) | |
22 | #endif | |
23 | ||
24 | #ifndef __ALIGN | |
25 | #define __ALIGN .align 4,0x90 | |
26 | #define __ALIGN_STR ".align 4,0x90" | |
27 | #endif | |
28 | ||
29 | #ifdef __ASSEMBLY__ | |
30 | ||
31 | #define ALIGN __ALIGN | |
32 | #define ALIGN_STR __ALIGN_STR | |
33 | ||
ab7efcc9 | 34 | #ifndef ENTRY |
1da177e4 LT |
35 | #define ENTRY(name) \ |
36 | .globl name; \ | |
37 | ALIGN; \ | |
38 | name: | |
ab7efcc9 | 39 | #endif |
1da177e4 | 40 | |
214541d1 RR |
41 | #ifndef WEAK |
42 | #define WEAK(name) \ | |
43 | .weak name; \ | |
44 | name: | |
45 | #endif | |
46 | ||
d0aaff97 | 47 | #define KPROBE_ENTRY(name) \ |
d28c4393 | 48 | .pushsection .kprobes.text, "ax"; \ |
ab7efcc9 | 49 | ENTRY(name) |
d0aaff97 | 50 | |
d28c4393 P |
51 | #define KPROBE_END(name) \ |
52 | END(name); \ | |
53 | .popsection | |
54 | ||
ab7efcc9 JB |
55 | #ifndef END |
56 | #define END(name) \ | |
57 | .size name, .-name | |
58 | #endif | |
59 | ||
6b8be6df JR |
60 | /* If symbol 'name' is treated as a subroutine (gets called, and returns) |
61 | * then please use ENDPROC to mark 'name' as STT_FUNC for the benefit of | |
62 | * static analysis tools such as stack depth analyzer. | |
63 | */ | |
ab7efcc9 JB |
64 | #ifndef ENDPROC |
65 | #define ENDPROC(name) \ | |
66 | .type name, @function; \ | |
67 | END(name) | |
68 | #endif | |
d0aaff97 | 69 | |
1da177e4 LT |
70 | #endif |
71 | ||
72 | #define NORET_TYPE /**/ | |
73 | #define ATTRIB_NORET __attribute__((noreturn)) | |
74 | #define NORET_AND noreturn, | |
75 | ||
76 | #ifndef FASTCALL | |
77 | #define FASTCALL(x) x | |
78 | #define fastcall | |
79 | #endif | |
80 | ||
81 | #endif |