Lines Matching refs:p
40 int __kprobes arch_prepare_kprobe(struct kprobe *p) in arch_prepare_kprobe() argument
42 kprobe_opcode_t opcode = *(kprobe_opcode_t *) (p->addr); in arch_prepare_kprobe()
47 memcpy(p->ainsn.insn, p->addr, MAX_INSN_SIZE * sizeof(kprobe_opcode_t)); in arch_prepare_kprobe()
48 p->opcode = opcode; in arch_prepare_kprobe()
53 void __kprobes arch_arm_kprobe(struct kprobe *p) in arch_arm_kprobe() argument
55 *p->addr = BREAKPOINT_INSTRUCTION; in arch_arm_kprobe()
56 flush_icache_range((unsigned long)p->addr, in arch_arm_kprobe()
57 (unsigned long)p->addr + sizeof(kprobe_opcode_t)); in arch_arm_kprobe()
60 void __kprobes arch_disarm_kprobe(struct kprobe *p) in arch_disarm_kprobe() argument
62 *p->addr = p->opcode; in arch_disarm_kprobe()
63 flush_icache_range((unsigned long)p->addr, in arch_disarm_kprobe()
64 (unsigned long)p->addr + sizeof(kprobe_opcode_t)); in arch_disarm_kprobe()
67 int __kprobes arch_trampoline_kprobe(struct kprobe *p) in arch_trampoline_kprobe() argument
69 if (*p->addr == BREAKPOINT_INSTRUCTION) in arch_trampoline_kprobe()
83 struct kprobe *p = get_kprobe((kprobe_opcode_t *) pc + 1); in kprobe_handle_illslot() local
85 if (p != NULL) { in kprobe_handle_illslot()
88 unregister_kprobe(p); in kprobe_handle_illslot()
95 void __kprobes arch_remove_kprobe(struct kprobe *p) in arch_remove_kprobe() argument
100 arch_disarm_kprobe(p); in arch_remove_kprobe()
128 static void __kprobes set_current_kprobe(struct kprobe *p, struct pt_regs *regs, in set_current_kprobe() argument
131 __this_cpu_write(current_kprobe, p); in set_current_kprobe()
139 static void __kprobes prepare_singlestep(struct kprobe *p, struct pt_regs *regs) in prepare_singlestep() argument
143 if (p != NULL) { in prepare_singlestep()
146 arch_disarm_kprobe(p); in prepare_singlestep()
151 if (OPCODE_JSR(p->opcode) || OPCODE_JMP(p->opcode)) { in prepare_singlestep()
152 unsigned int reg_nr = ((p->opcode >> 8) & 0x000F); in prepare_singlestep()
154 } else if (OPCODE_BRA(p->opcode) || OPCODE_BSR(p->opcode)) { in prepare_singlestep()
155 unsigned long disp = (p->opcode & 0x0FFF); in prepare_singlestep()
159 } else if (OPCODE_BRAF(p->opcode) || OPCODE_BSRF(p->opcode)) { in prepare_singlestep()
160 unsigned int reg_nr = ((p->opcode >> 8) & 0x000F); in prepare_singlestep()
165 } else if (OPCODE_RTS(p->opcode)) { in prepare_singlestep()
168 } else if (OPCODE_BF(p->opcode) || OPCODE_BT(p->opcode)) { in prepare_singlestep()
169 unsigned long disp = (p->opcode & 0x00FF); in prepare_singlestep()
171 op1->addr = p->addr + 1; in prepare_singlestep()
178 } else if (OPCODE_BF_S(p->opcode) || OPCODE_BT_S(p->opcode)) { in prepare_singlestep()
179 unsigned long disp = (p->opcode & 0x00FF); in prepare_singlestep()
181 op1->addr = p->addr + 2; in prepare_singlestep()
189 op1->addr = p->addr + 1; in prepare_singlestep()
210 struct kprobe *p; in kprobe_handler() local
226 p = get_kprobe(addr); in kprobe_handler()
227 if (p) { in kprobe_handler()
229 *p->ainsn.insn == BREAKPOINT_INSTRUCTION) { in kprobe_handler()
239 set_current_kprobe(p, regs, kcb); in kprobe_handler()
240 kprobes_inc_nmissed_count(p); in kprobe_handler()
241 prepare_singlestep(p, regs); in kprobe_handler()
248 p = get_kprobe(addr); in kprobe_handler()
249 if (!p) { in kprobe_handler()
265 set_current_kprobe(p, regs, kcb); in kprobe_handler()
268 if (p->pre_handler && p->pre_handler(p, regs)) { in kprobe_handler()
275 prepare_singlestep(p, regs); in kprobe_handler()
299 int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs) in trampoline_probe_handler() argument
311 struct kprobe *p = NULL; in post_kprobe_handler() local
321 p = this_cpu_ptr(&saved_next_opcode); in post_kprobe_handler()
322 if (p->addr) { in post_kprobe_handler()
323 arch_disarm_kprobe(p); in post_kprobe_handler()
324 p->addr = NULL; in post_kprobe_handler()
325 p->opcode = 0; in post_kprobe_handler()
330 p = get_kprobe(addr); in post_kprobe_handler()
331 arch_arm_kprobe(p); in post_kprobe_handler()
333 p = this_cpu_ptr(&saved_next_opcode2); in post_kprobe_handler()
334 if (p->addr) { in post_kprobe_handler()
335 arch_disarm_kprobe(p); in post_kprobe_handler()
336 p->addr = NULL; in post_kprobe_handler()
337 p->opcode = 0; in post_kprobe_handler()
407 struct kprobe *p = NULL; in kprobe_exceptions_notify() local
424 p = get_kprobe(addr); in kprobe_exceptions_notify()