Merge branch 'linus' into tracing/sysprof
[pandora-kernel.git] / include / linux / linkage.h
1 #ifndef _LINUX_LINKAGE_H
2 #define _LINUX_LINKAGE_H
3
4 #include <asm/linkage.h>
5
6 #define notrace __attribute__((no_instrument_function))
7
8 #ifdef __cplusplus
9 #define CPP_ASMLINKAGE extern "C"
10 #else
11 #define CPP_ASMLINKAGE
12 #endif
13
14 #ifndef asmlinkage
15 #define asmlinkage CPP_ASMLINKAGE
16 #endif
17
18 #ifndef asmregparm
19 # define asmregparm
20 #endif
21
22 /*
23  * This is used by architectures to keep arguments on the stack
24  * untouched by the compiler by keeping them live until the end.
25  * The argument stack may be owned by the assembly-language
26  * caller, not the callee, and gcc doesn't always understand
27  * that.
28  *
29  * We have the return value, and a maximum of six arguments.
30  *
31  * This should always be followed by a "return ret" for the
32  * protection to work (ie no more work that the compiler might
33  * end up needing stack temporaries for).
34  */
35 /* Assembly files may be compiled with -traditional .. */
36 #ifndef __ASSEMBLY__
37 #ifndef asmlinkage_protect
38 # define asmlinkage_protect(n, ret, args...)    do { } while (0)
39 #endif
40 #endif
41
42 #ifndef __ALIGN
43 #define __ALIGN         .align 4,0x90
44 #define __ALIGN_STR     ".align 4,0x90"
45 #endif
46
47 #ifdef __ASSEMBLY__
48
49 #define ALIGN __ALIGN
50 #define ALIGN_STR __ALIGN_STR
51
52 #ifndef ENTRY
53 #define ENTRY(name) \
54   .globl name; \
55   ALIGN; \
56   name:
57 #endif
58
59 #ifndef WEAK
60 #define WEAK(name)         \
61         .weak name;        \
62         name:
63 #endif
64
65 #define KPROBE_ENTRY(name) \
66   .pushsection .kprobes.text, "ax"; \
67   ENTRY(name)
68
69 #define KPROBE_END(name) \
70   END(name);             \
71   .popsection
72
73 #ifndef END
74 #define END(name) \
75   .size name, .-name
76 #endif
77
78 /* If symbol 'name' is treated as a subroutine (gets called, and returns)
79  * then please use ENDPROC to mark 'name' as STT_FUNC for the benefit of
80  * static analysis tools such as stack depth analyzer.
81  */
82 #ifndef ENDPROC
83 #define ENDPROC(name) \
84   .type name, @function; \
85   END(name)
86 #endif
87
88 #endif
89
90 #define NORET_TYPE    /**/
91 #define ATTRIB_NORET  __attribute__((noreturn))
92 #define NORET_AND     noreturn,
93
94 #endif