Lines Matching full:regs

60 	struct pt_regs *regs, const char *loglvl);
86 static void print_gr(const char *level, struct pt_regs *regs) in print_gr() argument
93 printbinary(buf, regs->gr[0], 32); in print_gr()
97 PRINTREGS(level, regs->gr, "r", RFMT, i); in print_gr()
100 static void print_fr(const char *level, struct pt_regs *regs) in print_fr() argument
124 PRINTREGS(level, regs->fr, "fr", FFMT, i); in print_fr()
127 void show_regs(struct pt_regs *regs) in show_regs() argument
133 user = user_mode(regs); in show_regs()
138 print_gr(level, regs); in show_regs()
141 PRINTREGS(level, regs->sr, "sr", RFMT, i); in show_regs()
144 print_fr(level, regs); in show_regs()
150 level, regs->iasq[0], regs->iasq[1], regs->iaoq[0], regs->iaoq[1]); in show_regs()
152 level, regs->iir, regs->isr, regs->ior); in show_regs()
155 printk("%s ORIG_R28: " RFMT "\n", level, regs->orig_r28); in show_regs()
158 printk("%s IAOQ[0]: " RFMT "\n", level, regs->iaoq[0]); in show_regs()
159 printk("%s IAOQ[1]: " RFMT "\n", level, regs->iaoq[1]); in show_regs()
160 printk("%s RP(r2): " RFMT "\n", level, regs->gr[2]); in show_regs()
162 printk("%s IAOQ[0]: %pS\n", level, (void *) regs->iaoq[0]); in show_regs()
163 printk("%s IAOQ[1]: %pS\n", level, (void *) regs->iaoq[1]); in show_regs()
164 printk("%s RP(r2): %pS\n", level, (void *) regs->gr[2]); in show_regs()
166 parisc_show_stack(current, regs, KERN_DEFAULT); in show_regs()
173 #define parisc_printk_ratelimited(critical, regs, fmt, ...) { \ argument
176 show_regs(regs); \
200 struct pt_regs *regs, const char *loglvl) in parisc_show_stack() argument
204 unwind_frame_init_task(&info, task, regs); in parisc_show_stack()
219 void die_if_kernel(char *str, struct pt_regs *regs, long err) in die_if_kernel() argument
221 if (user_mode(regs)) { in die_if_kernel()
225 parisc_printk_ratelimited(1, regs, in die_if_kernel()
227 current->comm, task_pid_nr(current), str, err, regs->iaoq[0]); in die_if_kernel()
261 show_regs(regs); in die_if_kernel()
277 static void handle_gdb_break(struct pt_regs *regs, int wot) in handle_gdb_break() argument
280 (void __user *) (regs->iaoq[0] & ~3)); in handle_gdb_break()
283 static void handle_break(struct pt_regs *regs) in handle_break() argument
285 unsigned iir = regs->iir; in handle_break()
287 if (unlikely(iir == PARISC_BUG_BREAK_INSN && !user_mode(regs))) { in handle_break()
290 tt = report_bug(regs->iaoq[0] & ~3, regs); in handle_break()
292 regs->iaoq[0] += 4; in handle_break()
293 regs->iaoq[1] += 4; in handle_break()
296 die_if_kernel("Unknown kernel breakpoint", regs, in handle_break()
301 if (unlikely(iir == PARISC_KPROBES_BREAK_INSN && !user_mode(regs))) { in handle_break()
302 parisc_kprobe_break_handler(regs); in handle_break()
305 if (unlikely(iir == PARISC_KPROBES_BREAK_INSN2 && !user_mode(regs))) { in handle_break()
306 parisc_kprobe_ss_handler(regs); in handle_break()
313 iir == PARISC_KGDB_BREAK_INSN)) && !user_mode(regs)) { in handle_break()
314 kgdb_handle_exception(9, SIGTRAP, 0, regs); in handle_break()
320 if ((iir == SPINLOCK_BREAK_INSN) && !user_mode(regs)) { in handle_break()
321 die_if_kernel("Spinlock was trashed", regs, 1); in handle_break()
326 parisc_printk_ratelimited(0, regs, in handle_break()
332 handle_gdb_break(regs, TRAP_BRKPT); in handle_break()
335 static void default_trap(int code, struct pt_regs *regs) in default_trap() argument
338 show_regs(regs); in default_trap()
341 static void transfer_pim_to_trap_frame(struct pt_regs *regs) in transfer_pim_to_trap_frame() argument
359 regs->gr[0] = pim_wide->cr[22]; in transfer_pim_to_trap_frame()
362 regs->gr[i] = pim_wide->gr[i]; in transfer_pim_to_trap_frame()
365 regs->fr[i] = pim_wide->fr[i]; in transfer_pim_to_trap_frame()
368 regs->sr[i] = pim_wide->sr[i]; in transfer_pim_to_trap_frame()
370 regs->iasq[0] = pim_wide->cr[17]; in transfer_pim_to_trap_frame()
371 regs->iasq[1] = pim_wide->iasq_back; in transfer_pim_to_trap_frame()
372 regs->iaoq[0] = pim_wide->cr[18]; in transfer_pim_to_trap_frame()
373 regs->iaoq[1] = pim_wide->iaoq_back; in transfer_pim_to_trap_frame()
375 regs->sar = pim_wide->cr[11]; in transfer_pim_to_trap_frame()
376 regs->iir = pim_wide->cr[19]; in transfer_pim_to_trap_frame()
377 regs->isr = pim_wide->cr[20]; in transfer_pim_to_trap_frame()
378 regs->ior = pim_wide->cr[21]; in transfer_pim_to_trap_frame()
383 regs->gr[0] = pim_narrow->cr[22]; in transfer_pim_to_trap_frame()
386 regs->gr[i] = pim_narrow->gr[i]; in transfer_pim_to_trap_frame()
389 regs->fr[i] = pim_narrow->fr[i]; in transfer_pim_to_trap_frame()
392 regs->sr[i] = pim_narrow->sr[i]; in transfer_pim_to_trap_frame()
394 regs->iasq[0] = pim_narrow->cr[17]; in transfer_pim_to_trap_frame()
395 regs->iasq[1] = pim_narrow->iasq_back; in transfer_pim_to_trap_frame()
396 regs->iaoq[0] = pim_narrow->cr[18]; in transfer_pim_to_trap_frame()
397 regs->iaoq[1] = pim_narrow->iaoq_back; in transfer_pim_to_trap_frame()
399 regs->sar = pim_narrow->cr[11]; in transfer_pim_to_trap_frame()
400 regs->iir = pim_narrow->cr[19]; in transfer_pim_to_trap_frame()
401 regs->isr = pim_narrow->cr[20]; in transfer_pim_to_trap_frame()
402 regs->ior = pim_narrow->cr[21]; in transfer_pim_to_trap_frame()
410 regs->ksp = 0; in transfer_pim_to_trap_frame()
411 regs->kpc = 0; in transfer_pim_to_trap_frame()
412 regs->orig_r28 = 0; in transfer_pim_to_trap_frame()
421 void parisc_terminate(char *msg, struct pt_regs *regs, int code, unsigned long offset) in parisc_terminate() argument
425 (void)notify_die(DIE_OOPS, msg, regs, 0, code, SIGTRAP); in parisc_terminate()
439 transfer_pim_to_trap_frame(regs); in parisc_terminate()
448 /* show_stack(NULL, (unsigned long *)regs->gr[30]); */ in parisc_terminate()
450 unwind_frame_init(&info, current, regs); in parisc_terminate()
457 show_regs(regs); in parisc_terminate()
478 void notrace handle_interruption(int code, struct pt_regs *regs) in handle_interruption() argument
484 if (!irqs_disabled_flags(regs->gr[0])) in handle_interruption()
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 | PRIV_USER; 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()
544 kgdb_handle_exception(0, SIGTRAP, 0, regs); in handle_interruption()
549 if (user_space(regs)) in handle_interruption()
550 handle_gdb_break(regs, TRAP_TRACE); in handle_interruption()
560 default_trap(code, regs); in handle_interruption()
565 fault_address = regs->iaoq[0]; in handle_interruption()
566 fault_space = regs->iasq[0]; in handle_interruption()
571 die_if_kernel("Illegal instruction", regs, code); in handle_interruption()
577 handle_break(regs); in handle_interruption()
582 die_if_kernel("Privileged operation", regs, code); in handle_interruption()
588 if ((regs->iir & 0xffdfffe0) == 0x034008a0) { in handle_interruption()
594 if (regs->iir & 0x00200000) in handle_interruption()
595 regs->gr[regs->iir & 0x1f] = mfctl(27); in handle_interruption()
597 regs->gr[regs->iir & 0x1f] = mfctl(26); in handle_interruption()
599 regs->iaoq[0] = regs->iaoq[1]; in handle_interruption()
600 regs->iaoq[1] += 4; in handle_interruption()
601 regs->iasq[0] = regs->iasq[1]; in handle_interruption()
605 die_if_kernel("Privileged register usage", regs, code); in handle_interruption()
609 (void __user *) regs->iaoq[0]); in handle_interruption()
615 (void __user *) regs->iaoq[0]); in handle_interruption()
622 if(user_mode(regs)){ in handle_interruption()
627 (void __user *) regs->iaoq[0]); in handle_interruption()
635 die_if_kernel("Floating point exception", regs, 0); /* quiet */ in handle_interruption()
637 perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, regs, 0); in handle_interruption()
638 handle_fpe(regs); in handle_interruption()
661 if (code == 17 && handle_nadtlb_fault(regs)) in handle_interruption()
663 fault_address = regs->ior; in handle_interruption()
664 fault_space = regs->isr; in handle_interruption()
670 if (check_unaligned(regs)) { in handle_interruption()
671 handle_unaligned(regs); in handle_interruption()
677 fault_address = regs->ior; in handle_interruption()
678 fault_space = regs->isr; in handle_interruption()
683 regs->gr[0] |= PSW_X; /* So we can single-step over the trap */ in handle_interruption()
687 handle_gdb_break(regs, TRAP_HWBKPT); in handle_interruption()
692 regs->gr[0] &= ~PSW_T; in handle_interruption()
693 if (user_space(regs)) in handle_interruption()
694 handle_gdb_break(regs, TRAP_BRANCH); in handle_interruption()
715 if (user_mode(regs)) { in handle_interruption()
719 vma = find_vma(current->mm,regs->iaoq[0]); in handle_interruption()
720 if (vma && (regs->iaoq[0] >= vma->vm_start) in handle_interruption()
723 fault_address = regs->iaoq[0]; in handle_interruption()
724 fault_space = regs->iasq[0]; in handle_interruption()
732 regs->iir = 0xbaadf00d; 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()
793 parisc_acctyp(code, regs->iir) == VM_WRITE, regs)) in handle_interruption()
796 parisc_terminate("Kernel Fault", regs, code, fault_address); in handle_interruption()
800 do_page_fault(regs, code, fault_address); in handle_interruption()