- Saved the fpu state before the actual thread switching occurs (only for smp machines).

svn path=/trunk/; revision=11832
This commit is contained in:
Hartmut Birr 2004-11-27 16:19:22 +00:00
parent 2b6de7c143
commit b51c0305db

View file

@ -60,6 +60,30 @@ _Ki386ContextSwitch:
*/
cli
#ifdef MP
/*
* Get the pointer to the old thread.
*/
movl 12(%ebp), %ebx
/*
* Save FPU state if the thread has used it.
*/
movl $0, %fs:KPCR_NPX_THREAD
testb $NPX_STATE_DIRTY, KTHREAD_NPX_STATE(%ebx)
jz 3f
movl KTHREAD_INITIAL_STACK(%ebx), %eax
cmpl $0, _FxsrSupport
je 1f
fxsave -SIZEOF_FX_SAVE_AREA(%eax)
jmp 2f
1:
fnsave -SIZEOF_FX_SAVE_AREA(%eax)
2:
movb $NPX_STATE_VALID, KTHREAD_NPX_STATE(%ebx)
3:
#endif /* MP */
/*
* Get the pointer to the new thread.
*/
@ -111,25 +135,6 @@ _Ki386ContextSwitch:
*/
movl 12(%ebp), %ebx
#ifdef MP
/*
* Save FPU state if the thread has used it.
*/
movl $0, %fs:KPCR_NPX_THREAD
testb $NPX_STATE_DIRTY, KTHREAD_NPX_STATE(%ebx)
jz 3f
movl KTHREAD_INITIAL_STACK(%ebx), %eax
cmpl $0, _FxsrSupport
je 1f
fxsave -SIZEOF_FX_SAVE_AREA(%eax)
jmp 2f
1:
fnsave -SIZEOF_FX_SAVE_AREA(%eax)
2:
movb $NPX_STATE_VALID, KTHREAD_NPX_STATE(%ebx)
3:
#endif /* MP */
/*
* FIXME: Save debugging state.
*/