diff --git a/ntoskrnl/ke/i386/ctxswitch.S b/ntoskrnl/ke/i386/ctxswitch.S index 1151a021b14..b680195d19d 100644 --- a/ntoskrnl/ke/i386/ctxswitch.S +++ b/ntoskrnl/ke/i386/ctxswitch.S @@ -29,13 +29,10 @@ EXTERN _KeI386FxsrPresent:DWORD * \brief * The KiSwapContextInternal routine switches context to another thread. * - * BOOLEAN USERCALL KiSwapContextInternal(); + * BOOLEAN USERCALL KiSwapContextInternal(ULONG_PTR OldThreadAndApcFlag@); * - * Params: - * ESI - Pointer to the KTHREAD to which the caller wishes to - * switch to. - * EDI - Pointer to the KTHREAD to which the caller wishes to - * switch from. + * \param OldThreadAndApcFlag@ + * Pointer to the current thread with the lowest bit set to the current IRQL. * * \returns * APC state. @@ -59,14 +56,14 @@ PUBLIC @KiSwapContextInternal@0 * The KiSwapContext routine switches context to another thread. * * BOOLEAN FASTCALL - * KiSwapContext(PKTHREAD CurrentThread, PKTHREAD TargetThread); + * KiSwapContext(KIRQL WaitIrql@, PKTHREAD CurrentThread@); * - * \param CurrentThread + * \param WaitIrql@ + * The IRQL at which the wait happens. + * + * \param CurrentThread@ * Pointer to the KTHREAD of the current thread. * - * \param TargetThread - * Pointer to the KTHREAD to which the caller wishes to switch to. - * * \returns * The WaitStatus of the Target Thread. * @@ -90,13 +87,13 @@ PUBLIC @KiSwapContext@8 mov [esp+4], edi mov [esp+0], ebp - /* Get the wait IRQL */ + /* Combine current thread and the wait IRQL in edx */ or dl, cl /* Do the swap with the registers correctly setup */ call @KiSwapContextInternal@0 - /* Return the registers */ + /* Restore the registers */ mov ebp, [esp+0] mov edi, [esp+4] mov esi, [esp+8]