summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>2000-09-13 12:40:43 +0000
committerbde <bde@FreeBSD.org>2000-09-13 12:40:43 +0000
commit4df37ee8ee9fc3f04731ac01ebb6867451b17cbe (patch)
tree7d0d46bd793089168f04610a533353e0a3a5c15f /sys
parent100914de6c046c3d452be447b55dc2b8ef04a26e (diff)
downloadFreeBSD-src-4df37ee8ee9fc3f04731ac01ebb6867451b17cbe.zip
FreeBSD-src-4df37ee8ee9fc3f04731ac01ebb6867451b17cbe.tar.gz
Fixed hang on booting with -d. mtx_enter() was called on an uninitialized
lock. The quick fix in trap.c was not quite the version tested and had no effect; back it out.
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/amd64/machdep.c12
-rw-r--r--sys/amd64/amd64/trap.c6
-rw-r--r--sys/i386/i386/machdep.c12
-rw-r--r--sys/i386/i386/trap.c6
-rw-r--r--sys/kern/subr_trap.c6
5 files changed, 18 insertions, 24 deletions
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c
index c94fa3d..0e5b0e1 100644
--- a/sys/amd64/amd64/machdep.c
+++ b/sys/amd64/amd64/machdep.c
@@ -1953,6 +1953,12 @@ init386(first)
isa_defaultirq();
#endif
+ /*
+ * Giant is used early for at least debugger traps, unexpected traps,
+ * and vm86bios initialization.
+ */
+ mtx_init(&Giant, "Giant", MTX_DEF);
+
#ifdef DDB
kdb_init();
if (boothowto & RB_KDB)
@@ -1987,12 +1993,6 @@ init386(first)
dblfault_tss.tss_cs = GSEL(GCODE_SEL, SEL_KPL);
dblfault_tss.tss_ldt = GSEL(GLDT_SEL, SEL_KPL);
- /*
- * We grab Giant during the vm86bios routines, so we need to ensure
- * that it is up and running before we use vm86.
- */
- mtx_init(&Giant, "Giant", MTX_DEF);
-
vm86_initialize();
getmemsize(first);
diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c
index d49327f..f32dfae 100644
--- a/sys/amd64/amd64/trap.c
+++ b/sys/amd64/amd64/trap.c
@@ -279,8 +279,7 @@ trap(frame)
enable_intr();
}
- if (p != NULL || !cold)
- mtx_enter(&Giant, MTX_DEF);
+ mtx_enter(&Giant, MTX_DEF);
#if defined(I586_CPU) && !defined(NO_F00F_HACK)
restart:
@@ -640,8 +639,7 @@ restart:
user:
userret(p, &frame, sticks, 1);
out:
- if (p != NULL || !cold)
- mtx_exit(&Giant, MTX_DEF);
+ mtx_exit(&Giant, MTX_DEF);
}
#ifdef notyet
diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c
index c94fa3d..0e5b0e1 100644
--- a/sys/i386/i386/machdep.c
+++ b/sys/i386/i386/machdep.c
@@ -1953,6 +1953,12 @@ init386(first)
isa_defaultirq();
#endif
+ /*
+ * Giant is used early for at least debugger traps, unexpected traps,
+ * and vm86bios initialization.
+ */
+ mtx_init(&Giant, "Giant", MTX_DEF);
+
#ifdef DDB
kdb_init();
if (boothowto & RB_KDB)
@@ -1987,12 +1993,6 @@ init386(first)
dblfault_tss.tss_cs = GSEL(GCODE_SEL, SEL_KPL);
dblfault_tss.tss_ldt = GSEL(GLDT_SEL, SEL_KPL);
- /*
- * We grab Giant during the vm86bios routines, so we need to ensure
- * that it is up and running before we use vm86.
- */
- mtx_init(&Giant, "Giant", MTX_DEF);
-
vm86_initialize();
getmemsize(first);
diff --git a/sys/i386/i386/trap.c b/sys/i386/i386/trap.c
index d49327f..f32dfae 100644
--- a/sys/i386/i386/trap.c
+++ b/sys/i386/i386/trap.c
@@ -279,8 +279,7 @@ trap(frame)
enable_intr();
}
- if (p != NULL || !cold)
- mtx_enter(&Giant, MTX_DEF);
+ mtx_enter(&Giant, MTX_DEF);
#if defined(I586_CPU) && !defined(NO_F00F_HACK)
restart:
@@ -640,8 +639,7 @@ restart:
user:
userret(p, &frame, sticks, 1);
out:
- if (p != NULL || !cold)
- mtx_exit(&Giant, MTX_DEF);
+ mtx_exit(&Giant, MTX_DEF);
}
#ifdef notyet
diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c
index d49327f..f32dfae 100644
--- a/sys/kern/subr_trap.c
+++ b/sys/kern/subr_trap.c
@@ -279,8 +279,7 @@ trap(frame)
enable_intr();
}
- if (p != NULL || !cold)
- mtx_enter(&Giant, MTX_DEF);
+ mtx_enter(&Giant, MTX_DEF);
#if defined(I586_CPU) && !defined(NO_F00F_HACK)
restart:
@@ -640,8 +639,7 @@ restart:
user:
userret(p, &frame, sticks, 1);
out:
- if (p != NULL || !cold)
- mtx_exit(&Giant, MTX_DEF);
+ mtx_exit(&Giant, MTX_DEF);
}
#ifdef notyet
OpenPOWER on IntegriCloud