diff options
author | bde <bde@FreeBSD.org> | 2000-09-13 12:40:43 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 2000-09-13 12:40:43 +0000 |
commit | 4df37ee8ee9fc3f04731ac01ebb6867451b17cbe (patch) | |
tree | 7d0d46bd793089168f04610a533353e0a3a5c15f /sys | |
parent | 100914de6c046c3d452be447b55dc2b8ef04a26e (diff) | |
download | FreeBSD-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.c | 12 | ||||
-rw-r--r-- | sys/amd64/amd64/trap.c | 6 | ||||
-rw-r--r-- | sys/i386/i386/machdep.c | 12 | ||||
-rw-r--r-- | sys/i386/i386/trap.c | 6 | ||||
-rw-r--r-- | sys/kern/subr_trap.c | 6 |
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 |