mirror of https://github.com/acidanthera/audk.git
IntelFsp2WrapperPkg: Check header revision for MultiPhase support.
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4119 Earlier version of FSP header may not have MultiPhase fields present in the FspInfoHeader so the handler should verify header revision before accessing the MultiPhase fields from the header. Cc: Nate DeSimone <nathaniel.l.desimone@intel.com> Cc: Star Zeng <star.zeng@intel.com> Signed-off-by: Chasel Chiu <chasel.chiu@intel.com> Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
This commit is contained in:
parent
7464db4474
commit
26638d2aa3
|
@ -73,15 +73,27 @@ CallFspMultiPhaseEntry (
|
||||||
//
|
//
|
||||||
// FSP_MULTI_PHASE_INIT and FSP_MULTI_PHASE_SI_INIT API functions having same prototype.
|
// FSP_MULTI_PHASE_INIT and FSP_MULTI_PHASE_SI_INIT API functions having same prototype.
|
||||||
//
|
//
|
||||||
UINTN FspMultiPhaseApiEntry;
|
UINTN FspMultiPhaseApiEntry;
|
||||||
UINTN FspMultiPhaseApiOffset;
|
UINTN FspMultiPhaseApiOffset;
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
BOOLEAN InterruptState;
|
BOOLEAN InterruptState;
|
||||||
|
BOOLEAN IsVariableServiceRequest;
|
||||||
|
FSP_MULTI_PHASE_PARAMS *FspMultiPhaseParamsPtr;
|
||||||
|
|
||||||
|
FspMultiPhaseParamsPtr = (FSP_MULTI_PHASE_PARAMS *)FspMultiPhaseParams;
|
||||||
|
IsVariableServiceRequest = FALSE;
|
||||||
|
if ((FspMultiPhaseParamsPtr->MultiPhaseAction == EnumMultiPhaseGetVariableRequestInfo) ||
|
||||||
|
(FspMultiPhaseParamsPtr->MultiPhaseAction == EnumMultiPhaseCompleteVariableRequest))
|
||||||
|
{
|
||||||
|
IsVariableServiceRequest = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
if (ComponentIndex == FspMultiPhaseMemInitApiIndex) {
|
if (ComponentIndex == FspMultiPhaseMemInitApiIndex) {
|
||||||
FspHeader = (FSP_INFO_HEADER *)FspFindFspHeader (PcdGet32 (PcdFspmBaseAddress));
|
FspHeader = (FSP_INFO_HEADER *)FspFindFspHeader (PcdGet32 (PcdFspmBaseAddress));
|
||||||
if (FspHeader == NULL) {
|
if (FspHeader == NULL) {
|
||||||
return EFI_DEVICE_ERROR;
|
return EFI_DEVICE_ERROR;
|
||||||
|
} else if (FspHeader->SpecVersion < 0x24) {
|
||||||
|
return EFI_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
FspMultiPhaseApiOffset = FspHeader->FspMultiPhaseMemInitEntryOffset;
|
FspMultiPhaseApiOffset = FspHeader->FspMultiPhaseMemInitEntryOffset;
|
||||||
|
@ -89,6 +101,10 @@ CallFspMultiPhaseEntry (
|
||||||
FspHeader = (FSP_INFO_HEADER *)FspFindFspHeader (PcdGet32 (PcdFspsBaseAddress));
|
FspHeader = (FSP_INFO_HEADER *)FspFindFspHeader (PcdGet32 (PcdFspsBaseAddress));
|
||||||
if (FspHeader == NULL) {
|
if (FspHeader == NULL) {
|
||||||
return EFI_DEVICE_ERROR;
|
return EFI_DEVICE_ERROR;
|
||||||
|
} else if (FspHeader->SpecVersion < 0x22) {
|
||||||
|
return EFI_UNSUPPORTED;
|
||||||
|
} else if ((FspHeader->SpecVersion < 0x24) && (IsVariableServiceRequest == TRUE)) {
|
||||||
|
return EFI_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
FspMultiPhaseApiOffset = FspHeader->FspMultiPhaseSiInitEntryOffset;
|
FspMultiPhaseApiOffset = FspHeader->FspMultiPhaseSiInitEntryOffset;
|
||||||
|
@ -117,10 +133,11 @@ CallFspMultiPhaseEntry (
|
||||||
/**
|
/**
|
||||||
FSP Wrapper Variable Request Handler
|
FSP Wrapper Variable Request Handler
|
||||||
|
|
||||||
@param[in] FspHobListPtr - Pointer to FSP HobList (valid after FSP-M completed)
|
@param[in, out] FspHobListPtr - Pointer to FSP HobList (valid after FSP-M completed)
|
||||||
@param[in] ComponentIndex - FSP Component which executing MultiPhase initialization.
|
@param[in] ComponentIndex - FSP Component which executing MultiPhase initialization.
|
||||||
|
|
||||||
@retval EFI_UNSUPPORTED FSP Wrapper cannot support the specific variable request
|
@retval EFI_UNSUPPORTED FSP Wrapper cannot support the specific variable request,
|
||||||
|
or FSP does not support VariableService
|
||||||
@retval EFI_STATUS Return FSP returned status
|
@retval EFI_STATUS Return FSP returned status
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
@ -284,10 +301,11 @@ FspWrapperVariableRequestHandler (
|
||||||
/**
|
/**
|
||||||
FSP Wrapper MultiPhase Handler
|
FSP Wrapper MultiPhase Handler
|
||||||
|
|
||||||
@param[in] FspHobListPtr - Pointer to FSP HobList (valid after FSP-M completed)
|
@param[in, out] FspHobListPtr - Pointer to FSP HobList (valid after FSP-M completed)
|
||||||
@param[in] ComponentIndex - FSP Component which executing MultiPhase initialization.
|
@param[in] ComponentIndex - FSP Component which executing MultiPhase initialization.
|
||||||
|
|
||||||
@retval EFI_STATUS Always return EFI_SUCCESS
|
@retval EFI_UNSUPPORTED Specific MultiPhase action was not supported.
|
||||||
|
@retval EFI_SUCCESS MultiPhase action were completed successfully.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
|
|
Loading…
Reference in New Issue