]> git.proxmox.com Git - mirror_edk2.git/blobdiff - UefiCpuPkg/Library/MpInitLib/Ia32/MpFuncs.nasm
UefiCpuPkg/MpInitLib: increase NumApsExecuting only for ApInitConfig
[mirror_edk2.git] / UefiCpuPkg / Library / MpInitLib / Ia32 / MpFuncs.nasm
index 34b8705adb5145a0313dc168353b8ca23cf6fb92..b74046b76af32fc8a0a6e8518a9255cac7d832b5 100644 (file)
@@ -1,5 +1,5 @@
 ;------------------------------------------------------------------------------ ;\r
-; Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>\r
+; Copyright (c) 2015 - 2019, Intel Corporation. All rights reserved.<BR>\r
 ; SPDX-License-Identifier: BSD-2-Clause-Patent\r
 ;\r
 ; Module Name:\r
@@ -81,12 +81,6 @@ Flat32Start:                                   ; protected mode entry point
 \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
@@ -120,6 +114,12 @@ SkipEnableExecuteDisable:
     cmp        dword [edi], 1       ; 1 == ApInitConfig\r
     jnz        GetApicId\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
     ; AP init\r
     mov        edi, esi\r
     add        edi, LockLocation\r