diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-generic/sections.h | 1 | ||||
-rw-r--r-- | include/asm-generic/vmlinux.lds.h | 6 | ||||
-rw-r--r-- | include/linux/kprobes.h | 3 | ||||
-rw-r--r-- | include/linux/linkage.h | 7 |
4 files changed, 17 insertions, 0 deletions
diff --git a/include/asm-generic/sections.h b/include/asm-generic/sections.h index 450eae22c39a..886dbd116899 100644 --- a/include/asm-generic/sections.h +++ b/include/asm-generic/sections.h | |||
@@ -12,5 +12,6 @@ extern char _sextratext[] __attribute__((weak)); | |||
12 | extern char _eextratext[] __attribute__((weak)); | 12 | extern char _eextratext[] __attribute__((weak)); |
13 | extern char _end[]; | 13 | extern char _end[]; |
14 | extern char __per_cpu_start[], __per_cpu_end[]; | 14 | extern char __per_cpu_start[], __per_cpu_end[]; |
15 | extern char __kprobes_text_start[], __kprobes_text_end[]; | ||
15 | 16 | ||
16 | #endif /* _ASM_GENERIC_SECTIONS_H_ */ | 17 | #endif /* _ASM_GENERIC_SECTIONS_H_ */ |
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index 3fa94288aa93..6f857be2b644 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h | |||
@@ -97,3 +97,9 @@ | |||
97 | VMLINUX_SYMBOL(__lock_text_start) = .; \ | 97 | VMLINUX_SYMBOL(__lock_text_start) = .; \ |
98 | *(.spinlock.text) \ | 98 | *(.spinlock.text) \ |
99 | VMLINUX_SYMBOL(__lock_text_end) = .; | 99 | VMLINUX_SYMBOL(__lock_text_end) = .; |
100 | |||
101 | #define KPROBES_TEXT \ | ||
102 | ALIGN_FUNCTION(); \ | ||
103 | VMLINUX_SYMBOL(__kprobes_text_start) = .; \ | ||
104 | *(.kprobes.text) \ | ||
105 | VMLINUX_SYMBOL(__kprobes_text_end) = .; | ||
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h index e050fc2d4c26..e30afdca7917 100644 --- a/include/linux/kprobes.h +++ b/include/linux/kprobes.h | |||
@@ -42,6 +42,9 @@ | |||
42 | #define KPROBE_REENTER 0x00000004 | 42 | #define KPROBE_REENTER 0x00000004 |
43 | #define KPROBE_HIT_SSDONE 0x00000008 | 43 | #define KPROBE_HIT_SSDONE 0x00000008 |
44 | 44 | ||
45 | /* Attach to insert probes on any functions which should be ignored*/ | ||
46 | #define __kprobes __attribute__((__section__(".kprobes.text"))) | ||
47 | |||
45 | struct kprobe; | 48 | struct kprobe; |
46 | struct pt_regs; | 49 | struct pt_regs; |
47 | struct kretprobe; | 50 | struct kretprobe; |
diff --git a/include/linux/linkage.h b/include/linux/linkage.h index 338f7795d8a0..147eb01e0d4b 100644 --- a/include/linux/linkage.h +++ b/include/linux/linkage.h | |||
@@ -33,6 +33,13 @@ | |||
33 | ALIGN; \ | 33 | ALIGN; \ |
34 | name: | 34 | name: |
35 | 35 | ||
36 | #define KPROBE_ENTRY(name) \ | ||
37 | .section .kprobes.text, "ax"; \ | ||
38 | .globl name; \ | ||
39 | ALIGN; \ | ||
40 | name: | ||
41 | |||
42 | |||
36 | #endif | 43 | #endif |
37 | 44 | ||
38 | #define NORET_TYPE /**/ | 45 | #define NORET_TYPE /**/ |