~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/linkage.h

Version: ~ [ linux-5.13-rc2 ] ~ [ linux-5.12.4 ] ~ [ linux-5.11.21 ] ~ [ linux-5.10.37 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.119 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.190 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.232 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.268 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.268 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.18.140 ] ~ [ linux-3.16.85 ] ~ [ linux-3.14.79 ] ~ [ linux-3.12.74 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 #ifndef _LINUX_LINKAGE_H
  3 #define _LINUX_LINKAGE_H
  4 
  5 #include <linux/compiler_types.h>
  6 #include <linux/stringify.h>
  7 #include <linux/export.h>
  8 #include <asm/linkage.h>
  9 
 10 /* Some toolchains use other characters (e.g. '`') to mark new line in macro */
 11 #ifndef ASM_NL
 12 #define ASM_NL           ;
 13 #endif
 14 
 15 #ifdef __cplusplus
 16 #define CPP_ASMLINKAGE extern "C"
 17 #else
 18 #define CPP_ASMLINKAGE
 19 #endif
 20 
 21 #ifndef asmlinkage
 22 #define asmlinkage CPP_ASMLINKAGE
 23 #endif
 24 
 25 #ifndef cond_syscall
 26 #define cond_syscall(x) asm(                            \
 27         ".weak " VMLINUX_SYMBOL_STR(x) "\n\t"           \
 28         ".set  " VMLINUX_SYMBOL_STR(x) ","              \
 29                  VMLINUX_SYMBOL_STR(sys_ni_syscall))
 30 #endif
 31 
 32 #ifndef SYSCALL_ALIAS
 33 #define SYSCALL_ALIAS(alias, name) asm(                 \
 34         ".globl " VMLINUX_SYMBOL_STR(alias) "\n\t"      \
 35         ".set   " VMLINUX_SYMBOL_STR(alias) ","         \
 36                   VMLINUX_SYMBOL_STR(name))
 37 #endif
 38 
 39 #define __page_aligned_data     __section(.data..page_aligned) __aligned(PAGE_SIZE)
 40 #define __page_aligned_bss      __section(.bss..page_aligned) __aligned(PAGE_SIZE)
 41 
 42 /*
 43  * For assembly routines.
 44  *
 45  * Note when using these that you must specify the appropriate
 46  * alignment directives yourself
 47  */
 48 #define __PAGE_ALIGNED_DATA     .section ".data..page_aligned", "aw"
 49 #define __PAGE_ALIGNED_BSS      .section ".bss..page_aligned", "aw"
 50 
 51 /*
 52  * This is used by architectures to keep arguments on the stack
 53  * untouched by the compiler by keeping them live until the end.
 54  * The argument stack may be owned by the assembly-language
 55  * caller, not the callee, and gcc doesn't always understand
 56  * that.
 57  *
 58  * We have the return value, and a maximum of six arguments.
 59  *
 60  * This should always be followed by a "return ret" for the
 61  * protection to work (ie no more work that the compiler might
 62  * end up needing stack temporaries for).
 63  */
 64 /* Assembly files may be compiled with -traditional .. */
 65 #ifndef __ASSEMBLY__
 66 #ifndef asmlinkage_protect
 67 # define asmlinkage_protect(n, ret, args...)    do { } while (0)
 68 #endif
 69 #endif
 70 
 71 #ifndef __ALIGN
 72 #define __ALIGN         .align 4,0x90
 73 #define __ALIGN_STR     ".align 4,0x90"
 74 #endif
 75 
 76 #ifdef __ASSEMBLY__
 77 
 78 #ifndef LINKER_SCRIPT
 79 #define ALIGN __ALIGN
 80 #define ALIGN_STR __ALIGN_STR
 81 
 82 #ifndef ENTRY
 83 #define ENTRY(name) \
 84         .globl name ASM_NL \
 85         ALIGN ASM_NL \
 86         name:
 87 #endif
 88 #endif /* LINKER_SCRIPT */
 89 
 90 #ifndef WEAK
 91 #define WEAK(name)         \
 92         .weak name ASM_NL   \
 93         name:
 94 #endif
 95 
 96 #ifndef END
 97 #define END(name) \
 98         .size name, .-name
 99 #endif
100 
101 /* If symbol 'name' is treated as a subroutine (gets called, and returns)
102  * then please use ENDPROC to mark 'name' as STT_FUNC for the benefit of
103  * static analysis tools such as stack depth analyzer.
104  */
105 #ifndef ENDPROC
106 #define ENDPROC(name) \
107         .type name, @function ASM_NL \
108         END(name)
109 #endif
110 
111 #endif
112 
113 #endif
114 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp