Changeset View
Changeset View
Standalone View
Standalone View
sys/mips/mips/trap.c
Show First 20 Lines • Show All 343 Lines • ▼ Show 20 Lines | cpu_fetch_syscall_args(struct thread *td) | ||||
int error, nsaved; | int error, nsaved; | ||||
locr0 = td->td_frame; | locr0 = td->td_frame; | ||||
sa = &td->td_sa; | sa = &td->td_sa; | ||||
bzero(sa->args, sizeof(sa->args)); | bzero(sa->args, sizeof(sa->args)); | ||||
/* compute next PC after syscall instruction */ | /* compute next PC after syscall instruction */ | ||||
td->td_pcb->pcb_tpc = sa->trapframe->pc; /* Remember if restart */ | td->td_pcb->pcb_tpc = locr0->pc; /* Remember if restart */ | ||||
if (DELAYBRANCH(sa->trapframe->cause)) /* Check BD bit */ | if (DELAYBRANCH(locr0->cause)) /* Check BD bit */ | ||||
locr0->pc = MipsEmulateBranch(locr0, sa->trapframe->pc, 0, 0); | locr0->pc = MipsEmulateBranch(locr0, locr0->pc, 0, 0); | ||||
else | else | ||||
locr0->pc += sizeof(int); | locr0->pc += sizeof(int); | ||||
sa->code = locr0->v0; | sa->code = locr0->v0; | ||||
switch (sa->code) { | switch (sa->code) { | ||||
case SYS___syscall: | case SYS___syscall: | ||||
case SYS_syscall: | case SYS_syscall: | ||||
/* | /* | ||||
▲ Show 20 Lines • Show All 413 Lines • ▼ Show 20 Lines | case T_BUS_ERR_LD_ST + T_USER: /* BERR asserted to cpu */ | ||||
addr = trapframe->pc; | addr = trapframe->pc; | ||||
if (!msg) | if (!msg) | ||||
msg = "BUS_ERR"; | msg = "BUS_ERR"; | ||||
log_bad_page_fault(msg, trapframe, type); | log_bad_page_fault(msg, trapframe, type); | ||||
break; | break; | ||||
case T_SYSCALL + T_USER: | case T_SYSCALL + T_USER: | ||||
{ | { | ||||
td->td_sa.trapframe = trapframe; | |||||
syscallenter(td); | syscallenter(td); | ||||
#if !defined(SMP) && (defined(DDB) || defined(DEBUG)) | #if !defined(SMP) && (defined(DDB) || defined(DEBUG)) | ||||
if (trp == trapdebug) | if (trp == trapdebug) | ||||
trapdebug[TRAPSIZE - 1].code = td->td_sa.code; | trapdebug[TRAPSIZE - 1].code = td->td_sa.code; | ||||
else | else | ||||
trp[-1].code = td->td_sa.code; | trp[-1].code = td->td_sa.code; | ||||
#endif | #endif | ||||
▲ Show 20 Lines • Show All 904 Lines • Show Last 20 Lines |