\r
mov esi, ebx\r
\r
+ ; Increment the number of APs executing here as early as possible\r
+ ; This is decremented in C code when AP is finished executing\r
+ mov edi, esi\r
+ add edi, NumApsExecutingLocation\r
+ lock inc dword [edi]\r
+\r
mov edi, esi\r
add edi, EnableExecuteDisableLocation\r
cmp byte [edi], 0\r
jz TestLock\r
\r
mov ecx, esi\r
- add ecx, NumApsExecutingLocation\r
+ add ecx, ApIndexLocation\r
inc dword [ecx]\r
mov ebx, [ecx]\r
\r
mov eax, ASM_PFX(InitializeFloatingPointUnits)\r
call eax ; Call assembly function to initialize FPU per UEFI spec\r
\r
- push ebx ; Push NumApsExecuting\r
+ push ebx ; Push ApIndex\r
mov eax, esi\r
add eax, LockLocation\r
push eax ; push address of exchange info data buffer\r
RendezvousFunnelProcEnd:\r
\r
;-------------------------------------------------------------------------------------\r
-; AsmRelocateApLoop (MwaitSupport, ApTargetCState, PmCodeSegment, TopOfApStack);\r
+; AsmRelocateApLoop (MwaitSupport, ApTargetCState, PmCodeSegment, TopOfApStack, CountTofinish);\r
;-------------------------------------------------------------------------------------\r
global ASM_PFX(AsmRelocateApLoop)\r
ASM_PFX(AsmRelocateApLoop):\r
mov ebp, esp\r
mov ebx, [eax + 8] ; ApTargetCState\r
mov ecx, [eax + 4] ; MwaitSupport\r
+ mov eax, [eax + 20] ; CountTofinish\r
+ lock dec dword [eax] ; (*CountTofinish)--\r
cmp cl, 1 ; Check mwait-monitor support\r
jnz HltLoop\r
MwaitLoop:\r
cli\r
hlt\r
jmp HltLoop\r
- ret\r
AsmRelocateApLoopEnd:\r
\r
;-------------------------------------------------------------------------------------\r