mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[NTOS:KE] Fix usage of KTHREAD::SwapBusy
This commit is contained in:
parent
a011d19ed2
commit
f4d47faeb7
3 changed files with 12 additions and 0 deletions
|
@ -149,6 +149,14 @@ PUBLIC KiThreadStartup
|
|||
.allocstack (6 * 8)
|
||||
.endprolog
|
||||
|
||||
/* Wait for SwapBusy */
|
||||
.SwapBusySet:
|
||||
cmp byte ptr [r8 + ThSwapBusy], 0
|
||||
je .SwapBusyClear
|
||||
pause
|
||||
jmp .SwapBusySet
|
||||
.SwapBusyClear:
|
||||
|
||||
/* Save WaitIrql as KSWITCH_FRAME::ApcBypass */
|
||||
mov [rsp + SwApcBypass], cl
|
||||
|
||||
|
|
|
@ -184,6 +184,9 @@ KiSwapContextResume(
|
|||
0);
|
||||
}
|
||||
|
||||
/* Old thread os no longer busy */
|
||||
OldThread->SwapBusy = FALSE;
|
||||
|
||||
/* Kernel APCs may be pending */
|
||||
if (NewThread->ApcState.KernelApcPending)
|
||||
{
|
||||
|
|
|
@ -762,6 +762,7 @@ OFFSET(ThSystemCallNumber, KTHREAD, SystemCallNumber),
|
|||
OFFSET(ThTrapFrame, KTHREAD, TrapFrame),
|
||||
OFFSET(ThApcState, KTHREAD, ApcState),
|
||||
OFFSET(ThPriority, KTHREAD, Priority), // obsolete
|
||||
OFFSET(ThSwapBusy, KTHREAD, SwapBusy),
|
||||
OFFSET(ThContextSwitches, KTHREAD, ContextSwitches),
|
||||
OFFSET(ThState, KTHREAD, State),
|
||||
OFFSET(ThProcess, KTHREAD, Process), // thProcess in native headers
|
||||
|
|
Loading…
Reference in a new issue