Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm32/arm32 Clean up some DEBUG stuff, move want_re...
details: https://anonhg.NetBSD.org/src/rev/960cf0066aff
branches: trunk
changeset: 500489:960cf0066aff
user: mycroft <mycroft%NetBSD.org@localhost>
date: Tue Dec 12 19:41:50 2000 +0000
description:
Clean up some DEBUG stuff, move want_resched check from userret() to ast().
diffstat:
sys/arch/arm32/arm32/ast.c | 57 ++++++++++-------------------------------
sys/arch/arm32/arm32/fault.c | 17 +++++++-----
sys/arch/arm32/arm32/syscall.c | 4 +-
3 files changed, 26 insertions(+), 52 deletions(-)
diffs (144 lines):
diff -r c5b2d9aa841c -r 960cf0066aff sys/arch/arm32/arm32/ast.c
--- a/sys/arch/arm32/arm32/ast.c Tue Dec 12 19:07:59 2000 +0000
+++ b/sys/arch/arm32/arm32/ast.c Tue Dec 12 19:41:50 2000 +0000
@@ -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 @@
{
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 @@
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 @@
ADDUPROF(p);
}
+ /* Allow a forced task switch. */
+ if (want_resched)
+ preempt(NULL);
+
userret(p);
}
diff -r c5b2d9aa841c -r 960cf0066aff sys/arch/arm32/arm32/fault.c
--- a/sys/arch/arm32/arm32/fault.c Tue Dec 12 19:07:59 2000 +0000
+++ b/sys/arch/arm32/arm32/fault.c Tue Dec 12 19:41:50 2000 +0000
@@ -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 @@
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 @@
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 -r c5b2d9aa841c -r 960cf0066aff sys/arch/arm32/arm32/syscall.c
--- a/sys/arch/arm32/arm32/syscall.c Tue Dec 12 19:07:59 2000 +0000
+++ b/sys/arch/arm32/arm32/syscall.c Tue Dec 12 19:41:50 2000 +0000
@@ -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 @@
#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++;
Home |
Main Index |
Thread Index |
Old Index