diff options
author | bde <bde@FreeBSD.org> | 2000-09-12 18:41:56 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 2000-09-12 18:41:56 +0000 |
commit | 8a2681e22e732cee17c04fabdab335dc840a6fa1 (patch) | |
tree | 114aac81f095b7cf372bce9257ff69406c93ea31 | |
parent | f16595f63d83acc00c80c72b954cbcc3197241b4 (diff) | |
download | FreeBSD-src-8a2681e22e732cee17c04fabdab335dc840a6fa1.zip FreeBSD-src-8a2681e22e732cee17c04fabdab335dc840a6fa1.tar.gz |
Quick fix for hang on booting with -d. mtx_enter() was called before
curproc was initialized. curproc == NULL was interpreted as matching
the process holding Giant... Just skip mtx_enter() and mtx_exit() in
trap() if (curproc == NULL && cold) (&& cold for safety).
-rw-r--r-- | sys/amd64/amd64/trap.c | 6 | ||||
-rw-r--r-- | sys/i386/i386/trap.c | 6 | ||||
-rw-r--r-- | sys/kern/subr_trap.c | 6 |
3 files changed, 12 insertions, 6 deletions
diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c index f32dfae..d49327f 100644 --- a/sys/amd64/amd64/trap.c +++ b/sys/amd64/amd64/trap.c @@ -279,7 +279,8 @@ trap(frame) enable_intr(); } - mtx_enter(&Giant, MTX_DEF); + if (p != NULL || !cold) + mtx_enter(&Giant, MTX_DEF); #if defined(I586_CPU) && !defined(NO_F00F_HACK) restart: @@ -639,7 +640,8 @@ restart: user: userret(p, &frame, sticks, 1); out: - mtx_exit(&Giant, MTX_DEF); + if (p != NULL || !cold) + mtx_exit(&Giant, MTX_DEF); } #ifdef notyet diff --git a/sys/i386/i386/trap.c b/sys/i386/i386/trap.c index f32dfae..d49327f 100644 --- a/sys/i386/i386/trap.c +++ b/sys/i386/i386/trap.c @@ -279,7 +279,8 @@ trap(frame) enable_intr(); } - mtx_enter(&Giant, MTX_DEF); + if (p != NULL || !cold) + mtx_enter(&Giant, MTX_DEF); #if defined(I586_CPU) && !defined(NO_F00F_HACK) restart: @@ -639,7 +640,8 @@ restart: user: userret(p, &frame, sticks, 1); out: - mtx_exit(&Giant, MTX_DEF); + if (p != NULL || !cold) + mtx_exit(&Giant, MTX_DEF); } #ifdef notyet diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c index f32dfae..d49327f 100644 --- a/sys/kern/subr_trap.c +++ b/sys/kern/subr_trap.c @@ -279,7 +279,8 @@ trap(frame) enable_intr(); } - mtx_enter(&Giant, MTX_DEF); + if (p != NULL || !cold) + mtx_enter(&Giant, MTX_DEF); #if defined(I586_CPU) && !defined(NO_F00F_HACK) restart: @@ -639,7 +640,8 @@ restart: user: userret(p, &frame, sticks, 1); out: - mtx_exit(&Giant, MTX_DEF); + if (p != NULL || !cold) + mtx_exit(&Giant, MTX_DEF); } #ifdef notyet |