kprobes.c (5e2aa2ed08e2e280121dc7cf5609c87d464f12ef) | kprobes.c (494fc42170bf0747ac28e12ef13a7d388d5ff2c7) |
---|---|
1/* arch/sparc64/kernel/kprobes.c 2 * 3 * Copyright (C) 2004 David S. Miller <davem@davemloft.net> 4 */ 5 6#include <linux/kernel.h> 7#include <linux/kprobes.h> 8#include <linux/module.h> --- 69 unchanged lines hidden (view full) --- 78 kcb->prev_kprobe.kp = kprobe_running(); 79 kcb->prev_kprobe.status = kcb->kprobe_status; 80 kcb->prev_kprobe.orig_tnpc = kcb->kprobe_orig_tnpc; 81 kcb->prev_kprobe.orig_tstate_pil = kcb->kprobe_orig_tstate_pil; 82} 83 84static void __kprobes restore_previous_kprobe(struct kprobe_ctlblk *kcb) 85{ | 1/* arch/sparc64/kernel/kprobes.c 2 * 3 * Copyright (C) 2004 David S. Miller <davem@davemloft.net> 4 */ 5 6#include <linux/kernel.h> 7#include <linux/kprobes.h> 8#include <linux/module.h> --- 69 unchanged lines hidden (view full) --- 78 kcb->prev_kprobe.kp = kprobe_running(); 79 kcb->prev_kprobe.status = kcb->kprobe_status; 80 kcb->prev_kprobe.orig_tnpc = kcb->kprobe_orig_tnpc; 81 kcb->prev_kprobe.orig_tstate_pil = kcb->kprobe_orig_tstate_pil; 82} 83 84static void __kprobes restore_previous_kprobe(struct kprobe_ctlblk *kcb) 85{ |
86 __get_cpu_var(current_kprobe) = kcb->prev_kprobe.kp; | 86 __this_cpu_write(current_kprobe, kcb->prev_kprobe.kp); |
87 kcb->kprobe_status = kcb->prev_kprobe.status; 88 kcb->kprobe_orig_tnpc = kcb->prev_kprobe.orig_tnpc; 89 kcb->kprobe_orig_tstate_pil = kcb->prev_kprobe.orig_tstate_pil; 90} 91 92static void __kprobes set_current_kprobe(struct kprobe *p, struct pt_regs *regs, 93 struct kprobe_ctlblk *kcb) 94{ | 87 kcb->kprobe_status = kcb->prev_kprobe.status; 88 kcb->kprobe_orig_tnpc = kcb->prev_kprobe.orig_tnpc; 89 kcb->kprobe_orig_tstate_pil = kcb->prev_kprobe.orig_tstate_pil; 90} 91 92static void __kprobes set_current_kprobe(struct kprobe *p, struct pt_regs *regs, 93 struct kprobe_ctlblk *kcb) 94{ |
95 __get_cpu_var(current_kprobe) = p; | 95 __this_cpu_write(current_kprobe, p); |
96 kcb->kprobe_orig_tnpc = regs->tnpc; 97 kcb->kprobe_orig_tstate_pil = (regs->tstate & TSTATE_PIL); 98} 99 100static void __kprobes prepare_singlestep(struct kprobe *p, struct pt_regs *regs, 101 struct kprobe_ctlblk *kcb) 102{ 103 regs->tstate |= TSTATE_PIL; --- 46 unchanged lines hidden (view full) --- 150 if (*(u32 *)addr != BREAKPOINT_INSTRUCTION) { 151 /* The breakpoint instruction was removed by 152 * another cpu right after we hit, no further 153 * handling of this interrupt is appropriate 154 */ 155 ret = 1; 156 goto no_kprobe; 157 } | 96 kcb->kprobe_orig_tnpc = regs->tnpc; 97 kcb->kprobe_orig_tstate_pil = (regs->tstate & TSTATE_PIL); 98} 99 100static void __kprobes prepare_singlestep(struct kprobe *p, struct pt_regs *regs, 101 struct kprobe_ctlblk *kcb) 102{ 103 regs->tstate |= TSTATE_PIL; --- 46 unchanged lines hidden (view full) --- 150 if (*(u32 *)addr != BREAKPOINT_INSTRUCTION) { 151 /* The breakpoint instruction was removed by 152 * another cpu right after we hit, no further 153 * handling of this interrupt is appropriate 154 */ 155 ret = 1; 156 goto no_kprobe; 157 } |
158 p = __get_cpu_var(current_kprobe); | 158 p = __this_cpu_read(current_kprobe); |
159 if (p->break_handler && p->break_handler(p, regs)) 160 goto ss_probe; 161 } 162 goto no_kprobe; 163 } 164 165 p = get_kprobe(addr); 166 if (!p) { --- 437 unchanged lines hidden --- | 159 if (p->break_handler && p->break_handler(p, regs)) 160 goto ss_probe; 161 } 162 goto no_kprobe; 163 } 164 165 p = get_kprobe(addr); 166 if (!p) { --- 437 unchanged lines hidden --- |