diff options
author | davidxu <davidxu@FreeBSD.org> | 2003-03-08 03:58:50 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2003-03-08 03:58:50 +0000 |
commit | 27d6312bf7b744a7e8485139106650cd6657e76a (patch) | |
tree | a04600fe52eb96ae8d9f72e9931b3b6bc85261c8 | |
parent | 9ed0566b91de3201d43d8a7d13ccf5cde1e0debb (diff) | |
download | FreeBSD-src-27d6312bf7b744a7e8485139106650cd6657e76a.zip FreeBSD-src-27d6312bf7b744a7e8485139106650cd6657e76a.tar.gz |
Initialize eflags in fake frame to default value rather than random one.
The random value sometimes causes macro CLKF_USERMODE to return true
because PSL_VM bit is set and really shoudn't be, this causes statclock()
to execute in wrong path, and further breaks KSE code and kernel crashes
when executing threaded program.
-rw-r--r-- | sys/amd64/amd64/critical.c | 1 | ||||
-rw-r--r-- | sys/i386/i386/critical.c | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/sys/amd64/amd64/critical.c b/sys/amd64/amd64/critical.c index 7a505e1..1a74b95 100644 --- a/sys/amd64/amd64/critical.c +++ b/sys/amd64/amd64/critical.c @@ -94,6 +94,7 @@ i386_unpend(void) frame.cf_cs = SEL_KPL; frame.cf_eip = (register_t)i386_unpend; + frame.cf_eflags = PSL_KERNEL; KASSERT(curthread->td_critnest == 0, ("unpend critnest != 0")); KASSERT((read_eflags() & PSL_I) == 0, ("unpend interrupts enabled1")); curthread->td_critnest = 1; diff --git a/sys/i386/i386/critical.c b/sys/i386/i386/critical.c index 7a505e1..1a74b95 100644 --- a/sys/i386/i386/critical.c +++ b/sys/i386/i386/critical.c @@ -94,6 +94,7 @@ i386_unpend(void) frame.cf_cs = SEL_KPL; frame.cf_eip = (register_t)i386_unpend; + frame.cf_eflags = PSL_KERNEL; KASSERT(curthread->td_critnest == 0, ("unpend critnest != 0")); KASSERT((read_eflags() & PSL_I) == 0, ("unpend interrupts enabled1")); curthread->td_critnest = 1; |