]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Clean update API name for ASM function.
authorYao, Jiewen <Jiewen.Yao@intel.com>
Thu, 30 Apr 2015 01:18:30 +0000 (01:18 +0000)
committerjyao1 <jyao1@Edk2>
Thu, 30 Apr 2015 01:18:30 +0000 (01:18 +0000)
Add FSP_INFO_HEADER_SIGNATURE and FSP_INFO_EXTENDED_HEADER_SIGNATURE.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Yao, Jiewen" <Jiewen.Yao@intel.com>
Reviewed-by: "Ma, Maurice" <maurice.ma@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17271 6f19259b-4bc3-4df7-8a09-765794883524

IntelFspPkg/FspSecCore/Ia32/FspApiEntry.asm
IntelFspPkg/FspSecCore/Ia32/FspApiEntry.s
IntelFspPkg/FspSecCore/Ia32/FspHelper.asm
IntelFspPkg/FspSecCore/Ia32/FspHelper.s
IntelFspPkg/FspSecCore/SecFsp.c
IntelFspPkg/FspSecCore/SecFsp.h
IntelFspPkg/Include/FspInfoHeader.h

index d736f8035895afd3042360f9043970f8873f7933..a01b3c2d49c378453a52b1c61b6b8d2589b34e2d 100644 (file)
@@ -37,8 +37,8 @@ EXTERN   FspApiCallingCheck:PROC
 ;\r
 ; Following functions will be provided in PlatformSecLib\r
 ;\r
 ;\r
 ; Following functions will be provided in PlatformSecLib\r
 ;\r
-EXTERN   GetFspBaseAddress:PROC\r
-EXTERN   GetFspInfoHdr:PROC\r
+EXTERN   AsmGetFspBaseAddress:PROC\r
+EXTERN   AsmGetFspInfoHeader:PROC\r
 EXTERN   GetBootFirmwareVolumeOffset:PROC\r
 EXTERN   Loader2PeiSwitchStack:PROC\r
 EXTERN   LoadMicrocode(LoadMicrocodeDefault):PROC\r
 EXTERN   GetBootFirmwareVolumeOffset:PROC\r
 EXTERN   Loader2PeiSwitchStack:PROC\r
 EXTERN   LoadMicrocode(LoadMicrocodeDefault):PROC\r
@@ -506,7 +506,7 @@ FspApiCommon   PROC C PUBLIC
   cmp    eax, 3   ; FspMemoryInit API\r
   jz     @F\r
 \r
   cmp    eax, 3   ; FspMemoryInit API\r
   jz     @F\r
 \r
-  call   GetFspInfoHdr\r
+  call   AsmGetFspInfoHeader\r
   jmp    Loader2PeiSwitchStack\r
 \r
 @@:\r
   jmp    Loader2PeiSwitchStack\r
 \r
 @@:\r
@@ -523,7 +523,7 @@ FspApiCommon   PROC C PUBLIC
   ; Update the FspInfoHeader pointer\r
   ;\r
   push   eax\r
   ; Update the FspInfoHeader pointer\r
   ;\r
   push   eax\r
-  call   GetFspInfoHdr\r
+  call   AsmGetFspInfoHeader\r
   mov    [esp + 4], eax\r
   pop    eax\r
 \r
   mov    [esp + 4], eax\r
   pop    eax\r
 \r
@@ -559,7 +559,7 @@ FspApiCommon   PROC C PUBLIC
   ;\r
   ; Pass entry point of the PEI core\r
   ;\r
   ;\r
   ; Pass entry point of the PEI core\r
   ;\r
-  call    GetFspBaseAddress\r
+  call    AsmGetFspBaseAddress\r
   mov     edi, eax\r
   add     edi, PcdGet32 (PcdFspAreaSize) \r
   sub     edi, 20h\r
   mov     edi, eax\r
   add     edi, PcdGet32 (PcdFspAreaSize) \r
   sub     edi, 20h\r
