diff options
-rw-r--r-- | include/linux/compiler.h | 6 | ||||
-rw-r--r-- | include/linux/kprobes.h | 6 |
2 files changed, 7 insertions, 5 deletions
diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 10b8f23fab0f..92669cd182a6 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h | |||
@@ -351,4 +351,10 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); | |||
351 | */ | 351 | */ |
352 | #define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x)) | 352 | #define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x)) |
353 | 353 | ||
354 | /* Ignore/forbid kprobes attach on very low level functions marked by this attribute: */ | ||
355 | #ifdef CONFIG_KPROBES | ||
356 | # define __kprobes __attribute__((__section__(".kprobes.text"))) | ||
357 | #else | ||
358 | # define __kprobes | ||
359 | #endif | ||
354 | #endif /* __LINUX_COMPILER_H */ | 360 | #endif /* __LINUX_COMPILER_H */ |
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h index 4b6ef4d33cc2..ca1d27a0d6a6 100644 --- a/include/linux/kprobes.h +++ b/include/linux/kprobes.h | |||
@@ -29,6 +29,7 @@ | |||
29 | * <jkenisto@us.ibm.com> and Prasanna S Panchamukhi | 29 | * <jkenisto@us.ibm.com> and Prasanna S Panchamukhi |
30 | * <prasanna@in.ibm.com> added function-return probes. | 30 | * <prasanna@in.ibm.com> added function-return probes. |
31 | */ | 31 | */ |
32 | #include <linux/compiler.h> /* for __kprobes */ | ||
32 | #include <linux/linkage.h> | 33 | #include <linux/linkage.h> |
33 | #include <linux/list.h> | 34 | #include <linux/list.h> |
34 | #include <linux/notifier.h> | 35 | #include <linux/notifier.h> |
@@ -49,16 +50,11 @@ | |||
49 | #define KPROBE_REENTER 0x00000004 | 50 | #define KPROBE_REENTER 0x00000004 |
50 | #define KPROBE_HIT_SSDONE 0x00000008 | 51 | #define KPROBE_HIT_SSDONE 0x00000008 |
51 | 52 | ||
52 | /* Attach to insert probes on any functions which should be ignored*/ | ||
53 | #define __kprobes __attribute__((__section__(".kprobes.text"))) | ||
54 | |||
55 | #else /* CONFIG_KPROBES */ | 53 | #else /* CONFIG_KPROBES */ |
56 | typedef int kprobe_opcode_t; | 54 | typedef int kprobe_opcode_t; |
57 | struct arch_specific_insn { | 55 | struct arch_specific_insn { |
58 | int dummy; | 56 | int dummy; |
59 | }; | 57 | }; |
60 | #define __kprobes | ||
61 | |||
62 | #endif /* CONFIG_KPROBES */ | 58 | #endif /* CONFIG_KPROBES */ |
63 | 59 | ||
64 | struct kprobe; | 60 | struct kprobe; |