diff options
Diffstat (limited to 'arch/x86/include/asm/linkage.h')
| -rw-r--r-- | arch/x86/include/asm/linkage.h | 76 |
1 files changed, 12 insertions, 64 deletions
diff --git a/arch/x86/include/asm/linkage.h b/arch/x86/include/asm/linkage.h index 5d98d0b68ffc..a0d70b46c27c 100644 --- a/arch/x86/include/asm/linkage.h +++ b/arch/x86/include/asm/linkage.h | |||
| @@ -4,11 +4,6 @@ | |||
| 4 | #undef notrace | 4 | #undef notrace |
| 5 | #define notrace __attribute__((no_instrument_function)) | 5 | #define notrace __attribute__((no_instrument_function)) |
| 6 | 6 | ||
| 7 | #ifdef CONFIG_X86_64 | ||
| 8 | #define __ALIGN .p2align 4,,15 | ||
| 9 | #define __ALIGN_STR ".p2align 4,,15" | ||
| 10 | #endif | ||
| 11 | |||
| 12 | #ifdef CONFIG_X86_32 | 7 | #ifdef CONFIG_X86_32 |
| 13 | #define asmlinkage CPP_ASMLINKAGE __attribute__((regparm(0))) | 8 | #define asmlinkage CPP_ASMLINKAGE __attribute__((regparm(0))) |
| 14 | /* | 9 | /* |
| @@ -50,6 +45,17 @@ | |||
| 50 | __asmlinkage_protect_n(ret, "g" (arg1), "g" (arg2), "g" (arg3), \ | 45 | __asmlinkage_protect_n(ret, "g" (arg1), "g" (arg2), "g" (arg3), \ |
| 51 | "g" (arg4), "g" (arg5), "g" (arg6)) | 46 | "g" (arg4), "g" (arg5), "g" (arg6)) |
| 52 | 47 | ||
| 48 | #endif /* CONFIG_X86_32 */ | ||
| 49 | |||
| 50 | #ifdef __ASSEMBLY__ | ||
| 51 | |||
| 52 | #define GLOBAL(name) \ | ||
| 53 | .globl name; \ | ||
| 54 | name: | ||
| 55 | |||
| 56 | #ifdef CONFIG_X86_64 | ||
| 57 | #define __ALIGN .p2align 4,,15 | ||
| 58 | #define __ALIGN_STR ".p2align 4,,15" | ||
| 53 | #endif | 59 | #endif |
| 54 | 60 | ||
| 55 | #ifdef CONFIG_X86_ALIGNMENT_16 | 61 | #ifdef CONFIG_X86_ALIGNMENT_16 |
| @@ -57,65 +63,7 @@ | |||
| 57 | #define __ALIGN_STR ".align 16,0x90" | 63 | #define __ALIGN_STR ".align 16,0x90" |
| 58 | #endif | 64 | #endif |
| 59 | 65 | ||
| 60 | /* | 66 | #endif /* __ASSEMBLY__ */ |
| 61 | * to check ENTRY_X86/END_X86 and | ||
| 62 | * KPROBE_ENTRY_X86/KPROBE_END_X86 | ||
| 63 | * unbalanced-missed-mixed appearance | ||
| 64 | */ | ||
| 65 | #define __set_entry_x86 .set ENTRY_X86_IN, 0 | ||
| 66 | #define __unset_entry_x86 .set ENTRY_X86_IN, 1 | ||
| 67 | #define __set_kprobe_x86 .set KPROBE_X86_IN, 0 | ||
| 68 | #define __unset_kprobe_x86 .set KPROBE_X86_IN, 1 | ||
| 69 | |||
| 70 | #define __macro_err_x86 .error "ENTRY_X86/KPROBE_X86 unbalanced,missed,mixed" | ||
| 71 | |||
| 72 | #define __check_entry_x86 \ | ||
| 73 | .ifdef ENTRY_X86_IN; \ | ||
| 74 | .ifeq ENTRY_X86_IN; \ | ||
| 75 | __macro_err_x86; \ | ||
| 76 | .abort; \ | ||
| 77 | .endif; \ | ||
| 78 | .endif | ||
| 79 | |||
| 80 | #define __check_kprobe_x86 \ | ||
| 81 | .ifdef KPROBE_X86_IN; \ | ||
| 82 | .ifeq KPROBE_X86_IN; \ | ||
| 83 | __macro_err_x86; \ | ||
| 84 | .abort; \ | ||
| 85 | .endif; \ | ||
| 86 | .endif | ||
| 87 | |||
| 88 | #define __check_entry_kprobe_x86 \ | ||
| 89 | __check_entry_x86; \ | ||
| 90 | __check_kprobe_x86 | ||
| 91 | |||
| 92 | #define ENTRY_KPROBE_FINAL_X86 __check_entry_kprobe_x86 | ||
| 93 | |||
| 94 | #define ENTRY_X86(name) \ | ||
| 95 | __check_entry_kprobe_x86; \ | ||
| 96 | __set_entry_x86; \ | ||
| 97 | .globl name; \ | ||
| 98 | __ALIGN; \ | ||
| 99 | name: | ||
| 100 | |||
| 101 | #define END_X86(name) \ | ||
| 102 | __unset_entry_x86; \ | ||
| 103 | __check_entry_kprobe_x86; \ | ||
| 104 | .size name, .-name | ||
| 105 | |||
| 106 | #define KPROBE_ENTRY_X86(name) \ | ||
| 107 | __check_entry_kprobe_x86; \ | ||
| 108 | __set_kprobe_x86; \ | ||
| 109 | .pushsection .kprobes.text, "ax"; \ | ||
| 110 | .globl name; \ | ||
| 111 | __ALIGN; \ | ||
| 112 | name: | ||
| 113 | |||
| 114 | #define KPROBE_END_X86(name) \ | ||
| 115 | __unset_kprobe_x86; \ | ||
| 116 | __check_entry_kprobe_x86; \ | ||
| 117 | .size name, .-name; \ | ||
| 118 | .popsection | ||
| 119 | 67 | ||
| 120 | #endif /* _ASM_X86_LINKAGE_H */ | 68 | #endif /* _ASM_X86_LINKAGE_H */ |
| 121 | 69 | ||
