mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 01:25:41 +00:00
- Saved the fpu state before the actual thread switching occurs (only for smp machines).
svn path=/trunk/; revision=11832
This commit is contained in:
parent
2b6de7c143
commit
b51c0305db
1 changed files with 24 additions and 19 deletions
|
@ -59,6 +59,30 @@ _Ki386ContextSwitch:
|
||||||
* This is a critical section for this processor.
|
* This is a critical section for this processor.
|
||||||
*/
|
*/
|
||||||
cli
|
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.
|
* Get the pointer to the new thread.
|
||||||
|
@ -111,25 +135,6 @@ _Ki386ContextSwitch:
|
||||||
*/
|
*/
|
||||||
movl 12(%ebp), %ebx
|
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.
|
* FIXME: Save debugging state.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue