]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFspPkg/FspSecCore/Ia32/FspApiEntry.s
Fix FSP GCC error on FspApiCallingCheck().
[mirror_edk2.git] / IntelFspPkg / FspSecCore / Ia32 / FspApiEntry.s
index 1d8fe0bcd299e821f9c4e289ededd349bb14d22a..8f4093ca1940a7adad50ba5b895950ec0ea51fb5 100644 (file)
@@ -215,8 +215,10 @@ ASM_GLOBAL    ASM_PFX(FspApiCallingCheck)
 #\r
 # Following functions will be provided in PlatformSecLib\r
 #\r
+ASM_GLOBAL    ASM_PFX(AsmGetFspBaseAddress)\r
+ASM_GLOBAL    ASM_PFX(AsmGetFspInfoHeader)\r
 ASM_GLOBAL    ASM_PFX(GetBootFirmwareVolumeOffset)\r
-ASM_GLOBAL    ASM_PFX(Pei2LoaderSwitchStack)\r
+ASM_GLOBAL    ASM_PFX(Loader2PeiSwitchStack)\r
 \r
 \r
 #\r
@@ -561,8 +563,7 @@ ASM_PFX(TempRamInitApi):
   jz      NemInitExit\r
 \r
   #\r
-  # CPUID/DeviceID check\r
-  # and Sec Platform Init\r
+  # Sec Platform Init\r
   #\r
   movl    $TempRamInitApiL1, %esi            #CALL_MMX  SecPlatformInit\r
   movd    %esi, %mm7\r
@@ -702,9 +703,10 @@ FspApiCommonL0:
   # Verify the calling condition\r
   #\r
   pushal\r
-  pushl   %eax\r
+  pushl   36(%esp)  #push ApiParam  [esp + 4 * 8 + 4]\r
+  pushl   %eax      #push ApiIdx\r
   call    ASM_PFX(FspApiCallingCheck)\r
-  addl    $0x04, %esp\r
+  addl    $0x08, %esp\r
   cmpl    $0x00, %eax\r
   jz      FspApiCommonL1\r
   movl    %eax, 0x1C(%esp)                   # mov    dword ptr [esp + 4 * 7], eax\r
@@ -717,7 +719,8 @@ FspApiCommonL1:
   jz      FspApiCommonL2\r
   cmpl    $0x03, %eax                        # FspMemoryInit API\r
   jz      FspApiCommonL2\r
-  jmp     Pei2LoaderSwitchStack\r
+  call    ASM_PFX(AsmGetFspInfoHeader)\r
+  jmp     Loader2PeiSwitchStack\r
 \r
 FspApiCommonL2:\r
   #\r
@@ -725,9 +728,17 @@ FspApiCommonL2:
   #  \r
   \r
   #\r
-  # Store the address in FSP which will return control to the BL\r
+  # Place holder to store the FspInfoHeader pointer\r
+  #\r
+  pushl  %eax\r
+\r
+  #\r
+  # Update the FspInfoHeader pointer\r
   #\r
-  pushl   $FspApiCommonExit\r
+  pushl  %eax\r
+  call   ASM_PFX(AsmGetFspInfoHeader)\r
+  movl   %eax, 4(%esp)\r
+  popl   %eax\r
 \r
   #\r
   # Create a Task Frame in the stack for the Boot Loader\r
@@ -763,7 +774,7 @@ FspApiCommonL2:
   #\r
   # Pass entry point of the PEI core\r
   #\r
-  call    ASM_PFX(GetFspBaseAddress)\r
+  call    ASM_PFX(AsmGetFspBaseAddress)\r
   movl    %eax, %edi\r
   addl    PcdGet32(PcdFspAreaSize), %edi\r
   subl    $0x20, %edi\r
@@ -777,7 +788,7 @@ FspApiCommonL2:
   # PcdFspAreaBaseAddress are the same. For FSP with mulitple FVs,\r
   # they are different. The code below can handle both cases.\r
   #\r
-  call    ASM_PFX(GetFspBaseAddress)\r
+  call    ASM_PFX(AsmGetFspBaseAddress)\r
   movl    %eax, %edi\r
   call    ASM_PFX(GetBootFirmwareVolumeOffset)\r
   addl    %edi, %eax\r
@@ -796,7 +807,7 @@ FspApiCommonL2:
   # Pass Control into the PEI Core\r
   #\r
   call    ASM_PFX(SecStartup)\r
-\r
+  addl    $4, %esp\r
 FspApiCommonExit:\r
   ret\r
 \r