• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/src/linux/linux-2.6/arch/ppc/kernel/

Lines Matching refs:regs

42 extern int xmon_bpt(struct pt_regs *regs);
43 extern int xmon_sstep(struct pt_regs *regs);
44 extern int xmon_iabr_match(struct pt_regs *regs);
45 extern int xmon_dabr_match(struct pt_regs *regs);
47 int (*debugger)(struct pt_regs *regs) = xmon;
48 int (*debugger_bpt)(struct pt_regs *regs) = xmon_bpt;
49 int (*debugger_sstep)(struct pt_regs *regs) = xmon_sstep;
50 int (*debugger_iabr_match)(struct pt_regs *regs) = xmon_iabr_match;
51 int (*debugger_dabr_match)(struct pt_regs *regs) = xmon_dabr_match;
52 void (*debugger_fault_handler)(struct pt_regs *regs);
55 int (*debugger)(struct pt_regs *regs);
56 int (*debugger_bpt)(struct pt_regs *regs);
57 int (*debugger_sstep)(struct pt_regs *regs);
58 int (*debugger_iabr_match)(struct pt_regs *regs);
59 int (*debugger_dabr_match)(struct pt_regs *regs);
60 void (*debugger_fault_handler)(struct pt_regs *regs);
62 #define debugger(regs) do { } while (0)
63 #define debugger_bpt(regs) 0
64 #define debugger_sstep(regs) 0
65 #define debugger_iabr_match(regs) 0
66 #define debugger_dabr_match(regs) 0
102 void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr)
106 if (!user_mode(regs)) {
107 debugger(regs);
108 die("Exception in kernel mode", regs, signr);
149 static inline int check_io_access(struct pt_regs *regs)
152 unsigned long msr = regs->msr;
154 unsigned int *nip = (unsigned int *)regs->nip;
157 && (entry = search_exception_tables(regs->nip)) != NULL) {
182 regs->gpr[rb] - _IO_BASE, nip);
183 regs->msr |= MSR_RI;
184 regs->nip = entry->fixup;
195 #define get_reason(regs) ((regs)->dsisr)
197 #define get_mc_reason(regs) ((regs)->dsisr)
199 #define get_mc_reason(regs) (mfspr(SPRN_MCSR))
207 #define single_stepping(regs) (current->thread.dbcr0 & DBCR0_IC)
208 #define clear_single_step(regs) (current->thread.dbcr0 &= ~DBCR0_IC)
213 #define get_reason(regs) ((regs)->msr)
214 #define get_mc_reason(regs) ((regs)->msr)
220 #define single_stepping(regs) ((regs)->msr & MSR_SE)
221 #define clear_single_step(regs) ((regs)->msr &= ~MSR_SE)
229 platform_machine_check(struct pt_regs *regs)
233 void machine_check_exception(struct pt_regs *regs)
235 unsigned long reason = get_mc_reason(regs);
237 if (user_mode(regs)) {
238 regs->msr |= MSR_RI;
239 _exception(SIGBUS, regs, BUS_ADRERR, regs->nip);
245 bad_page_fault(regs, regs->dar, SIGBUS);
250 debugger_fault_handler(regs);
251 regs->msr |= MSR_RI;
255 if (check_io_access(regs))
379 platform_machine_check(regs);
381 debugger(regs);
382 die("machine check", regs, SIGBUS);
385 void SMIException(struct pt_regs *regs)
387 debugger(regs);
389 show_regs(regs);
394 void unknown_exception(struct pt_regs *regs)
397 regs->nip, regs->msr, regs->trap, print_tainted());
398 _exception(SIGTRAP, regs, 0, 0);
401 void instruction_breakpoint_exception(struct pt_regs *regs)
403 if (debugger_iabr_match(regs))
405 _exception(SIGTRAP, regs, TRAP_BRKPT, 0);
408 void RunModeException(struct pt_regs *regs)
410 _exception(SIGTRAP, regs, 0, 0);
440 static int emulate_string_inst(struct pt_regs *regs, u32 instword)
454 EA = (rA == 0) ? 0 : regs->gpr[rA];
460 num_bytes = regs->xer & 0x7f;
483 regs->gpr[rT] = 0;
484 regs->gpr[rT] |= val << shift;
488 val = regs->gpr[rT] >> shift;
508 static int emulate_instruction(struct pt_regs *regs)
513 if (!user_mode(regs))
515 CHECK_FULL_REGS(regs);
517 if (get_user(instword, (u32 __user *)(regs->nip)))
524 regs->gpr[rd] = mfspr(SPRN_PVR);
537 regs->ccr = (regs->ccr & ~msk) | ((regs->xer >> shift) & msk);
538 regs->xer &= ~0xf0000000UL;
544 return emulate_string_inst(regs, instword);
555 static void emulate_single_step(struct pt_regs *regs)
557 if (single_stepping(regs)) {
558 clear_single_step(regs);
559 _exception(SIGTRAP, regs, TRAP_TRACE, 0);
568 void program_check_exception(struct pt_regs *regs)
570 unsigned int reason = get_reason(regs);
571 extern int do_mathemu(struct pt_regs *regs);
581 if (!(reason & REASON_TRAP) && do_mathemu(regs) == 0) {
582 emulate_single_step(regs);
593 * our MSR_FP in regs
596 if (regs->msr & MSR_FP)
612 _exception(SIGFPE, regs, code, regs->nip);
618 if (debugger_bpt(regs))
621 if (!(regs->msr & MSR_PR) && /* not user-mode */
622 report_bug(regs->nip) == BUG_TRAP_TYPE_WARN) {
623 regs->nip += 4;
626 _exception(SIGTRAP, regs, TRAP_BRKPT, 0);
632 switch (emulate_instruction(regs)) {
634 regs->nip += 4;
635 emulate_single_step(regs);
638 _exception(SIGSEGV, regs, SEGV_MAPERR, regs->nip);
644 _exception(SIGILL, regs, ILL_PRVOPC, regs->nip);
646 _exception(SIGILL, regs, ILL_ILLOPC, regs->nip);
649 void single_step_exception(struct pt_regs *regs)
651 regs->msr &= ~(MSR_SE | MSR_BE); /* Turn off 'trace' bits */
652 if (debugger_sstep(regs))
654 _exception(SIGTRAP, regs, TRAP_TRACE, 0);
657 void alignment_exception(struct pt_regs *regs)
661 fixed = fix_alignment(regs);
663 regs->nip += 4; /* skip over emulated instruction */
664 emulate_single_step(regs);
674 if (user_mode(regs))
675 _exception(sig, regs, code, regs->dar);
677 bad_page_fault(regs, regs->dar, sig);
680 void StackOverflow(struct pt_regs *regs)
683 current, regs->gpr[1]);
684 debugger(regs);
685 show_regs(regs);
689 void nonrecoverable_exception(struct pt_regs *regs)
692 regs->nip, regs->msr);
693 debugger(regs);
694 die("nonrecoverable exception", regs, SIGKILL);
697 void trace_syscall(struct pt_regs *regs)
700 current, current->pid, regs->nip, regs->link, regs->gpr[0],
701 regs->ccr&0x10000000?"Error=":"", regs->gpr[3], print_tainted());
705 void SoftwareEmulation(struct pt_regs *regs)
711 CHECK_FULL_REGS(regs);
713 if (!user_mode(regs)) {
714 debugger(regs);
715 die("Kernel Mode Software FPU Emulation", regs, SIGFPE);
719 errcode = do_mathemu(regs);
721 errcode = Soft_emulate_8xx(regs);
725 _exception(SIGFPE, regs, 0, 0);
727 _exception(SIGSEGV, regs, 0, 0);
729 _exception(SIGILL, regs, ILL_ILLOPC, regs->nip);
731 emulate_single_step(regs);
737 void DebugException(struct pt_regs *regs, unsigned long debug_status)
740 regs->msr &= ~MSR_DE;
741 if (user_mode(regs)) {
748 if (debugger_sstep(regs))
751 _exception(SIGTRAP, regs, TRAP_TRACE, 0);
757 void TAUException(struct pt_regs *regs)
760 regs->nip, regs->msr, regs->trap, print_tainted());
768 void kernel_fp_unavailable_exception(struct pt_regs *regs)
770 regs->msr |= MSR_FP;
772 current, regs->nip);
775 void altivec_unavailable_exception(struct pt_regs *regs)
780 if (user_mode(regs)) {
783 _exception(SIGILL, regs, ILL_ILLOPC, regs->nip);
791 current, regs->nip);
792 regs->msr |= MSR_VEC;
796 void altivec_assist_exception(struct pt_regs *regs)
801 if (regs->msr & MSR_VEC)
804 if (!user_mode(regs)) {
806 " at %lx\n", regs->nip);
807 debugger(regs);
808 die("altivec assist exception", regs, SIGFPE);
812 err = emulate_altivec(regs);
814 regs->nip += 4; /* skip emulated instruction */
815 emulate_single_step(regs);
821 _exception(SIGSEGV, regs, SEGV_ACCERR, regs->nip);
825 "in %s at %lx\n", current->comm, regs->nip);
832 void performance_monitor_exception(struct pt_regs *regs)
834 perf_irq(regs);
839 void CacheLockingException(struct pt_regs *regs, unsigned long address,
847 _exception(SIGILL, regs, ILL_PRVOPC, regs->nip);
853 void SPEFloatingPointException(struct pt_regs *regs)
883 _exception(SIGFPE, regs, code, regs->nip);
893 void __attribute__ ((weak)) WatchdogHandler(struct pt_regs *regs)
900 void WatchdogException(struct pt_regs *regs)
903 WatchdogHandler(regs);