@@ -573,7 +573,7 @@ FspApiCommon   PROC C PUBLIC
   ; PcdFspAreaBaseAddress are the same. For FSP with mulitple FVs,\r
   ; they are different. The code below can handle both cases.\r
   ;\r
   ; PcdFspAreaBaseAddress are the same. For FSP with mulitple FVs,\r
   ; they are different. The code below can handle both cases.\r
   ;\r
-  call    GetFspBaseAddress\r
+  call    AsmGetFspBaseAddress\r
   mov     edi, eax\r
   call    GetBootFirmwareVolumeOffset\r
   add     eax, edi\r
   mov     edi, eax\r
   call    GetBootFirmwareVolumeOffset\r
   add     eax, edi\r
index d0f5b20b96dcd9b40737e3a1ea5e5a8550878724..e7b82d5e939c3505254122415b2ea7893e856bef 100644 (file)
@@ -215,8 +215,8 @@ ASM_GLOBAL    ASM_PFX(FspApiCallingCheck)
 #\r
 # Following functions will be provided in PlatformSecLib\r
 #\r
 #\r
 # Following functions will be provided in PlatformSecLib\r
 #\r
-ASM_GLOBAL    ASM_PFX(GetFspBaseAddress)\r
-ASM_GLOBAL    ASM_PFX(GetFspInfoHdr)\r
+ASM_GLOBAL    ASM_PFX(AsmGetFspBaseAddress)\r
+ASM_GLOBAL    ASM_PFX(AsmGetFspInfoHeader)\r
 ASM_GLOBAL    ASM_PFX(GetBootFirmwareVolumeOffset)\r
 ASM_GLOBAL    ASM_PFX(Loader2PeiSwitchStack)\r
 \r
 ASM_GLOBAL    ASM_PFX(GetBootFirmwareVolumeOffset)\r
 ASM_GLOBAL    ASM_PFX(Loader2PeiSwitchStack)\r
 \r
@@ -718,7 +718,7 @@ FspApiCommonL1:
   jz      FspApiCommonL2\r
   cmpl    $0x03, %eax                        # FspMemoryInit API\r
   jz      FspApiCommonL2\r
   jz      FspApiCommonL2\r
   cmpl    $0x03, %eax                        # FspMemoryInit API\r
   jz      FspApiCommonL2\r
-  call    ASM_PFX(GetFspInfoHdr)\r
+  call    ASM_PFX(AsmGetFspInfoHeader)\r
   jmp     Loader2PeiSwitchStack\r
 \r
 FspApiCommonL2:\r
   jmp     Loader2PeiSwitchStack\r
 \r
 FspApiCommonL2:\r
@@ -735,7 +735,7 @@ FspApiCommonL2:
   # Update the FspInfoHeader pointer\r
   #\r
   pushl  %eax\r
   # Update the FspInfoHeader pointer\r
   #\r
   pushl  %eax\r
-  call   ASM_PFX(GetFspInfoHdr)\r
+  call   ASM_PFX(AsmGetFspInfoHeader)\r
   movl   %eax, 4(%esp)\r
   popl   %eax\r
 \r
   movl   %eax, 4(%esp)\r
   popl   %eax\r
 \r
@@ -773,7 +773,7 @@ FspApiCommonL2:
   #\r
   # Pass entry point of the PEI core\r
   #\r
   #\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
   movl    %eax, %edi\r
   addl    PcdGet32(PcdFspAreaSize), %edi\r
   subl    $0x20, %edi\r
@@ -787,7 +787,7 @@ FspApiCommonL2:
   # PcdFspAreaBaseAddress are the same. For FSP with mulitple FVs,\r
   # they are different. The code below can handle both cases.\r
   #\r
   # 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
   movl    %eax, %edi\r
   call    ASM_PFX(GetBootFirmwareVolumeOffset)\r
   addl    %edi, %eax\r
