summaryrefslogtreecommitdiffstats
path: root/sys/i386/isa/ipl_funcs.c
diff options
context:
space:
mode:
authorfsmp <fsmp@FreeBSD.org>1997-09-28 19:34:48 +0000
committerfsmp <fsmp@FreeBSD.org>1997-09-28 19:34:48 +0000
commitc462c9c658567cdce1c85ac38bdd669c006d559e (patch)
tree2507b1ad0b47c909a0225e41a9a1d45d4f58e7b8 /sys/i386/isa/ipl_funcs.c
parent91399998c0a7aadd6f379874264c78d2fca18e4a (diff)
downloadFreeBSD-src-c462c9c658567cdce1c85ac38bdd669c006d559e.zip
FreeBSD-src-c462c9c658567cdce1c85ac38bdd669c006d559e.tar.gz
Added a couple short-term debugs and a fix to the SPIN_MAX variable.
Debugs are an attempt to ferret out the PUSHDOWN_LEVEL_3 deadlock.
Diffstat (limited to 'sys/i386/isa/ipl_funcs.c')
-rw-r--r--sys/i386/isa/ipl_funcs.c26
1 files changed, 21 insertions, 5 deletions
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