Lines Matching refs:regs
46 extern void xmon(struct pt_regs *regs);
47 extern int xmon_bpt(struct pt_regs *regs);
48 extern int xmon_sstep(struct pt_regs *regs);
49 extern int xmon_iabr_match(struct pt_regs *regs);
50 extern int xmon_dabr_match(struct pt_regs *regs);
51 extern void (*xmon_fault_handler)(struct pt_regs *regs);
55 void (*debugger)(struct pt_regs *regs) = xmon;
56 int (*debugger_bpt)(struct pt_regs *regs) = xmon_bpt;
57 int (*debugger_sstep)(struct pt_regs *regs) = xmon_sstep;
58 int (*debugger_iabr_match)(struct pt_regs *regs) = xmon_iabr_match;
59 int (*debugger_dabr_match)(struct pt_regs *regs) = xmon_dabr_match;
60 void (*debugger_fault_handler)(struct pt_regs *regs);
63 void (*debugger)(struct pt_regs *regs);
64 int (*debugger_bpt)(struct pt_regs *regs);
65 int (*debugger_sstep)(struct pt_regs *regs);
66 int (*debugger_iabr_match)(struct pt_regs *regs);
67 int (*debugger_dabr_match)(struct pt_regs *regs);
68 void (*debugger_fault_handler)(struct pt_regs *regs);
70 #define debugger(regs) do { } while (0) argument
71 #define debugger_bpt(regs) 0 argument
72 #define debugger_sstep(regs) 0 argument
73 #define debugger_iabr_match(regs) 0 argument
74 #define debugger_dabr_match(regs) 0 argument
106 _exception(int signr, struct pt_regs *regs, int code, unsigned long addr) in _exception() argument
110 if (!user_mode(regs)) { in _exception()
111 debugger(regs); in _exception()
112 die("Exception in kernel mode", regs, signr); in _exception()
131 static inline int check_io_access(struct pt_regs *regs) in check_io_access() argument
135 unsigned long msr = regs->msr; in check_io_access()
138 && (fixup = search_exception_table(regs->nip)) != 0) { in check_io_access()
147 unsigned int *nip = (unsigned int *)regs->nip; in check_io_access()
160 regs->gpr[rb] - _IO_BASE, nip); in check_io_access()
161 regs->nip = fixup; in check_io_access()
172 #define get_reason(regs) ((regs)->dsisr) argument
179 #define single_stepping(regs) (current->thread.dbcr0 & DBCR0_IC) argument
180 #define clear_single_step(regs) (current->thread.dbcr0 &= ~DBCR0_IC) argument
185 #define get_reason(regs) ((regs)->msr) argument
191 #define single_stepping(regs) ((regs)->msr & MSR_SE) argument
192 #define clear_single_step(regs) ((regs)->msr &= ~MSR_SE) argument
196 MachineCheckException(struct pt_regs *regs) in MachineCheckException() argument
198 unsigned long reason = get_reason(regs); in MachineCheckException()
200 if (user_mode(regs)) { in MachineCheckException()
201 _exception(SIGBUS, regs, BUS_ADRERR, regs->nip); in MachineCheckException()
207 bad_page_fault(regs, regs->dar, SIGBUS); in MachineCheckException()
211 debugger_fault_handler(regs); in MachineCheckException()
214 if (check_io_access(regs)) in MachineCheckException()
286 debugger(regs); in MachineCheckException()
287 die("machine check", regs, SIGBUS); in MachineCheckException()
291 SMIException(struct pt_regs *regs) in SMIException() argument
293 debugger(regs); in SMIException()
295 show_regs(regs); in SMIException()
301 UnknownException(struct pt_regs *regs) in UnknownException() argument
304 regs->nip, regs->msr, regs->trap, print_tainted()); in UnknownException()
305 _exception(SIGTRAP, regs, 0, 0); in UnknownException()
309 InstructionBreakpoint(struct pt_regs *regs) in InstructionBreakpoint() argument
311 if (debugger_iabr_match(regs)) in InstructionBreakpoint()
313 _exception(SIGTRAP, regs, TRAP_BRKPT, 0); in InstructionBreakpoint()
317 RunModeException(struct pt_regs *regs) in RunModeException() argument
319 _exception(SIGTRAP, regs, 0, 0); in RunModeException()
336 emulate_instruction(struct pt_regs *regs) in emulate_instruction() argument
344 if (!user_mode(regs)) in emulate_instruction()
347 if (get_user(instword, (u32 *)(regs->nip))) in emulate_instruction()
354 regs->gpr[rd] = mfspr(PVR); in emulate_instruction()
356 regs->nip += 4; in emulate_instruction()
367 static void emulate_single_step(struct pt_regs *regs) in emulate_single_step() argument
369 if (single_stepping(regs)) { in emulate_single_step()
370 clear_single_step(regs); in emulate_single_step()
371 if (debugger_sstep(regs)) in emulate_single_step()
373 _exception(SIGTRAP, regs, TRAP_TRACE, 0); in emulate_single_step()
378 ProgramCheckException(struct pt_regs *regs) in ProgramCheckException() argument
380 unsigned int reason = get_reason(regs); in ProgramCheckException()
381 extern int do_mathemu(struct pt_regs *regs); in ProgramCheckException()
391 if (!(reason & REASON_TRAP) && do_mathemu(regs) == 0) { in ProgramCheckException()
392 emulate_single_step(regs); in ProgramCheckException()
402 if (regs->msr & MSR_FP) in ProgramCheckException()
416 _exception(SIGFPE, regs, code, regs->nip); in ProgramCheckException()
422 if (debugger_bpt(regs)) in ProgramCheckException()
424 _exception(SIGTRAP, regs, TRAP_BRKPT, 0); in ProgramCheckException()
430 if (emulate_instruction(regs) == 0) { in ProgramCheckException()
431 emulate_single_step(regs); in ProgramCheckException()
434 _exception(SIGILL, regs, ILL_PRVOPC, regs->nip); in ProgramCheckException()
438 _exception(SIGILL, regs, ILL_ILLOPC, regs->nip); in ProgramCheckException()
442 SingleStepException(struct pt_regs *regs) in SingleStepException() argument
444 regs->msr &= ~MSR_SE; /* Turn off 'trace' bit */ in SingleStepException()
445 if (debugger_sstep(regs)) in SingleStepException()
447 _exception(SIGTRAP, regs, TRAP_TRACE, 0); in SingleStepException()
451 AlignmentException(struct pt_regs *regs) in AlignmentException() argument
455 fixed = fix_alignment(regs); in AlignmentException()
457 regs->nip += 4; /* skip over emulated instruction */ in AlignmentException()
458 emulate_single_step(regs); in AlignmentException()
463 if (user_mode(regs)) in AlignmentException()
464 _exception(SIGSEGV, regs, SEGV_ACCERR, regs->dar); in AlignmentException()
466 bad_page_fault(regs, regs->dar, SIGSEGV); in AlignmentException()
469 _exception(SIGBUS, regs, BUS_ADRALN, regs->dar); in AlignmentException()
473 StackOverflow(struct pt_regs *regs) in StackOverflow() argument
476 current, regs->gpr[1]); in StackOverflow()
477 debugger(regs); in StackOverflow()
478 show_regs(regs); in StackOverflow()
483 trace_syscall(struct pt_regs *regs) in trace_syscall() argument
486 current, current->pid, regs->nip, regs->link, regs->gpr[0], in trace_syscall()
487 regs->ccr&0x10000000?"Error=":"", regs->gpr[3], print_tainted()); in trace_syscall()
492 SoftwareEmulation(struct pt_regs *regs) in SoftwareEmulation() argument
498 if (!user_mode(regs)) { in SoftwareEmulation()
499 debugger(regs); in SoftwareEmulation()
500 die("Kernel Mode Software FPU Emulation", regs, SIGFPE); in SoftwareEmulation()
504 errcode = do_mathemu(regs); in SoftwareEmulation()
506 errcode = Soft_emulate_8xx(regs); in SoftwareEmulation()
510 _exception(SIGFPE, regs, 0, 0); in SoftwareEmulation()
512 _exception(SIGSEGV, regs, 0, 0); in SoftwareEmulation()
514 _exception(SIGILL, regs, ILL_ILLOPC, regs->nip); in SoftwareEmulation()
516 emulate_single_step(regs); in SoftwareEmulation()
522 void DebugException(struct pt_regs *regs) in DebugException() argument
528 regs->msr &= ~MSR_DE; /* Turn off 'debug' bit */ in DebugException()
533 if (!user_mode(regs) && debugger_bpt(regs)) in DebugException()
535 _exception(SIGTRAP, regs, 0, 0); in DebugException()
542 if (!user_mode(regs) && debugger_sstep(regs)) in DebugException()
544 _exception(SIGTRAP, regs, 0, 0); in DebugException()
551 TAUException(struct pt_regs *regs) in TAUException() argument
554 regs->nip, regs->msr, regs->trap, print_tainted()); in TAUException()
560 AltivecAssistException(struct pt_regs *regs) in AltivecAssistException() argument
562 if (regs->msr & MSR_VEC) in AltivecAssistException()