index 655481c14f9b2d1aec59ac75429083753c8e74a7..8efea01aae8780acc554af00d0228c1c5febb078 100644 (file)
@@ -22,18 +22,18 @@ FspInfoHeaderRelativeOff    PROC      NEAR    PUBLIC
    DD    012345678h\r
 FspInfoHeaderRelativeOff    ENDP\r
 \r
    DD    012345678h\r
 FspInfoHeaderRelativeOff    ENDP\r
 \r
-GetFspBaseAddress           PROC      NEAR    PUBLIC\r
-   mov   eax, GetFspBaseAddress\r
+AsmGetFspBaseAddress        PROC      NEAR    PUBLIC\r
+   mov   eax, AsmGetFspBaseAddress\r
    sub   eax, dword ptr [FspInfoHeaderRelativeOff]\r
    add   eax, 01Ch\r
    mov   eax, dword ptr [eax]\r
    ret\r
    sub   eax, dword ptr [FspInfoHeaderRelativeOff]\r
    add   eax, 01Ch\r
    mov   eax, dword ptr [eax]\r
    ret\r
-GetFspBaseAddress           ENDP\r
+AsmGetFspBaseAddress        ENDP\r
 \r
 \r
-GetFspInfoHdr               PROC      NEAR    PUBLIC\r
-   mov   eax, GetFspBaseAddress\r
+AsmGetFspInfoHeader         PROC      NEAR    PUBLIC\r
+   mov   eax, AsmGetFspBaseAddress\r
    sub   eax, dword ptr [FspInfoHeaderRelativeOff]\r
    ret\r
    sub   eax, dword ptr [FspInfoHeaderRelativeOff]\r
    ret\r
-GetFspInfoHdr               ENDP\r
+AsmGetFspInfoHeader         ENDP\r
 \r
      END
\ No newline at end of file
 \r
      END
\ No newline at end of file
index 5d1bf74c30f4e4c2cf93beb21d4bd14f71319aff..a6cf36259d69a4511a459e6f7862e6cb76122a55 100644 (file)
@@ -23,16 +23,16 @@ ASM_PFX(FspInfoHeaderRelativeOff):
    .long    0x012345678\r
 \r
 \r
    .long    0x012345678\r
 \r
 \r
-ASM_GLOBAL ASM_PFX(GetFspBaseAddress)\r
-ASM_PFX(GetFspBaseAddress):\r
-   mov    $GetFspBaseAddress, %eax\r
+ASM_GLOBAL ASM_PFX(AsmGetFspBaseAddress)\r
+ASM_PFX(AsmGetFspBaseAddress):\r
+   mov    $AsmGetFspBaseAddress, %eax\r
    sub    $FspInfoHeaderRelativeOff, %eax\r
    add    $0x01C, %eax\r
    mov    (%eax), %eax\r
    ret\r
 \r
    sub    $FspInfoHeaderRelativeOff, %eax\r
    add    $0x01C, %eax\r
    mov    (%eax), %eax\r
    ret\r
 \r
-ASM_GLOBAL ASM_PFX(GetFspInfoHdr)\r
-ASM_PFX(GetFspInfoHdr):\r
-   mov    $GetFspBaseAddress, %eax\r
+ASM_GLOBAL ASM_PFX(AsmGetFspInfoHeader)\r
+ASM_PFX(AsmGetFspInfoHeader):\r
+   mov    $AsmGetFspBaseAddress, %eax\r
    sub    $FspInfoHeaderRelativeOff, %eax\r
    ret\r
    sub    $FspInfoHeaderRelativeOff, %eax\r
    ret\r
