diff --git a/sys/arch/arm32/arm32/ast.c b/sys/arch/arm32/arm32/ast.c index 8acd6493aa7b..96a53e6cbdc0 100644 --- a/sys/arch/arm32/arm32/ast.c +++ b/sys/arch/arm32/arm32/ast.c @@ -1,4 +1,4 @@ -/* $NetBSD: ast.c,v 1.21 2000/12/12 05:26:38 mycroft Exp $ */ +/* $NetBSD: ast.c,v 1.22 2000/12/12 19:41:50 mycroft Exp $ */ /* * Copyright (c) 1994,1995 Mark Brinicombe @@ -66,44 +66,11 @@ userret(p) { int sig; -#ifdef DEBUG - if (p == NULL) - panic("userret: p=0 curproc=%p", curproc); - - if ((GetCPSR() & PSR_MODE) != PSR_SVC32_MODE) - panic("userret called in non SVC mode !"); - - if (current_spl_level != _SPL_0) { - printf("userret: spl level=%d on entry\n", current_spl_level); -#ifdef DDB - Debugger(); -#endif /* DDB */ - } -#endif /* DEBUG */ - - /* take pending signals */ - - while ((sig = (CURSIG(p))) != 0) { + /* Take pending signals. */ + while ((sig = (CURSIG(p))) != 0) postsig(sig); - } - p->p_priority = p->p_usrpri; - - /* - * Check for reschedule request - */ - - if (want_resched) { - /* - * We are being preempted. - */ - preempt(NULL); - while ((sig = (CURSIG(p))) != 0) { - postsig(sig); - } - } - - curcpu()->ci_schedstate.spc_curpriority = p->p_priority; + curcpu()->ci_schedstate.spc_curpriority = p->p_priority = p->p_usrpri; #ifdef DEBUG if (current_spl_level != _SPL_0) { @@ -134,13 +101,13 @@ ast(frame) uvmexp.traps++; uvmexp.softs++; -#ifdef DIAGNOSTIC - if (p == NULL) { - p = &proc0; - printf("ast: curproc=NULL\n"); - } +#ifdef DEBUG + if (p == NULL) + panic("ast: no curproc!"); if (&p->p_addr->u_pcb == 0) - panic("ast: nopcb!"); + panic("ast: no pcb!"); + if ((GetCPSR() & PSR_MODE) != PSR_SVC32_MODE) + panic("ast: not in SVC32 mode"); #endif if (p->p_flag & P_OWEUPC) { @@ -148,6 +115,10 @@ ast(frame) ADDUPROF(p); } + /* Allow a forced task switch. */ + if (want_resched) + preempt(NULL); + userret(p); } diff --git a/sys/arch/arm32/arm32/fault.c b/sys/arch/arm32/arm32/fault.c index 90d79011677d..ff3250a2b4dc 100644 --- a/sys/arch/arm32/arm32/fault.c +++ b/sys/arch/arm32/arm32/fault.c @@ -1,4 +1,4 @@ -/* $NetBSD: fault.c,v 1.47 2000/12/12 05:21:02 mycroft Exp $ */ +/* $NetBSD: fault.c,v 1.48 2000/12/12 19:41:50 mycroft Exp $ */ /* * Copyright (c) 1994-1997 Mark Brinicombe. @@ -162,6 +162,11 @@ data_abort_handler(frame) if (!(frame->tf_spsr & I32_bit)) enable_interrupts(I32_bit); +#ifdef DEBUG + if ((GetCPSR() & PSR_MODE) != PSR_SVC32_MODE) + panic("data_abort_handler: not in SVC32 mode"); +#endif + /* Update vmmeter statistics */ uvmexp.traps++; @@ -486,12 +491,10 @@ prefetch_abort_handler(frame) if (!(frame->tf_spsr & I32_bit)) enable_interrupts(I32_bit); -#ifdef DIAGNOSTIC - /* Paranoia: We should always be in SVC32 mode at this point */ - if ((GetCPSR() & PSR_MODE) != PSR_SVC32_MODE) { - panic("Fault handler not in SVC mode\n"); - } -#endif /* DIAGNOSTIC */ +#ifdef DEBUG + if ((GetCPSR() & PSR_MODE) != PSR_SVC32_MODE) + panic("prefetch_abort_handler: not in SVC32 mode"); +#endif /* Update vmmeter statistics */ uvmexp.traps++; diff --git a/sys/arch/arm32/arm32/syscall.c b/sys/arch/arm32/arm32/syscall.c index 46df13da34d9..560b922dd6c8 100644 --- a/sys/arch/arm32/arm32/syscall.c +++ b/sys/arch/arm32/arm32/syscall.c @@ -1,4 +1,4 @@ -/* $NetBSD: syscall.c,v 1.36 2000/12/12 18:26:43 mycroft Exp $ */ +/* $NetBSD: syscall.c,v 1.37 2000/12/12 19:41:51 mycroft Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -125,7 +125,7 @@ syscall(frame, code) #ifdef DEBUG if ((GetCPSR() & PSR_MODE) != PSR_SVC32_MODE) - panic("syscall: Not in SVC32 mode\n"); + panic("syscall: not in SVC32 mode"); #endif /* DEBUG */ uvmexp.syscalls++;