1 #ifndef _LINUX_LINKAGE_H
2 #define _LINUX_LINKAGE_H
4 #include <linux/compiler.h>
5 #include <linux/stringify.h>
6 #include <linux/export.h>
7 #include <asm/linkage.h>
9 /* Some toolchains use other characters (e.g. '`') to mark new line in macro */
15 #define CPP_ASMLINKAGE extern "C"
17 #define CPP_ASMLINKAGE
21 #define asmlinkage CPP_ASMLINKAGE
25 #define cond_syscall(x) asm( \
26 ".weak " VMLINUX_SYMBOL_STR(x) "\n\t" \
27 ".set " VMLINUX_SYMBOL_STR(x) "," \
28 VMLINUX_SYMBOL_STR(sys_ni_syscall))
32 #define SYSCALL_ALIAS(alias, name) asm( \
33 ".globl " VMLINUX_SYMBOL_STR(alias) "\n\t" \
34 ".set " VMLINUX_SYMBOL_STR(alias) "," \
35 VMLINUX_SYMBOL_STR(name))
38 #define __page_aligned_data __section(.data..page_aligned) __aligned(PAGE_SIZE)
39 #define __page_aligned_bss __section(.bss..page_aligned) __aligned(PAGE_SIZE)
42 * For assembly routines.
44 * Note when using these that you must specify the appropriate
45 * alignment directives yourself
47 #define __PAGE_ALIGNED_DATA .section ".data..page_aligned", "aw"
48 #define __PAGE_ALIGNED_BSS .section ".bss..page_aligned", "aw"
51 * This is used by architectures to keep arguments on the stack
52 * untouched by the compiler by keeping them live until the end.
53 * The argument stack may be owned by the assembly-language
54 * caller, not the callee, and gcc doesn't always understand
57 * We have the return value, and a maximum of six arguments.
59 * This should always be followed by a "return ret" for the
60 * protection to work (ie no more work that the compiler might
61 * end up needing stack temporaries for).
63 /* Assembly files may be compiled with -traditional .. */
65 #ifndef asmlinkage_protect
66 # define asmlinkage_protect(n, ret, args...) do { } while (0)
71 #define __ALIGN .align 4,0x90
72 #define __ALIGN_STR ".align 4,0x90"
79 #define ALIGN_STR __ALIGN_STR
87 #endif /* LINKER_SCRIPT */
100 /* If symbol 'name' is treated as a subroutine (gets called, and returns)
101 * then please use ENDPROC to mark 'name' as STT_FUNC for the benefit of
102 * static analysis tools such as stack depth analyzer.
105 #define ENDPROC(name) \
106 .type name, @function ASM_NL \