Move FW update uCode structure check to its own function
Signed-off-by: Sean McGinn <sean.mcginn@intel.com>
This commit is contained in:
parent
a52a054333
commit
7fca88c50d
|
@ -1162,7 +1162,7 @@ Reboot (
|
|||
}
|
||||
|
||||
/**
|
||||
Verify the firmware internal structure.
|
||||
Verify uCode internal structure
|
||||
|
||||
@param[in] ImageHdr Pointer to the fw mgmt capsule image header
|
||||
|
||||
|
@ -1170,7 +1170,7 @@ Reboot (
|
|||
@retval others There is error happening.
|
||||
**/
|
||||
EFI_STATUS
|
||||
VerifyFwStruct (
|
||||
VerifyUcodeStruct (
|
||||
IN EFI_FW_MGMT_CAP_IMAGE_HEADER *ImageHdr
|
||||
)
|
||||
{
|
||||
|
@ -1179,8 +1179,6 @@ VerifyFwStruct (
|
|||
CPU_MICROCODE_HEADER *UCodeHdr;
|
||||
UINT8 *ImageByte;
|
||||
|
||||
if ((UINT32)ImageHdr->UpdateHardwareInstance == FLASH_MAP_SIG_UCODE) {
|
||||
|
||||
// Update is only supported for platforms that slot their uCode
|
||||
if (PcdGet32 (PcdUcodeSlotSize) == 0) {
|
||||
DEBUG((DEBUG_ERROR, "Existing image does not contain uCode slots!!\n"));
|
||||
|
@ -1211,6 +1209,30 @@ VerifyFwStruct (
|
|||
++ImageOffset;
|
||||
ImageByte = (UINT8*)(ImageBase + ImageOffset);
|
||||
}
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Verify the firmware internal structure.
|
||||
|
||||
@param[in] ImageHdr Pointer to the fw mgmt capsule image header
|
||||
|
||||
@retval EFI_SUCCESS The operation completed successfully.
|
||||
@retval others There is error happening.
|
||||
**/
|
||||
EFI_STATUS
|
||||
VerifyFwStruct (
|
||||
IN EFI_FW_MGMT_CAP_IMAGE_HEADER *ImageHdr
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
|
||||
if ((UINT32)ImageHdr->UpdateHardwareInstance == FLASH_MAP_SIG_UCODE) {
|
||||
Status = VerifyUcodeStruct (ImageHdr);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
}
|
||||
|
||||
return EFI_SUCCESS;
|
||||
|
|
|
@ -98,6 +98,19 @@ VerifyFwVersion (
|
|||
IN FIRMWARE_UPDATE_POLICY FwPolicy
|
||||
);
|
||||
|
||||
/**
|
||||
Verify uCode internal structure
|
||||
|
||||
@param[in] ImageHdr Pointer to the fw mgmt capsule image header
|
||||
|
||||
@retval EFI_SUCCESS The operation completed successfully.
|
||||
@retval others There is error happening.
|
||||
**/
|
||||
EFI_STATUS
|
||||
VerifyUcodeStruct (
|
||||
IN EFI_FW_MGMT_CAP_IMAGE_HEADER *ImageHdr
|
||||
);
|
||||
|
||||
/**
|
||||
Verify the firmware internal structure.
|
||||
|
||||
|
|
Loading…
Reference in New Issue