[PATCH] x86: Add temporary ifdefs to kprobes_{32|64}.c

From: Harvey Harrison
Date: Fri Dec 14 2007 - 17:42:06 EST


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

Signed-off-by: Harvey Harrison <harvey.harrison@xxxxxxxxx>
---
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



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/