Clean update API name for ASM function.

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
This commit is contained in:
Yao, Jiewen 2015-04-30 01:18:30 +00:00 committed by jyao1
parent 8f2f2f1985
commit 16b7e82c2b
7 changed files with 43 additions and 27 deletions

View File

@ -37,8 +37,8 @@ EXTERN FspApiCallingCheck:PROC
; ;
; Following functions will be provided in PlatformSecLib ; Following functions will be provided in PlatformSecLib
; ;
EXTERN GetFspBaseAddress:PROC EXTERN AsmGetFspBaseAddress:PROC
EXTERN GetFspInfoHdr:PROC EXTERN AsmGetFspInfoHeader:PROC
EXTERN GetBootFirmwareVolumeOffset:PROC EXTERN GetBootFirmwareVolumeOffset:PROC
EXTERN Loader2PeiSwitchStack:PROC EXTERN Loader2PeiSwitchStack:PROC
EXTERN LoadMicrocode(LoadMicrocodeDefault):PROC EXTERN LoadMicrocode(LoadMicrocodeDefault):PROC
@ -506,7 +506,7 @@ FspApiCommon PROC C PUBLIC
cmp eax, 3 ; FspMemoryInit API cmp eax, 3 ; FspMemoryInit API
jz @F jz @F
call GetFspInfoHdr call AsmGetFspInfoHeader
jmp Loader2PeiSwitchStack jmp Loader2PeiSwitchStack
@@: @@:
@ -523,7 +523,7 @@ FspApiCommon PROC C PUBLIC
; Update the FspInfoHeader pointer ; Update the FspInfoHeader pointer
; ;
push eax push eax
call GetFspInfoHdr call AsmGetFspInfoHeader
mov [esp + 4], eax mov [esp + 4], eax
pop eax pop eax
@ -559,7 +559,7 @@ FspApiCommon PROC C PUBLIC
; ;
; Pass entry point of the PEI core ; Pass entry point of the PEI core
; ;
call GetFspBaseAddress call AsmGetFspBaseAddress
mov edi, eax mov edi, eax
add edi, PcdGet32 (PcdFspAreaSize) add edi, PcdGet32 (PcdFspAreaSize)
sub edi, 20h sub edi, 20h
@ -573,7 +573,7 @@ FspApiCommon PROC C PUBLIC
; PcdFspAreaBaseAddress are the same. For FSP with mulitple FVs, ; PcdFspAreaBaseAddress are the same. For FSP with mulitple FVs,
; they are different. The code below can handle both cases. ; they are different. The code below can handle both cases.
; ;
call GetFspBaseAddress call AsmGetFspBaseAddress
mov edi, eax mov edi, eax
call GetBootFirmwareVolumeOffset call GetBootFirmwareVolumeOffset
add eax, edi add eax, edi

View File

@ -215,8 +215,8 @@ ASM_GLOBAL ASM_PFX(FspApiCallingCheck)
# #
# Following functions will be provided in PlatformSecLib # Following functions will be provided in PlatformSecLib
# #
ASM_GLOBAL ASM_PFX(GetFspBaseAddress) ASM_GLOBAL ASM_PFX(AsmGetFspBaseAddress)
ASM_GLOBAL ASM_PFX(GetFspInfoHdr) ASM_GLOBAL ASM_PFX(AsmGetFspInfoHeader)
ASM_GLOBAL ASM_PFX(GetBootFirmwareVolumeOffset) ASM_GLOBAL ASM_PFX(GetBootFirmwareVolumeOffset)
ASM_GLOBAL ASM_PFX(Loader2PeiSwitchStack) ASM_GLOBAL ASM_PFX(Loader2PeiSwitchStack)
@ -718,7 +718,7 @@ FspApiCommonL1:
jz FspApiCommonL2 jz FspApiCommonL2
cmpl $0x03, %eax # FspMemoryInit API cmpl $0x03, %eax # FspMemoryInit API
jz FspApiCommonL2 jz FspApiCommonL2
call ASM_PFX(GetFspInfoHdr) call ASM_PFX(AsmGetFspInfoHeader)
jmp Loader2PeiSwitchStack jmp Loader2PeiSwitchStack
FspApiCommonL2: FspApiCommonL2:
@ -735,7 +735,7 @@ FspApiCommonL2:
# Update the FspInfoHeader pointer # Update the FspInfoHeader pointer
# #
pushl %eax pushl %eax
call ASM_PFX(GetFspInfoHdr) call ASM_PFX(AsmGetFspInfoHeader)
movl %eax, 4(%esp) movl %eax, 4(%esp)
popl %eax popl %eax
@ -773,7 +773,7 @@ FspApiCommonL2:
# #
# Pass entry point of the PEI core # Pass entry point of the PEI core
# #
call ASM_PFX(GetFspBaseAddress) call ASM_PFX(AsmGetFspBaseAddress)
movl %eax, %edi movl %eax, %edi
addl PcdGet32(PcdFspAreaSize), %edi addl PcdGet32(PcdFspAreaSize), %edi
subl $0x20, %edi subl $0x20, %edi
@ -787,7 +787,7 @@ FspApiCommonL2:
# PcdFspAreaBaseAddress are the same. For FSP with mulitple FVs, # PcdFspAreaBaseAddress are the same. For FSP with mulitple FVs,
# they are different. The code below can handle both cases. # they are different. The code below can handle both cases.
# #
call ASM_PFX(GetFspBaseAddress) call ASM_PFX(AsmGetFspBaseAddress)
movl %eax, %edi movl %eax, %edi
call ASM_PFX(GetBootFirmwareVolumeOffset) call ASM_PFX(GetBootFirmwareVolumeOffset)
addl %edi, %eax addl %edi, %eax

View File

