Lines Matching refs:kcb

70 	struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();  in arch_simulate_insn()  local
75 post_kprobe_handler(kcb, regs); in arch_simulate_insn()
129 static void __kprobes save_previous_kprobe(struct kprobe_ctlblk *kcb) in save_previous_kprobe() argument
131 kcb->prev_kprobe.kp = kprobe_running(); in save_previous_kprobe()
132 kcb->prev_kprobe.status = kcb->kprobe_status; in save_previous_kprobe()
135 static void __kprobes restore_previous_kprobe(struct kprobe_ctlblk *kcb) in restore_previous_kprobe() argument
137 __this_cpu_write(current_kprobe, kcb->prev_kprobe.kp); in restore_previous_kprobe()
138 kcb->kprobe_status = kcb->prev_kprobe.status; in restore_previous_kprobe()
154 static void __kprobes kprobes_save_local_irqflag(struct kprobe_ctlblk *kcb, in kprobes_save_local_irqflag() argument
157 kcb->saved_sr = regs->sr; in kprobes_save_local_irqflag()
161 static void __kprobes kprobes_restore_local_irqflag(struct kprobe_ctlblk *kcb, in kprobes_restore_local_irqflag() argument
164 regs->sr = kcb->saved_sr; in kprobes_restore_local_irqflag()
168 set_ss_context(struct kprobe_ctlblk *kcb, unsigned long addr, struct kprobe *p) in set_ss_context() argument
172 kcb->ss_ctx.ss_pending = true; in set_ss_context()
173 kcb->ss_ctx.match_addr = addr + offset; in set_ss_context()
176 static void __kprobes clear_ss_context(struct kprobe_ctlblk *kcb) in clear_ss_context() argument
178 kcb->ss_ctx.ss_pending = false; in clear_ss_context()
179 kcb->ss_ctx.match_addr = 0; in clear_ss_context()
188 struct kprobe_ctlblk *kcb, int reenter) in setup_singlestep() argument
193 save_previous_kprobe(kcb); in setup_singlestep()
195 kcb->kprobe_status = KPROBE_REENTER; in setup_singlestep()
197 kcb->kprobe_status = KPROBE_HIT_SS; in setup_singlestep()
204 set_ss_context(kcb, slot, p); /* mark pending ss */ in setup_singlestep()
207 kprobes_save_local_irqflag(kcb, regs); in setup_singlestep()
218 struct kprobe_ctlblk *kcb) in reenter_kprobe() argument
220 switch (kcb->kprobe_status) { in reenter_kprobe()
224 setup_singlestep(p, regs, kcb, 1); in reenter_kprobe()
241 post_kprobe_handler(struct kprobe_ctlblk *kcb, struct pt_regs *regs) in post_kprobe_handler() argument
253 if (kcb->kprobe_status == KPROBE_REENTER) { in post_kprobe_handler()
254 restore_previous_kprobe(kcb); in post_kprobe_handler()
259 kcb->kprobe_status = KPROBE_HIT_SSDONE; in post_kprobe_handler()
273 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); in kprobe_fault_handler() local
275 switch (kcb->kprobe_status) { in kprobe_fault_handler()
288 if (kcb->kprobe_status == KPROBE_REENTER) in kprobe_fault_handler()
289 restore_previous_kprobe(kcb); in kprobe_fault_handler()
310 struct kprobe_ctlblk *kcb; in kprobe_breakpoint_handler() local
313 kcb = get_kprobe_ctlblk(); in kprobe_breakpoint_handler()
320 if (reenter_kprobe(p, regs, kcb)) in kprobe_breakpoint_handler()
325 kcb->kprobe_status = KPROBE_HIT_ACTIVE; in kprobe_breakpoint_handler()
338 setup_singlestep(p, regs, kcb, 0); in kprobe_breakpoint_handler()
359 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); in kprobe_single_step_handler() local
361 if ((kcb->ss_ctx.ss_pending) in kprobe_single_step_handler()
362 && (kcb->ss_ctx.match_addr == instruction_pointer(regs))) { in kprobe_single_step_handler()
363 clear_ss_context(kcb); /* clear pending ss */ in kprobe_single_step_handler()
365 kprobes_restore_local_irqflag(kcb, regs); in kprobe_single_step_handler()
368 post_kprobe_handler(kcb, regs); in kprobe_single_step_handler()