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.
This commit is contained in:
Bruce Evans 2000-09-13 12:40:43 +00:00
parent 715ca46f5c
commit 9c15b3c143
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=65811
5 changed files with 18 additions and 24 deletions

View file

@ -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);

View file

@ -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 @@ trap(frame)
user:
userret(p, &frame, sticks, 1);
out:
if (p != NULL || !cold)
mtx_exit(&Giant, MTX_DEF);
mtx_exit(&Giant, MTX_DEF);
}
#ifdef notyet

View file

@ -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);

View file

@ -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 @@ trap(frame)
user:
userret(p, &frame, sticks, 1);
out:
if (p != NULL || !cold)
mtx_exit(&Giant, MTX_DEF);
mtx_exit(&Giant, MTX_DEF);
}
#ifdef notyet

View file

@ -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 @@ trap(frame)
user:
userret(p, &frame, sticks, 1);
out:
if (p != NULL || !cold)
mtx_exit(&Giant, MTX_DEF);
mtx_exit(&Giant, MTX_DEF);
}
#ifdef notyet