Lines Matching refs:regs

52 	struct pt_regs *regs, const char *loglvl);
78 static void print_gr(const char *level, struct pt_regs *regs) in print_gr() argument
85 printbinary(buf, regs->gr[0], 32); in print_gr()
89 PRINTREGS(level, regs->gr, "r", RFMT, i); in print_gr()
92 static void print_fr(const char *level, struct pt_regs *regs) in print_fr() argument
116 PRINTREGS(level, regs->fr, "fr", FFMT, i); in print_fr()
119 void show_regs(struct pt_regs *regs) in show_regs() argument
125 user = user_mode(regs); in show_regs()
130 print_gr(level, regs); in show_regs()
133 PRINTREGS(level, regs->sr, "sr", RFMT, i); in show_regs()
136 print_fr(level, regs); in show_regs()
142 level, regs->iasq[0], regs->iasq[1], regs->iaoq[0], regs->iaoq[1]); in show_regs()
144 level, regs->iir, regs->isr, regs->ior); in show_regs()
147 printk("%s ORIG_R28: " RFMT "\n", level, regs->orig_r28); in show_regs()
150 printk("%s IAOQ[0]: " RFMT "\n", level, regs->iaoq[0]); in show_regs()
151 printk("%s IAOQ[1]: " RFMT "\n", level, regs->iaoq[1]); in show_regs()
152 printk("%s RP(r2): " RFMT "\n", level, regs->gr[2]); in show_regs()
154 printk("%s IAOQ[0]: %pS\n", level, (void *) regs->iaoq[0]); in show_regs()
155 printk("%s IAOQ[1]: %pS\n", level, (void *) regs->iaoq[1]); in show_regs()
156 printk("%s RP(r2): %pS\n", level, (void *) regs->gr[2]); in show_regs()
158 parisc_show_stack(current, regs, KERN_DEFAULT); in show_regs()
165 #define parisc_printk_ratelimited(critical, regs, fmt, ...) { \ argument
168 show_regs(regs); \
192 struct pt_regs *regs, const char *loglvl) in parisc_show_stack() argument
196 unwind_frame_init_task(&info, task, regs); in parisc_show_stack()
211 void die_if_kernel(char *str, struct pt_regs *regs, long err) in die_if_kernel() argument
213 if (user_mode(regs)) { in die_if_kernel()
217 parisc_printk_ratelimited(1, regs, in die_if_kernel()
219 current->comm, task_pid_nr(current), str, err, regs->iaoq[0]); in die_if_kernel()
260 show_regs(regs); in die_if_kernel()
276 static void handle_gdb_break(struct pt_regs *regs, int wot) in handle_gdb_break() argument
279 (void __user *) (regs->iaoq[0] & ~3)); in handle_gdb_break()
282 static void handle_break(struct pt_regs *regs) in handle_break() argument
284 unsigned iir = regs->iir; in handle_break()
286 if (unlikely(iir == PARISC_BUG_BREAK_INSN && !user_mode(regs))) { in handle_break()
289 tt = report_bug(regs->iaoq[0] & ~3, regs); in handle_break()
291 regs->iaoq[0] += 4; in handle_break()
292 regs->iaoq[1] += 4; in handle_break()
295 die_if_kernel("Unknown kernel breakpoint", regs, in handle_break()
301 parisc_kprobe_break_handler(regs); in handle_break()
310 kgdb_handle_exception(9, SIGTRAP, 0, regs); in handle_break()
316 parisc_printk_ratelimited(0, regs, in handle_break()
322 handle_gdb_break(regs, TRAP_BRKPT); in handle_break()
325 static void default_trap(int code, struct pt_regs *regs) in default_trap() argument
328 show_regs(regs); in default_trap()
331 void (*cpu_lpmc) (int code, struct pt_regs *regs) __read_mostly = default_trap;
334 void transfer_pim_to_trap_frame(struct pt_regs *regs) in transfer_pim_to_trap_frame() argument
352 regs->gr[0] = pim_wide->cr[22]; in transfer_pim_to_trap_frame()
355 regs->gr[i] = pim_wide->gr[i]; in transfer_pim_to_trap_frame()
358 regs->fr[i] = pim_wide->fr[i]; in transfer_pim_to_trap_frame()
361 regs->sr[i] = pim_wide->sr[i]; in transfer_pim_to_trap_frame()
363 regs->iasq[0] = pim_wide->cr[17]; in transfer_pim_to_trap_frame()
364 regs->iasq[1] = pim_wide->iasq_back; in transfer_pim_to_trap_frame()
365 regs->iaoq[0] = pim_wide->cr[18]; in transfer_pim_to_trap_frame()
366 regs->iaoq[1] = pim_wide->iaoq_back; in transfer_pim_to_trap_frame()
368 regs->sar = pim_wide->cr[11]; in transfer_pim_to_trap_frame()
369 regs->iir = pim_wide->cr[19]; in transfer_pim_to_trap_frame()
370 regs->isr = pim_wide->cr[20]; in transfer_pim_to_trap_frame()
371 regs->ior = pim_wide->cr[21]; in transfer_pim_to_trap_frame()
376 regs->gr[0] = pim_narrow->cr[22]; in transfer_pim_to_trap_frame()
379 regs->gr[i] = pim_narrow->gr[i]; in transfer_pim_to_trap_frame()
382 regs->fr[i] = pim_narrow->fr[i]; in transfer_pim_to_trap_frame()
385 regs->sr[i] = pim_narrow->sr[i]; in transfer_pim_to_trap_frame()
387 regs->iasq[0] = pim_narrow->cr[17]; in transfer_pim_to_trap_frame()
388 regs->iasq[1] = pim_narrow->iasq_back; in transfer_pim_to_trap_frame()
389 regs->iaoq[0] = pim_narrow->cr[18]; in transfer_pim_to_trap_frame()
390 regs->iaoq[1] = pim_narrow->iaoq_back; in transfer_pim_to_trap_frame()
392 regs->sar = pim_narrow->cr[11]; in transfer_pim_to_trap_frame()
393 regs->iir = pim_narrow->cr[19]; in transfer_pim_to_trap_frame()
394 regs->isr = pim_narrow->cr[20]; in transfer_pim_to_trap_frame()
395 regs->ior = pim_narrow->cr[21]; in transfer_pim_to_trap_frame()
403 regs->ksp = 0; in transfer_pim_to_trap_frame()
404 regs->kpc = 0; in transfer_pim_to_trap_frame()
405 regs->orig_r28 = 0; in transfer_pim_to_trap_frame()
414 void parisc_terminate(char *msg, struct pt_regs *regs, int code, unsigned long offset) in parisc_terminate() argument
418 (void)notify_die(DIE_OOPS, msg, regs, 0, code, SIGTRAP); in parisc_terminate()
436 transfer_pim_to_trap_frame(regs); in parisc_terminate()
447 unwind_frame_init(&info, current, regs); in parisc_terminate()
454 show_regs(regs); in parisc_terminate()
475 void notrace handle_interruption(int code, struct pt_regs *regs) in handle_interruption() argument
506 if (((unsigned long)regs->iaoq[0] & 3) && in handle_interruption()
507 ((unsigned long)regs->iasq[0] != (unsigned long)regs->sr[7])) { in handle_interruption()
509 regs->iaoq[0] = 0 | 3; in handle_interruption()
510 regs->iaoq[1] = regs->iaoq[0] + 4; in handle_interruption()
511 regs->iasq[0] = regs->iasq[1] = regs->sr[7]; in handle_interruption()
512 regs->gr[0] &= ~PSW_B; in handle_interruption()
529 regs, code, 0); in handle_interruption()
539 regs->gr[0] &= ~PSW_R; in handle_interruption()
542 if (parisc_kprobe_ss_handler(regs)) in handle_interruption()
548 kgdb_handle_exception(0, SIGTRAP, 0, regs); in handle_interruption()
553 if (user_space(regs)) in handle_interruption()
554 handle_gdb_break(regs, TRAP_TRACE); in handle_interruption()
564 cpu_lpmc(5, regs); in handle_interruption()
569 fault_address = regs->iaoq[0]; in handle_interruption()
570 fault_space = regs->iasq[0]; in handle_interruption()
575 die_if_kernel("Illegal instruction", regs, code); in handle_interruption()
581 handle_break(regs); in handle_interruption()
586 die_if_kernel("Privileged operation", regs, code); in handle_interruption()
592 if ((regs->iir & 0xffdfffe0) == 0x034008a0) { in handle_interruption()
598 if (regs->iir & 0x00200000) in handle_interruption()
599 regs->gr[regs->iir & 0x1f] = mfctl(27); in handle_interruption()
601 regs->gr[regs->iir & 0x1f] = mfctl(26); in handle_interruption()
603 regs->iaoq[0] = regs->iaoq[1]; in handle_interruption()
604 regs->iaoq[1] += 4; in handle_interruption()
605 regs->iasq[0] = regs->iasq[1]; in handle_interruption()
609 die_if_kernel("Privileged register usage", regs, code); in handle_interruption()
613 (void __user *) regs->iaoq[0]); in handle_interruption()
619 (void __user *) regs->iaoq[0]); in handle_interruption()
626 if(user_mode(regs)){ in handle_interruption()
631 (void __user *) regs->iaoq[0]); in handle_interruption()
639 die_if_kernel("Floating point exception", regs, 0); /* quiet */ in handle_interruption()
641 handle_fpe(regs); in handle_interruption()
664 fault_address = regs->ior; in handle_interruption()
665 fault_space = regs->isr; in handle_interruption()
671 if (check_unaligned(regs)) { in handle_interruption()
672 handle_unaligned(regs); in handle_interruption()
678 fault_address = regs->ior; in handle_interruption()
679 fault_space = regs->isr; in handle_interruption()
684 regs->gr[0] |= PSW_X; /* So we can single-step over the trap */ in handle_interruption()
688 handle_gdb_break(regs, TRAP_HWBKPT); in handle_interruption()
693 regs->gr[0] &= ~PSW_T; in handle_interruption()
694 if (user_space(regs)) in handle_interruption()
695 handle_gdb_break(regs, TRAP_BRANCH); in handle_interruption()
716 if (user_mode(regs)) { in handle_interruption()
720 vma = find_vma(current->mm,regs->iaoq[0]); in handle_interruption()
721 if (vma && (regs->iaoq[0] >= vma->vm_start) in handle_interruption()
724 fault_address = regs->iaoq[0]; in handle_interruption()
725 fault_space = regs->iasq[0]; in handle_interruption()
735 if (code == 27 && !user_mode(regs) && in handle_interruption()
736 fixup_exception(regs)) in handle_interruption()
739 die_if_kernel("Protection id trap", regs, code); in handle_interruption()
742 ((void __user *) regs->iaoq[0]) : in handle_interruption()
743 ((void __user *) regs->ior)); in handle_interruption()
748 handle_unaligned(regs); in handle_interruption()
752 if (user_mode(regs)) { in handle_interruption()
753 parisc_printk_ratelimited(0, regs, KERN_DEBUG in handle_interruption()
758 (void __user *)regs->ior); in handle_interruption()
763 parisc_terminate("Unexpected interruption", regs, code, 0); in handle_interruption()
767 if (user_mode(regs)) { in handle_interruption()
768 if ((fault_space >> SPACEID_SHIFT) != (regs->sr[7] >> SPACEID_SHIFT)) { in handle_interruption()
769 parisc_printk_ratelimited(0, regs, KERN_DEBUG in handle_interruption()
774 (void __user *)regs->ior); in handle_interruption()
788 if (fixup_exception(regs)) in handle_interruption()
791 parisc_terminate("Kernel Fault", regs, code, fault_address); in handle_interruption()
795 do_page_fault(regs, code, fault_address); in handle_interruption()