linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86: Add temporary ifdefs to kprobes_{32|64}.c
@ 2007-12-14 22:38 Harvey Harrison
  0 siblings, 0 replies; only message in thread
From: Harvey Harrison @ 2007-12-14 22:38 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: H. Peter Anvin, LKML, Thomas Gleixner

Keep reducing the diff size moving code around.  This will get
cleaner in the final unified file.

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
---
 arch/x86/kernel/kprobes_32.c |   15 +++++++++++++++
 arch/x86/kernel/kprobes_64.c |   17 ++++++++++++-----
 2 files changed, 27 insertions(+), 5 deletions(-)

diff --git a/arch/x86/kernel/kprobes_32.c b/arch/x86/kernel/kprobes_32.c
index cebc077..f4ba584 100644
--- a/arch/x86/kernel/kprobes_32.c
+++ b/arch/x86/kernel/kprobes_32.c
@@ -915,12 +915,27 @@ int __kprobes longjmp_break_handler(struct kprobe *p, struct pt_regs *regs)
 	return 0;
 }
 
+#ifdef CONFIG_X86_64
+static struct kprobe trampoline_p = {
+	.addr = (kprobe_opcode_t *) &kretprobe_trampoline,
+	.pre_handler = trampoline_probe_handler
+};
+#endif
+
 int __kprobes arch_trampoline_kprobe(struct kprobe *p)
 {
+#ifdef CONFIG_X86_64
+	if (p->addr == (kprobe_opcode_t *)&kretprobe_trampoline)
+		return 1;
+#endif
 	return 0;
 }
 
 int __init arch_init_kprobes(void)
 {
+#ifdef CONFIG_X86_32
 	return 0;
+#else
+	return register_kprobe(&trampoline_p);
+#endif
 }
diff --git a/arch/x86/kernel/kprobes_64.c b/arch/x86/kernel/kprobes_64.c
index 6f62a4a..13a92ef 100644
--- a/arch/x86/kernel/kprobes_64.c
+++ b/arch/x86/kernel/kprobes_64.c
@@ -869,20 +869,27 @@ int __kprobes longjmp_break_handler(struct kprobe *p, struct pt_regs *regs)
 	return 0;
 }
 
+#ifdef CONFIG_X86_64
 static struct kprobe trampoline_p = {
 	.addr = (kprobe_opcode_t *) &kretprobe_trampoline,
 	.pre_handler = trampoline_probe_handler
 };
-
-int __init arch_init_kprobes(void)
-{
-	return register_kprobe(&trampoline_p);
-}
+#endif
 
 int __kprobes arch_trampoline_kprobe(struct kprobe *p)
 {
+#ifdef CONFIG_X86_64
 	if (p->addr == (kprobe_opcode_t *)&kretprobe_trampoline)
 		return 1;
+#endif
+	return 0;
+}
 
+int __init arch_init_kprobes(void)
+{
+#ifdef CONFIG_X86_32
 	return 0;
+#else
+	return register_kprobe(&trampoline_p);
+#endif
 }
-- 
1.5.4.rc0.1083.gf568




^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2007-12-14 22:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-14 22:38 [PATCH] x86: Add temporary ifdefs to kprobes_{32|64}.c Harvey Harrison

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).