Lines Matching refs:kcb

77 static void __kprobes save_previous_kprobe(struct kprobe_ctlblk *kcb)  in save_previous_kprobe()  argument
79 kcb->prev_kprobe.kp = kprobe_running(); in save_previous_kprobe()
80 kcb->prev_kprobe.status = kcb->kprobe_status; in save_previous_kprobe()
81 kcb->prev_kprobe.orig_tnpc = kcb->kprobe_orig_tnpc; in save_previous_kprobe()
82 kcb->prev_kprobe.orig_tstate_pil = kcb->kprobe_orig_tstate_pil; in save_previous_kprobe()
85 static void __kprobes restore_previous_kprobe(struct kprobe_ctlblk *kcb) in restore_previous_kprobe() argument
87 __this_cpu_write(current_kprobe, kcb->prev_kprobe.kp); in restore_previous_kprobe()
88 kcb->kprobe_status = kcb->prev_kprobe.status; in restore_previous_kprobe()
89 kcb->kprobe_orig_tnpc = kcb->prev_kprobe.orig_tnpc; in restore_previous_kprobe()
90 kcb->kprobe_orig_tstate_pil = kcb->prev_kprobe.orig_tstate_pil; in restore_previous_kprobe()
94 struct kprobe_ctlblk *kcb) in set_current_kprobe() argument
97 kcb->kprobe_orig_tnpc = regs->tnpc; in set_current_kprobe()
98 kcb->kprobe_orig_tstate_pil = (regs->tstate & TSTATE_PIL); in set_current_kprobe()
102 struct kprobe_ctlblk *kcb) in prepare_singlestep() argument
109 regs->tnpc = kcb->kprobe_orig_tnpc; in prepare_singlestep()
121 struct kprobe_ctlblk *kcb; in kprobe_handler() local
128 kcb = get_kprobe_ctlblk(); in kprobe_handler()
133 if (kcb->kprobe_status == KPROBE_HIT_SS) { in kprobe_handler()
135 kcb->kprobe_orig_tstate_pil); in kprobe_handler()
144 save_previous_kprobe(kcb); in kprobe_handler()
145 set_current_kprobe(p, regs, kcb); in kprobe_handler()
147 kcb->kprobe_status = KPROBE_REENTER; in kprobe_handler()
148 prepare_singlestep(p, regs, kcb); in kprobe_handler()
176 set_current_kprobe(p, regs, kcb); in kprobe_handler()
177 kcb->kprobe_status = KPROBE_HIT_ACTIVE; in kprobe_handler()
184 prepare_singlestep(p, regs, kcb); in kprobe_handler()
185 kcb->kprobe_status = KPROBE_HIT_SS; in kprobe_handler()
278 struct pt_regs *regs, struct kprobe_ctlblk *kcb) in resume_execution() argument
285 regs->tpc = kcb->kprobe_orig_tnpc; in resume_execution()
290 kcb->kprobe_orig_tstate_pil); in resume_execution()
296 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); in post_kprobe_handler() local
301 if ((kcb->kprobe_status != KPROBE_REENTER) && cur->post_handler) { in post_kprobe_handler()
302 kcb->kprobe_status = KPROBE_HIT_SSDONE; in post_kprobe_handler()
306 resume_execution(cur, regs, kcb); in post_kprobe_handler()
309 if (kcb->kprobe_status == KPROBE_REENTER) { in post_kprobe_handler()
310 restore_previous_kprobe(kcb); in post_kprobe_handler()
323 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); in kprobe_fault_handler() local
326 switch(kcb->kprobe_status) { in kprobe_fault_handler()
337 regs->tnpc = kcb->kprobe_orig_tnpc; in kprobe_fault_handler()
339 kcb->kprobe_orig_tstate_pil); in kprobe_fault_handler()
340 if (kcb->kprobe_status == KPROBE_REENTER) in kprobe_fault_handler()
341 restore_previous_kprobe(kcb); in kprobe_fault_handler()