Lines Matching refs:kcb

156 static void save_previous_kprobe(struct kprobe_ctlblk *kcb)  in save_previous_kprobe()  argument
158 kcb->prev_kprobe.kp = kprobe_running(); in save_previous_kprobe()
159 kcb->prev_kprobe.status = kcb->kprobe_status; in save_previous_kprobe()
160 kcb->prev_kprobe.old_SR = kcb->kprobe_old_SR; in save_previous_kprobe()
161 kcb->prev_kprobe.saved_SR = kcb->kprobe_saved_SR; in save_previous_kprobe()
162 kcb->prev_kprobe.saved_epc = kcb->kprobe_saved_epc; in save_previous_kprobe()
165 static void restore_previous_kprobe(struct kprobe_ctlblk *kcb) in restore_previous_kprobe() argument
167 __this_cpu_write(current_kprobe, kcb->prev_kprobe.kp); in restore_previous_kprobe()
168 kcb->kprobe_status = kcb->prev_kprobe.status; in restore_previous_kprobe()
169 kcb->kprobe_old_SR = kcb->prev_kprobe.old_SR; in restore_previous_kprobe()
170 kcb->kprobe_saved_SR = kcb->prev_kprobe.saved_SR; in restore_previous_kprobe()
171 kcb->kprobe_saved_epc = kcb->prev_kprobe.saved_epc; in restore_previous_kprobe()
175 struct kprobe_ctlblk *kcb) in set_current_kprobe() argument
178 kcb->kprobe_saved_SR = kcb->kprobe_old_SR = (regs->cp0_status & ST0_IE); in set_current_kprobe()
179 kcb->kprobe_saved_epc = regs->cp0_epc; in set_current_kprobe()
196 struct kprobe_ctlblk *kcb) in evaluate_branch_instruction() argument
207 kcb->flags |= SKIP_DELAYSLOT; in evaluate_branch_instruction()
209 kcb->flags &= ~SKIP_DELAYSLOT; in evaluate_branch_instruction()
216 kcb->flags |= SKIP_DELAYSLOT; in evaluate_branch_instruction()
218 kcb->target_epc = regs->cp0_epc; in evaluate_branch_instruction()
230 struct kprobe_ctlblk *kcb) in prepare_singlestep() argument
241 ret = evaluate_branch_instruction(p, regs, kcb); in prepare_singlestep()
262 struct kprobe_ctlblk *kcb) in resume_execution() argument
265 regs->cp0_epc = kcb->target_epc; in resume_execution()
267 unsigned long orig_epc = kcb->kprobe_saved_epc; in resume_execution()
277 struct kprobe_ctlblk *kcb; in kprobe_handler() local
286 kcb = get_kprobe_ctlblk(); in kprobe_handler()
292 if (kcb->kprobe_status == KPROBE_HIT_SS && in kprobe_handler()
295 regs->cp0_status |= kcb->kprobe_saved_SR; in kprobe_handler()
305 save_previous_kprobe(kcb); in kprobe_handler()
306 set_current_kprobe(p, regs, kcb); in kprobe_handler()
308 prepare_singlestep(p, regs, kcb); in kprobe_handler()
309 kcb->kprobe_status = KPROBE_REENTER; in kprobe_handler()
310 if (kcb->flags & SKIP_DELAYSLOT) { in kprobe_handler()
311 resume_execution(p, regs, kcb); in kprobe_handler()
312 restore_previous_kprobe(kcb); in kprobe_handler()
343 set_current_kprobe(p, regs, kcb); in kprobe_handler()
344 kcb->kprobe_status = KPROBE_HIT_ACTIVE; in kprobe_handler()
353 prepare_singlestep(p, regs, kcb); in kprobe_handler()
354 if (kcb->flags & SKIP_DELAYSLOT) { in kprobe_handler()
355 kcb->kprobe_status = KPROBE_HIT_SSDONE; in kprobe_handler()
358 resume_execution(p, regs, kcb); in kprobe_handler()
361 kcb->kprobe_status = KPROBE_HIT_SS; in kprobe_handler()
374 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); in post_kprobe_handler() local
379 if ((kcb->kprobe_status != KPROBE_REENTER) && cur->post_handler) { in post_kprobe_handler()
380 kcb->kprobe_status = KPROBE_HIT_SSDONE; in post_kprobe_handler()
384 resume_execution(cur, regs, kcb); in post_kprobe_handler()
386 regs->cp0_status |= kcb->kprobe_saved_SR; in post_kprobe_handler()
389 if (kcb->kprobe_status == KPROBE_REENTER) { in post_kprobe_handler()
390 restore_previous_kprobe(kcb); in post_kprobe_handler()
403 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); in kprobe_fault_handler() local
405 if (kcb->kprobe_status & KPROBE_HIT_SS) { in kprobe_fault_handler()
406 resume_execution(cur, regs, kcb); in kprobe_fault_handler()
407 regs->cp0_status |= kcb->kprobe_old_SR; in kprobe_fault_handler()