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
;\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
cmp eax, 3 ; FspMemoryInit API\r
jz @F\r
\r
cmp eax, 3 ; FspMemoryInit API\r
jz @F\r
\r
+ call AsmGetFspInfoHeader\r
jmp Loader2PeiSwitchStack\r
\r
@@:\r
jmp Loader2PeiSwitchStack\r
\r
@@:\r
; Update the FspInfoHeader pointer\r
;\r
push eax\r
; Update the FspInfoHeader pointer\r
;\r
push eax\r
+ call AsmGetFspInfoHeader\r
mov [esp + 4], eax\r
pop eax\r
\r
mov [esp + 4], eax\r
pop eax\r
\r
;\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
; 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
#\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
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
# 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
#\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
# 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
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
-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
+AsmGetFspInfoHeader ENDP\r
\r
END
\ No newline at end of file
\r
END
\ No newline at end of file
.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
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
// 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
+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
\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
///\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