@ -22,18 +22,18 @@ FspInfoHeaderRelativeOff PROC NEAR PUBLIC
DD 012345678h DD 012345678h
FspInfoHeaderRelativeOff ENDP FspInfoHeaderRelativeOff ENDP
GetFspBaseAddress PROC NEAR PUBLIC AsmGetFspBaseAddress PROC NEAR PUBLIC
mov eax, GetFspBaseAddress mov eax, AsmGetFspBaseAddress
sub eax, dword ptr [FspInfoHeaderRelativeOff] sub eax, dword ptr [FspInfoHeaderRelativeOff]
add eax, 01Ch add eax, 01Ch
mov eax, dword ptr [eax] mov eax, dword ptr [eax]
ret ret
GetFspBaseAddress ENDP AsmGetFspBaseAddress ENDP
GetFspInfoHdr PROC NEAR PUBLIC AsmGetFspInfoHeader PROC NEAR PUBLIC
mov eax, GetFspBaseAddress mov eax, AsmGetFspBaseAddress
sub eax, dword ptr [FspInfoHeaderRelativeOff] sub eax, dword ptr [FspInfoHeaderRelativeOff]
ret ret
GetFspInfoHdr ENDP AsmGetFspInfoHeader ENDP
END END

View File

@ -23,16 +23,16 @@ ASM_PFX(FspInfoHeaderRelativeOff):
.long 0x012345678 .long 0x012345678
ASM_GLOBAL ASM_PFX(GetFspBaseAddress) ASM_GLOBAL ASM_PFX(AsmGetFspBaseAddress)
ASM_PFX(GetFspBaseAddress): ASM_PFX(AsmGetFspBaseAddress):
mov $GetFspBaseAddress, %eax mov $AsmGetFspBaseAddress, %eax
sub $FspInfoHeaderRelativeOff, %eax sub $FspInfoHeaderRelativeOff, %eax
add $0x01C, %eax add $0x01C, %eax
mov (%eax), %eax mov (%eax), %eax
ret ret
ASM_GLOBAL ASM_PFX(GetFspInfoHdr) ASM_GLOBAL ASM_PFX(AsmGetFspInfoHeader)
ASM_PFX(GetFspInfoHdr): ASM_PFX(AsmGetFspInfoHeader):
mov $GetFspBaseAddress, %eax mov $AsmGetFspBaseAddress, %eax
sub $FspInfoHeaderRelativeOff, %eax sub $FspInfoHeaderRelativeOff, %eax
ret ret

View File

@ -32,7 +32,7 @@ FspGetExceptionHandler(
IA32_IDT_GATE_DESCRIPTOR *IdtGateDescriptor; IA32_IDT_GATE_DESCRIPTOR *IdtGateDescriptor;
FSP_INFO_HEADER *FspInfoHeader; FSP_INFO_HEADER *FspInfoHeader;
FspInfoHeader = (FSP_INFO_HEADER *)(GetFspBaseAddress() + FSP_INFO_HEADER_OFF); FspInfoHeader = (FSP_INFO_HEADER *)AsmGetFspInfoHeader();
ExceptionHandler = IdtEntryTemplate; ExceptionHandler = IdtEntryTemplate;
IdtGateDescriptor = (IA32_IDT_GATE_DESCRIPTOR *)&ExceptionHandler; IdtGateDescriptor = (IA32_IDT_GATE_DESCRIPTOR *)&ExceptionHandler;
Entry = (IdtGateDescriptor->Bits.OffsetHigh << 16) | IdtGateDescriptor->Bits.OffsetLow; Entry = (IdtGateDescriptor->Bits.OffsetHigh << 16) | IdtGateDescriptor->Bits.OffsetLow;
@ -171,7 +171,7 @@ FspGlobalDataInit (
// Get FSP Header offset // Get FSP Header offset
// It may have multiple FVs, so look into the last one for FSP header // It may have multiple FVs, so look into the last one for FSP header
// //
PeiFspData->FspInfoHeader = (FSP_INFO_HEADER *)(GetFspBaseAddress() + FSP_INFO_HEADER_OFF); PeiFspData->FspInfoHeader = (FSP_INFO_HEADER *)AsmGetFspInfoHeader();
SecGetPlatformData (PeiFspData); SecGetPlatformData (PeiFspData);
// //

View File

@ -80,7 +80,19 @@ FspDataPointerFixUp (
**/ **/
UINT32 UINT32
EFIAPI EFIAPI
GetFspBaseAddress ( AsmGetFspBaseAddress (
VOID
);
/**
This interface gets FspInfoHeader pointer
@return FSP binary base address.
**/
UINT32
EFIAPI
AsmGetFspInfoHeader (
VOID VOID
); );

View File

@ -29,6 +29,8 @@
#define OFFSET_IN_FSP_INFO_HEADER(x) (UINT32)&((FSP_INFO_HEADER *)(UINTN)0)->x #define OFFSET_IN_FSP_INFO_HEADER(x) (UINT32)&((FSP_INFO_HEADER *)(UINTN)0)->x
#define FSP_INFO_HEADER_SIGNATURE SIGNATURE_32 ('F', 'S', 'P', 'H')
#pragma pack(1) #pragma pack(1)
typedef struct { typedef struct {
@ -124,6 +126,8 @@ typedef struct {
/// ///
/// Below structure is added in FSP version 2 /// Below structure is added in FSP version 2
/// ///
#define FSP_INFO_EXTENDED_HEADER_SIGNATURE SIGNATURE_32 ('F', 'S', 'P', 'E')
typedef struct { typedef struct {
/// ///
/// Byte 0x00: Signature ('FSPE') for the FSP Extended Information Header /// Byte 0x00: Signature ('FSPE') for the FSP Extended Information Header