mirror of
https://github.com/reactos/reactos.git
synced 2025-05-25 12:14:32 +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)
|
.allocstack (6 * 8)
|
||||||
.endprolog
|
.endprolog
|
||||||
|
|
||||||
|
/* Wait for SwapBusy */
|
||||||
|
.SwapBusySet:
|
||||||
|
cmp byte ptr [r8 + ThSwapBusy], 0
|
||||||
|
je .SwapBusyClear
|
||||||
|
pause
|
||||||
|
jmp .SwapBusySet
|
||||||
|
.SwapBusyClear:
|
||||||
|
|
||||||
/* Save WaitIrql as KSWITCH_FRAME::ApcBypass */
|
/* Save WaitIrql as KSWITCH_FRAME::ApcBypass */
|
||||||
mov [rsp + SwApcBypass], cl
|
mov [rsp + SwApcBypass], cl
|
||||||
|
|
||||||
|
|
|
@ -184,6 +184,9 @@ KiSwapContextResume(
|
||||||
0);
|
0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Old thread os no longer busy */
|
||||||
|
OldThread->SwapBusy = FALSE;
|
||||||
|
|
||||||
/* Kernel APCs may be pending */
|
/* Kernel APCs may be pending */
|
||||||
if (NewThread->ApcState.KernelApcPending)
|
if (NewThread->ApcState.KernelApcPending)
|
||||||
{
|
{
|
||||||
|
|
|
@ -762,6 +762,7 @@ OFFSET(ThSystemCallNumber, KTHREAD, SystemCallNumber),
|
||||||
OFFSET(ThTrapFrame, KTHREAD, TrapFrame),
|
OFFSET(ThTrapFrame, KTHREAD, TrapFrame),
|
||||||
OFFSET(ThApcState, KTHREAD, ApcState),
|
OFFSET(ThApcState, KTHREAD, ApcState),
|
||||||
OFFSET(ThPriority, KTHREAD, Priority), // obsolete
|
OFFSET(ThPriority, KTHREAD, Priority), // obsolete
|
||||||
|
OFFSET(ThSwapBusy, KTHREAD, SwapBusy),
|
||||||
OFFSET(ThContextSwitches, KTHREAD, ContextSwitches),
|
OFFSET(ThContextSwitches, KTHREAD, ContextSwitches),
|
||||||
OFFSET(ThState, KTHREAD, State),
|
OFFSET(ThState, KTHREAD, State),
|
||||||
OFFSET(ThProcess, KTHREAD, Process), // thProcess in native headers
|
OFFSET(ThProcess, KTHREAD, Process), // thProcess in native headers
|
||||||
|
|
Loading…
Reference in a new issue