nlm: Ensure callback code also checks that the files match
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / include / linux / linkage.h
CommitLineData
1da177e4
LT
1#ifndef _LINUX_LINKAGE_H
2#define _LINUX_LINKAGE_H
3
a7bf0bd5 4#include <linux/compiler.h>
e1b5bb6d 5#include <linux/stringify.h>
f8ce1faf 6#include <linux/export.h>
1da177e4
LT
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
e1b5bb6d 19#ifndef cond_syscall
f8ce1faf
LT
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))
e1b5bb6d
AV
24#endif
25
26#ifndef SYSCALL_ALIAS
f8ce1faf
LT
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))
e1b5bb6d
AV
31#endif
32
75b13483 33#define __page_aligned_data __section(.data..page_aligned) __aligned(PAGE_SIZE)
7c74df07 34#define __page_aligned_bss __section(.bss..page_aligned) __aligned(PAGE_SIZE)
a7bf0bd5 35
d2af12ae
TA
36/*
37 * For assembly routines.
38 *
39 * Note when using these that you must specify the appropriate
40 * alignment directives yourself
41 */
75b13483 42#define __PAGE_ALIGNED_DATA .section ".data..page_aligned", "aw"
7c74df07 43#define __PAGE_ALIGNED_BSS .section ".bss..page_aligned", "aw"
d2af12ae 44
d10d89ec
LT
45/*
46 * This is used by architectures to keep arguments on the stack
47 * untouched by the compiler by keeping them live until the end.
48 * The argument stack may be owned by the assembly-language
49 * caller, not the callee, and gcc doesn't always understand
50 * that.
51 *
52 * We have the return value, and a maximum of six arguments.
53 *
54 * This should always be followed by a "return ret" for the
55 * protection to work (ie no more work that the compiler might
56 * end up needing stack temporaries for).
57 */
b0fac023
HC
58/* Assembly files may be compiled with -traditional .. */
59#ifndef __ASSEMBLY__
54a01510
RM
60#ifndef asmlinkage_protect
61# define asmlinkage_protect(n, ret, args...) do { } while (0)
1da177e4 62#endif
b0fac023 63#endif
1da177e4
LT
64
65#ifndef __ALIGN
66#define __ALIGN .align 4,0x90
67#define __ALIGN_STR ".align 4,0x90"
68#endif
69
70#ifdef __ASSEMBLY__
71
42f29a25 72#ifndef LINKER_SCRIPT
1da177e4
LT
73#define ALIGN __ALIGN
74#define ALIGN_STR __ALIGN_STR
75
ab7efcc9 76#ifndef ENTRY
1da177e4
LT
77#define ENTRY(name) \
78 .globl name; \
79 ALIGN; \
80 name:
ab7efcc9 81#endif
42f29a25 82#endif /* LINKER_SCRIPT */
1da177e4 83
214541d1
RR
84#ifndef WEAK
85#define WEAK(name) \
86 .weak name; \
87 name:
88#endif
89
ab7efcc9
JB
90#ifndef END
91#define END(name) \
92 .size name, .-name
93#endif
94
6b8be6df
JR
95/* If symbol 'name' is treated as a subroutine (gets called, and returns)
96 * then please use ENDPROC to mark 'name' as STT_FUNC for the benefit of
97 * static analysis tools such as stack depth analyzer.
98 */
ab7efcc9
JB
99#ifndef ENDPROC
100#define ENDPROC(name) \
101 .type name, @function; \
102 END(name)
103#endif
d0aaff97 104
1da177e4
LT
105#endif
106
1da177e4 107#endif