Lines Matching refs:regs

52 	struct pt_regs *regs);
78 static void print_gr(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(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); in show_regs()
165 #define parisc_printk_ratelimited(critical, regs, fmt, ...) { \ argument
168 show_regs(regs); \
192 struct pt_regs *regs) 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()
448 unwind_frame_init(&info, current, regs); in parisc_terminate()
455 show_regs(regs); in parisc_terminate()
476 void notrace handle_interruption(int code, struct pt_regs *regs) in handle_interruption() argument
507 if (((unsigned long)regs->iaoq[0] & 3) && in handle_interruption()
508 ((unsigned long)regs->iasq[0] != (unsigned long)regs->sr[7])) { in handle_interruption()
510 regs->iaoq[0] = 0 | 3; in handle_interruption()
511 regs->iaoq[1] = regs->iaoq[0] + 4; in handle_interruption()
512 regs->iasq[0] = regs->iasq[1] = regs->sr[7]; in handle_interruption()
513 regs->gr[0] &= ~PSW_B; in handle_interruption()
530 regs, code, 0); in handle_interruption()
540 regs->gr[0] &= ~PSW_R; in handle_interruption()
543 if (parisc_kprobe_ss_handler(regs)) in handle_interruption()
549 kgdb_handle_exception(0, SIGTRAP, 0, regs); in handle_interruption()
554 if (user_space(regs)) in handle_interruption()
555 handle_gdb_break(regs, TRAP_TRACE); in handle_interruption()
565 cpu_lpmc(5, regs); in handle_interruption()
570 fault_address = regs->iaoq[0]; in handle_interruption()
571 fault_space = regs->iasq[0]; in handle_interruption()
576 die_if_kernel("Illegal instruction", regs, code); in handle_interruption()
582 handle_break(regs); in handle_interruption()
587 die_if_kernel("Privileged operation", regs, code); in handle_interruption()
593 if ((regs->iir & 0xffdfffe0) == 0x034008a0) { in handle_interruption()
599 if (regs->iir & 0x00200000) in handle_interruption()
600 regs->gr[regs->iir & 0x1f] = mfctl(27); in handle_interruption()
602 regs->gr[regs->iir & 0x1f] = mfctl(26); in handle_interruption()
604 regs->iaoq[0] = regs->iaoq[1]; in handle_interruption()
605 regs->iaoq[1] += 4; in handle_interruption()
606 regs->iasq[0] = regs->iasq[1]; in handle_interruption()
610 die_if_kernel("Privileged register usage", regs, code); in handle_interruption()
614 (void __user *) regs->iaoq[0]); in handle_interruption()
620 (void __user *) regs->iaoq[0]); in handle_interruption()
627 if(user_mode(regs)){ in handle_interruption()
632 (void __user *) regs->iaoq[0]); in handle_interruption()
640 die_if_kernel("Floating point exception", regs, 0); /* quiet */ in handle_interruption()
642 handle_fpe(regs); in handle_interruption()
665 fault_address = regs->ior; in handle_interruption()
666 fault_space = regs->isr; in handle_interruption()
672 if (check_unaligned(regs)) { in handle_interruption()
673 handle_unaligned(regs); in handle_interruption()
679 fault_address = regs->ior; in handle_interruption()
680 fault_space = regs->isr; in handle_interruption()
685 regs->gr[0] |= PSW_X; /* So we can single-step over the trap */ in handle_interruption()
689 handle_gdb_break(regs, TRAP_HWBKPT); in handle_interruption()
694 regs->gr[0] &= ~PSW_T; in handle_interruption()
695 if (user_space(regs)) in handle_interruption()
696 handle_gdb_break(regs, TRAP_BRANCH); in handle_interruption()
717 if (user_mode(regs)) { in handle_interruption()
721 vma = find_vma(current->mm,regs->iaoq[0]); in handle_interruption()
722 if (vma && (regs->iaoq[0] >= vma->vm_start) in handle_interruption()
725 fault_address = regs->iaoq[0]; in handle_interruption()
726 fault_space = regs->iasq[0]; in handle_interruption()
736 if (code == 27 && !user_mode(regs) && in handle_interruption()
737 fixup_exception(regs)) in handle_interruption()
740 die_if_kernel("Protection id trap", regs, code); in handle_interruption()
743 ((void __user *) regs->iaoq[0]) : in handle_interruption()
744 ((void __user *) regs->ior)); in handle_interruption()
749 handle_unaligned(regs); in handle_interruption()
753 if (user_mode(regs)) { in handle_interruption()
754 parisc_printk_ratelimited(0, regs, KERN_DEBUG in handle_interruption()
759 (void __user *)regs->ior); in handle_interruption()
764 parisc_terminate("Unexpected interruption", regs, code, 0); in handle_interruption()
768 if (user_mode(regs)) { in handle_interruption()
769 if ((fault_space >> SPACEID_SHIFT) != (regs->sr[7] >> SPACEID_SHIFT)) { in handle_interruption()
770 parisc_printk_ratelimited(0, regs, KERN_DEBUG in handle_interruption()
775 (void __user *)regs->ior); in handle_interruption()
789 if (fixup_exception(regs)) in handle_interruption()
792 parisc_terminate("Kernel Fault", regs, code, fault_address); in handle_interruption()
796 do_page_fault(regs, code, fault_address); in handle_interruption()