Changeset View
Changeset View
Standalone View
Standalone View
sys/mips/mips/trap.c
Show First 20 Lines • Show All 518 Lines • ▼ Show 20 Lines | trap(struct trapframe *trapframe) | ||||
pmap_t pmap; | pmap_t pmap; | ||||
int access_type; | int access_type; | ||||
ksiginfo_t ksi; | ksiginfo_t ksi; | ||||
char *msg = NULL; | char *msg = NULL; | ||||
intptr_t addr = 0; | intptr_t addr = 0; | ||||
register_t pc; | register_t pc; | ||||
int cop, error; | int cop, error; | ||||
register_t *frame_regs; | register_t *frame_regs; | ||||
#ifdef KDB | |||||
bool handled; | |||||
#endif | |||||
trapdebug_enter(trapframe, 0); | trapdebug_enter(trapframe, 0); | ||||
#ifdef KDB | #ifdef KDB | ||||
if (kdb_active) { | if (kdb_active) { | ||||
kdb_reenter(); | kdb_reenter(); | ||||
return (0); | return (0); | ||||
} | } | ||||
#endif | #endif | ||||
▲ Show 20 Lines • Show All 551 Lines • ▼ Show 20 Lines | if (trap_debug) | ||||
printf("badvaddr = %#jx, pc = %#jx, ra = %#jx, sr = %#jxx\n", | printf("badvaddr = %#jx, pc = %#jx, ra = %#jx, sr = %#jxx\n", | ||||
(intmax_t)trapframe->badvaddr, (intmax_t)trapframe->pc, (intmax_t)trapframe->ra, | (intmax_t)trapframe->badvaddr, (intmax_t)trapframe->pc, (intmax_t)trapframe->ra, | ||||
(intmax_t)trapframe->sr); | (intmax_t)trapframe->sr); | ||||
#endif | #endif | ||||
#ifdef KDB | #ifdef KDB | ||||
if (debugger_on_trap) { | if (debugger_on_trap) { | ||||
kdb_why = KDB_WHY_TRAP; | kdb_why = KDB_WHY_TRAP; | ||||
kdb_trap(type, 0, trapframe); | handled = kdb_trap(type, 0, trapframe); | ||||
kdb_why = KDB_WHY_UNSET; | kdb_why = KDB_WHY_UNSET; | ||||
if (handled) | |||||
return (trapframe->pc); | |||||
} | } | ||||
#endif | #endif | ||||
panic("trap"); | panic("trap"); | ||||
} | } | ||||
td->td_frame->pc = trapframe->pc; | td->td_frame->pc = trapframe->pc; | ||||
td->td_frame->cause = trapframe->cause; | td->td_frame->cause = trapframe->cause; | ||||
td->td_frame->badvaddr = trapframe->badvaddr; | td->td_frame->badvaddr = trapframe->badvaddr; | ||||
ksiginfo_init_trap(&ksi); | ksiginfo_init_trap(&ksi); | ||||
▲ Show 20 Lines • Show All 592 Lines • Show Last 20 Lines |