Skip to contentSkip to conversation

x86: Move in_kprobes_functions to linux/kprobes.h

PATCH In review Abhishek Sagar 1 participant 1 message Jan 27, 2008 kprobes

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 x86: Move in_kprobes_functions to linux/kprobes.h

Moving in_kprobes_functions to linux/kprobes.h to share it with arch/x86/kerne/kprobes.c.

---

include/linux/kprobes.h +9 -0
index 6168c0a..2762145 100644
@@ -39,6 +39,7 @@
 
 #ifdef CONFIG_KPROBES
 #include <asm/kprobes.h>
+#include <asm-generic/sections.h>
 
 /* kprobe_status settings */
 #define KPROBE_HIT_ACTIVE	0x00000001
@@ -182,6 +183,14 @@ static inline void kretprobe_assert(struct kretprobe_instance *ri,
 	}
 }
 
+static inline int in_kprobes_functions(unsigned long addr)
+{
+	if (addr >= (unsigned long)__kprobes_text_start &&
+	    addr < (unsigned long)__kprobes_text_end)
+		return -EINVAL;
+	return 0;
+}
+
 #ifdef CONFIG_KPROBES_SANITY_TEST
 extern int init_test_probes(void);
 #else
kernel/kprobes.c +0 -8
index d0493ea..0b74dfb 100644
@@ -490,14 +490,6 @@ static int __kprobes register_aggr_kprobe(struct kprobe *old_p,
 	return ret;
 }
 
-static int __kprobes in_kprobes_functions(unsigned long addr)
-{
-	if (addr >= (unsigned long)__kprobes_text_start &&
-	    addr < (unsigned long)__kprobes_text_end)
-		return -EINVAL;
-	return 0;
-}
-
 static int __kprobes __register_kprobe(struct kprobe *p,
 	unsigned long called_from)
 {