diff --git a/ntoskrnl/ke/amd64/stubs.c b/ntoskrnl/ke/amd64/stubs.c index cb2d4a37248..7326f7a2cd0 100644 --- a/ntoskrnl/ke/amd64/stubs.c +++ b/ntoskrnl/ke/amd64/stubs.c @@ -139,14 +139,18 @@ KiIdleLoop(VOID) /* The thread is now running */ NewThread->State = Running; +#ifdef CONFIG_SMP /* Do the swap at SYNCH_LEVEL */ KfRaiseIrql(SYNCH_LEVEL); +#endif /* Switch away from the idle thread */ KiSwapContext(APC_LEVEL, OldThread); +#ifdef CONFIG_SMP /* Go back to DISPATCH_LEVEL */ KeLowerIrql(DISPATCH_LEVEL); +#endif } else { diff --git a/ntoskrnl/ke/arm/thrdini.c b/ntoskrnl/ke/arm/thrdini.c index 89f1664608b..190b73f926c 100644 --- a/ntoskrnl/ke/arm/thrdini.c +++ b/ntoskrnl/ke/arm/thrdini.c @@ -193,8 +193,18 @@ KiIdleLoop(VOID) /* The thread is now running */ NewThread->State = Running; +#ifdef CONFIG_SMP + /* Do the swap at SYNCH_LEVEL */ + KfRaiseIrql(SYNCH_LEVEL); +#endif + /* Switch away from the idle thread */ KiSwapContext(APC_LEVEL, OldThread); + +#ifdef CONFIG_SMP + /* Go back to DISPATCH_LEVEL */ + KeLowerIrql(DISPATCH_LEVEL); +#endif } else { diff --git a/ntoskrnl/ke/i386/thrdini.c b/ntoskrnl/ke/i386/thrdini.c index cfc497bfc69..3214f560872 100644 --- a/ntoskrnl/ke/i386/thrdini.c +++ b/ntoskrnl/ke/i386/thrdini.c @@ -300,8 +300,18 @@ KiIdleLoop(VOID) /* The thread is now running */ NewThread->State = Running; +#ifdef CONFIG_SMP + /* Do the swap at SYNCH_LEVEL */ + KfRaiseIrql(SYNCH_LEVEL); +#endif + /* Switch away from the idle thread */ KiSwapContext(APC_LEVEL, OldThread); + +#ifdef CONFIG_SMP + /* Go back to DISPATCH_LEVEL */ + KeLowerIrql(DISPATCH_LEVEL); +#endif } else {