]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryM.nasm
IntelFsp2Pkg: Add FSPx_ARCH2_UPD support for X64
[mirror_edk2.git] / IntelFsp2Pkg / FspSecCore / Ia32 / FspApiEntryM.nasm
index e7261b41cd28be8dabd4af4614b263253f3c5c50..5dada2af54a4412d0d4cbb089546327b63635ee4 100644 (file)
@@ -1,7 +1,7 @@
 ;; @file\r
 ;  Provide FSP API entry points.\r
 ;\r
-; Copyright (c) 2016 - 2019, Intel Corporation. All rights reserved.<BR>\r
+; Copyright (c) 2016 - 2022, Intel Corporation. All rights reserved.<BR>\r
 ; SPDX-License-Identifier: BSD-2-Clause-Patent\r
 ;;\r
 \r
@@ -32,6 +32,24 @@ struc FSPM_UPD_COMMON
     .size:\r
 endstruc\r
 \r
+struc FSPM_UPD_COMMON_FSP24\r
+    ; FSP_UPD_HEADER {\r
+    .FspUpdHeader:              resd  8\r
+    ; }\r
+    ; FSPM_ARCH2_UPD {\r
+    .Revision:                  resb  1\r
+    .Reserved:                  resb  3\r
+    .Length                     resd  1\r
+    .StackBase:                 resq  1\r
+    .StackSize:                 resq  1\r
+    .BootLoaderTolumSize:       resd  1\r
+    .BootMode:                  resd  1\r
+    .FspEventHandler            resq  1\r
+    .Reserved1:                 resb 24\r
+    ; }\r
+    .size:\r
+endstruc\r
+\r
 ;\r
 ; Following functions will be provided in C\r
 ;\r
@@ -124,12 +142,22 @@ ASM_PFX(FspApiCommonContinue):
   pop    eax\r
 \r
 FspStackSetup:\r
+  mov    ecx, [edx + FSPM_UPD_COMMON.Revision]\r
+  cmp    ecx, 3\r
+  jae    FspmUpdCommon2\r
+\r
   ;\r
   ; StackBase = temp memory base, StackSize = temp memory size\r
   ;\r
   mov    edi, [edx + FSPM_UPD_COMMON.StackBase]\r
   mov    ecx, [edx + FSPM_UPD_COMMON.StackSize]\r
+  jmp    ChkFspHeapSize\r
+\r
+FspmUpdCommon2:\r
+  mov    edi, [edx + FSPM_UPD_COMMON_FSP24.StackBase]\r
+  mov    ecx, [edx + FSPM_UPD_COMMON_FSP24.StackSize]\r
 \r
+ChkFspHeapSize:\r
   ;\r
   ; Keep using bootloader stack if heap size % is 0\r
   ;\r
@@ -219,7 +247,7 @@ exit:
 global ASM_PFX(FspPeiCoreEntryOff)\r
 ASM_PFX(FspPeiCoreEntryOff):\r
    ;\r
-   ; This value will be pached by the build script\r
+   ; This value will be patched by the build script\r
    ;\r
    DD    0x12345678\r
 \r