summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/i386/isa/ipl.s19
-rw-r--r--sys/i386/isa/ipl_funcs.c26
2 files changed, 38 insertions, 7 deletions
diff --git a/sys/i386/isa/ipl.s b/sys/i386/isa/ipl.s
index e87df92..bff5651 100644
--- a/sys/i386/isa/ipl.s
+++ b/sys/i386/isa/ipl.s
@@ -36,7 +36,7 @@
*
* @(#)ipl.s
*
- * $Id: ipl.s,v 1.13 1997/09/07 22:02:56 fsmp Exp $
+ * $Id: ipl.s,v 1.14 1997/09/21 21:41:16 gibbs Exp $
*/
@@ -227,8 +227,15 @@ no_cil:
*/
movl ihandlers(,%ecx,4),%edx
testl %edx,%edx
+#if 0
/* XXX SMP this would leave cil set: */
je doreti_next /* "can't happen" */
+#else
+ jne ih_ok
+ int $3 /* _breakpoint */
+ jmp doreti_next /* "can't happen" */
+ih_ok:
+#endif
cmpl $NHWI,%ecx
jae doreti_swi
cli
@@ -249,6 +256,14 @@ no_cil:
ALIGN_TEXT
doreti_swi:
+#if 1
+ cmpl $0100, _cil
+ jne 1f
+ cmpl $0, _inside_intr
+ jne 1f
+ int $3
+1:
+#endif
pushl %eax
/*
* The SWI_AST handler has to run at cpl = SWI_AST_MASK and the
@@ -262,7 +277,7 @@ doreti_swi:
#ifdef SMP
orl imasks(,%ecx,4), %eax
cli /* prevent INT deadlock */
- pushl %eax /* save cpl|cmpl */
+ pushl %eax /* save cpl|cml */
ICPL_LOCK
#ifdef CPL_AND_CML
popl _cml /* restore cml */
diff --git a/sys/i386/isa/ipl_funcs.c b/sys/i386/isa/ipl_funcs.c
index 9b2515c..53322a1 100644
--- a/sys/i386/isa/ipl_funcs.c
+++ b/sys/i386/isa/ipl_funcs.c
@@ -166,14 +166,27 @@ softclockpending(void)
#ifdef SPL_DEBUG
#define MAXZ 100000000
-#define SPIN_COUNT unsigned z = 0;
+#define SPIN_VAR unsigned z;
+#define SPIN_RESET z = 0;
+#if 0
#define SPIN_SPL \
if (++z >= MAXZ) { \
+ /* XXX allow lock-free panic */ \
bsp_apic_ready = 0; \
panic("\ncil: 0x%08x", cil); \
}
+#else
+#define SPIN_SPL \
+ if (++z >= MAXZ) { \
+ /* XXX allow lock-free panic */ \
+ bsp_apic_ready = 0; \
+ printf("\ncil: 0x%08x", cil); \
+ breakpoint(); \
+ }
+#endif /* 0/1 */
#else /* SPL_DEBUG */
-#define SPIN_COUNT
+#define SPIN_VAR
+#define SPIN_RESET
#define SPIN_SPL
#endif /* SPL_DEBUG */
@@ -185,7 +198,7 @@ softclockpending(void)
unsigned NAME(void) \
{ \
unsigned x, y; \
- SPIN_COUNT; \
+ SPIN_VAR; \
\
if (!bsp_apic_ready) { \
x = cpl; \
@@ -202,6 +215,7 @@ unsigned NAME(void) \
y OP MODIFIER; /* desired value */ \
if (cil & y) { /* not now */ \
IFCPL_UNLOCK(); /* allow cil to change */ \
+ SPIN_RESET; \
while (cil & y) \
SPIN_SPL \
continue; /* try again */ \
@@ -274,13 +288,14 @@ spl0(void)
{
int unpend;
#ifdef INTR_SPL
- SPIN_COUNT;
+ SPIN_VAR;
for (;;) {
IFCPL_LOCK();
POSTCODE_HI(0xc);
if (cil & SWI_AST_MASK) { /* not now */
IFCPL_UNLOCK(); /* allow cil to change */
+ SPIN_RESET;
while (cil & SWI_AST_MASK)
SPIN_SPL
continue; /* try again */
@@ -304,7 +319,7 @@ splx(unsigned ipl)
{
int unpend;
#ifdef INTR_SPL
- SPIN_COUNT;
+ SPIN_VAR;
#endif
if (!bsp_apic_ready) {
@@ -323,6 +338,7 @@ splx(unsigned ipl)
POSTCODE_HI(0xf);
if (cil & ipl) { /* not now */
IFCPL_UNLOCK(); /* allow cil to change */
+ SPIN_RESET;
while (cil & ipl)
SPIN_SPL
continue; /* try again */
OpenPOWER on IntegriCloud