summaryrefslogtreecommitdiffstats
path: root/lib/libkse
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2002-11-22 11:43:06 +0000
committerdavidxu <davidxu@FreeBSD.org>2002-11-22 11:43:06 +0000
commited0591ed98516f3316f0375f547836a22be09e9f (patch)
treecd8200d6c38b101fe76cf17a065b8870c70d60f0 /lib/libkse
parentf89233ef8d826c7b28410899f4d41e455fd50311 (diff)
downloadFreeBSD-src-ed0591ed98516f3316f0375f547836a22be09e9f.zip
FreeBSD-src-ed0591ed98516f3316f0375f547836a22be09e9f.tar.gz
In _thread_enter_uts, fix eflags saving bug.
In _thread_switch, set current thread pointer in kse mailbox only after all registers copied out of thread mailbox, kernel will do upcall at trap time, if set current thread pointer before loading all registers from thread mailbox, at trap time, the thread mailbox data will be overwritten by kernel, result is junk data is loaded into CPU.
Diffstat (limited to 'lib/libkse')
-rw-r--r--lib/libkse/arch/i386/i386/thr_enter_uts.S3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libkse/arch/i386/i386/thr_enter_uts.S b/lib/libkse/arch/i386/i386/thr_enter_uts.S
index 8d38b0f..10edd3f 100644
--- a/lib/libkse/arch/i386/i386/thr_enter_uts.S
+++ b/lib/libkse/arch/i386/i386/thr_enter_uts.S
@@ -79,7 +79,8 @@ ENTRY(_thread_enter_uts)
*/
fnstcw MC_FP_CW_OFFSET(%edx)
movl $0, MC_OWNEDFP_OFFSET(%edx) /* no FP */
- lahf /* get eflags */
+ pushfl /* get eflags */
+ popl %eax
movl %eax, 68(%edx) /* store eflags */
movl %esp, %eax /* setcontext pushes the return */
addl $4, %eax /* address onto the top of the */
OpenPOWER on IntegriCloud