index b4566045f9ba828b77fb480ce3db34a0642b6c1b..a9aba7108e338c971208d360d0499c1561c830a9 100644 (file)
@@ -32,7 +32,7 @@ FspGetExceptionHandler(
   IA32_IDT_GATE_DESCRIPTOR *IdtGateDescriptor;\r
   FSP_INFO_HEADER          *FspInfoHeader;\r
 \r
   IA32_IDT_GATE_DESCRIPTOR *IdtGateDescriptor;\r
   FSP_INFO_HEADER          *FspInfoHeader;\r
 \r
-  FspInfoHeader     = (FSP_INFO_HEADER *)(GetFspBaseAddress() + FSP_INFO_HEADER_OFF);\r
+  FspInfoHeader     = (FSP_INFO_HEADER *)AsmGetFspInfoHeader();\r
   ExceptionHandler  = IdtEntryTemplate;\r
   IdtGateDescriptor = (IA32_IDT_GATE_DESCRIPTOR *)&ExceptionHandler;\r
   Entry = (IdtGateDescriptor->Bits.OffsetHigh << 16) | IdtGateDescriptor->Bits.OffsetLow;\r
   ExceptionHandler  = IdtEntryTemplate;\r
   IdtGateDescriptor = (IA32_IDT_GATE_DESCRIPTOR *)&ExceptionHandler;\r
   Entry = (IdtGateDescriptor->Bits.OffsetHigh << 16) | IdtGateDescriptor->Bits.OffsetLow;\r
@@ -171,7 +171,7 @@ FspGlobalDataInit (
   // Get FSP Header offset\r
   // It may have multiple FVs, so look into the last one for FSP header\r
   //\r
   // Get FSP Header offset\r
   // It may have multiple FVs, so look into the last one for FSP header\r
   //\r
-  PeiFspData->FspInfoHeader      = (FSP_INFO_HEADER *)(GetFspBaseAddress() + FSP_INFO_HEADER_OFF);\r
+  PeiFspData->FspInfoHeader      = (FSP_INFO_HEADER *)AsmGetFspInfoHeader();\r
   SecGetPlatformData (PeiFspData);\r
 \r
   //\r
   SecGetPlatformData (PeiFspData);\r
 \r
   //\r
index 8e48a13f18aa369714b4c931bc4204740c89a32b..3e4e2a4b5cc112455f53be7d4c1759b51c6681a8 100644 (file)
@@ -80,7 +80,19 @@ FspDataPointerFixUp (
 **/\r
 UINT32\r
 EFIAPI\r
 **/\r
 UINT32\r
 EFIAPI\r
-GetFspBaseAddress (\r
+AsmGetFspBaseAddress (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  This interface gets FspInfoHeader pointer\r
+\r
+  @return   FSP binary base address.\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+AsmGetFspInfoHeader (\r
   VOID\r
   );\r
 \r
   VOID\r
   );\r
 \r
index 079ec98f96ca5fb31db17df9545a52f8d0ff92b7..951bc38507f7e5ebb4496efe6df53e89acfba403 100644 (file)
@@ -29,6 +29,8 @@
 \r
 #define  OFFSET_IN_FSP_INFO_HEADER(x)  (UINT32)&((FSP_INFO_HEADER *)(UINTN)0)->x\r
 \r
 \r
 #define  OFFSET_IN_FSP_INFO_HEADER(x)  (UINT32)&((FSP_INFO_HEADER *)(UINTN)0)->x\r
 \r
+#define FSP_INFO_HEADER_SIGNATURE  SIGNATURE_32 ('F', 'S', 'P', 'H')\r
+\r
 #pragma pack(1)\r
 \r
 typedef struct  {\r
 #pragma pack(1)\r
 \r
 typedef struct  {\r
@@ -124,6 +126,8 @@ typedef struct  {
 ///\r
 /// Below structure is added in FSP version 2\r
 ///\r
 ///\r
 /// Below structure is added in FSP version 2\r
 ///\r
+#define FSP_INFO_EXTENDED_HEADER_SIGNATURE  SIGNATURE_32 ('F', 'S', 'P', 'E')\r
+\r
 typedef struct  {\r
   ///\r
   /// Byte 0x00: Signature ('FSPE') for the FSP Extended Information Header\r
 typedef struct  {\r
   ///\r
   /// Byte 0x00: Signature ('FSPE') for the FSP Extended Information Header\r