Lines Matching refs:p

48 int __kprobes arch_prepare_kprobe(struct kprobe *p)  in arch_prepare_kprobe()  argument
52 unsigned long addr = (unsigned long)p->addr; in arch_prepare_kprobe()
78 insn = __mem_to_opcode_arm(*p->addr); in arch_prepare_kprobe()
84 p->opcode = insn; in arch_prepare_kprobe()
85 p->ainsn.insn = tmp_insn; in arch_prepare_kprobe()
87 switch ((*decode_insn)(insn, &p->ainsn, true, actions, checkers)) { in arch_prepare_kprobe()
92 p->ainsn.insn = get_insn_slot(); in arch_prepare_kprobe()
93 if (!p->ainsn.insn) in arch_prepare_kprobe()
96 p->ainsn.insn[is] = tmp_insn[is]; in arch_prepare_kprobe()
97 flush_insns(p->ainsn.insn, in arch_prepare_kprobe()
98 sizeof(p->ainsn.insn[0]) * MAX_INSN_SIZE); in arch_prepare_kprobe()
99 p->ainsn.insn_fn = (probes_insn_fn_t *) in arch_prepare_kprobe()
100 ((uintptr_t)p->ainsn.insn | thumb); in arch_prepare_kprobe()
104 p->ainsn.insn = NULL; in arch_prepare_kprobe()
113 if ((p->ainsn.stack_space < 0) || in arch_prepare_kprobe()
114 (p->ainsn.stack_space > MAX_STACK_SIZE)) in arch_prepare_kprobe()
120 void __kprobes arch_arm_kprobe(struct kprobe *p) in arch_arm_kprobe() argument
127 addr = (void *)((uintptr_t)p->addr & ~1); in arch_arm_kprobe()
129 if (is_wide_instruction(p->opcode)) in arch_arm_kprobe()
134 kprobe_opcode_t insn = p->opcode; in arch_arm_kprobe()
136 addr = p->addr; in arch_arm_kprobe()
163 struct patch *p = data; in __kprobes_remove_breakpoint() local
164 __patch_text(p->addr, p->insn); in __kprobes_remove_breakpoint()
170 struct patch p = { in kprobes_remove_breakpoint() local
174 stop_machine_cpuslocked(__kprobes_remove_breakpoint, &p, in kprobes_remove_breakpoint()
178 void __kprobes arch_disarm_kprobe(struct kprobe *p) in arch_disarm_kprobe() argument
180 kprobes_remove_breakpoint((void *)((uintptr_t)p->addr & ~1), in arch_disarm_kprobe()
181 p->opcode); in arch_disarm_kprobe()
184 void __kprobes arch_remove_kprobe(struct kprobe *p) in arch_remove_kprobe() argument
186 if (p->ainsn.insn) { in arch_remove_kprobe()
187 free_insn_slot(p->ainsn.insn, 0); in arch_remove_kprobe()
188 p->ainsn.insn = NULL; in arch_remove_kprobe()
204 static void __kprobes set_current_kprobe(struct kprobe *p) in set_current_kprobe() argument
206 __this_cpu_write(current_kprobe, p); in set_current_kprobe()
210 singlestep_skip(struct kprobe *p, struct pt_regs *regs) in singlestep_skip() argument
214 if (is_wide_instruction(p->opcode)) in singlestep_skip()
224 singlestep(struct kprobe *p, struct pt_regs *regs, struct kprobe_ctlblk *kcb) in singlestep() argument
226 p->ainsn.insn_singlestep(p->opcode, &p->ainsn, regs); in singlestep()
238 struct kprobe *p, *cur; in kprobe_handler() local
250 p = get_kprobe((kprobe_opcode_t *)(regs->ARM_pc | 1)); in kprobe_handler()
251 if (!p) in kprobe_handler()
252 p = get_kprobe((kprobe_opcode_t *)regs->ARM_pc); in kprobe_handler()
255 p = get_kprobe((kprobe_opcode_t *)regs->ARM_pc); in kprobe_handler()
258 if (p) { in kprobe_handler()
259 if (!p->ainsn.insn_check_cc(regs->ARM_cpsr)) { in kprobe_handler()
266 singlestep_skip(p, regs); in kprobe_handler()
274 kprobes_inc_nmissed_count(p); in kprobe_handler()
276 set_current_kprobe(p); in kprobe_handler()
278 singlestep(p, regs, kcb); in kprobe_handler()
284 dump_kprobe(p); in kprobe_handler()
292 set_current_kprobe(p); in kprobe_handler()
302 if (!p->pre_handler || !p->pre_handler(p, regs)) { in kprobe_handler()
304 singlestep(p, regs, kcb); in kprobe_handler()
305 if (p->post_handler) { in kprobe_handler()
307 p->post_handler(p, regs, 0); in kprobe_handler()
430 int __kprobes arch_trampoline_kprobe(struct kprobe *p) in arch_trampoline_kprobe() argument