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
--
| H. Peter Anvin | Re: [rft] s2ram wakeup moves to .c, could fix few machines |
| Greg Kroah-Hartman | [PATCH 002/196] Chinese: rephrase English introduction in HOWTO |
| Ingo Molnar | [patch] PID namespace design bug, workaround |
| Tarkan Erimer | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
git: | |
| Eric Dumazet | Re: Multicast packet loss |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| David Miller | [GIT]: Networking |
| Jarek Poplawski | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
