diff options
author | Michael Kubacki <michael.kubacki@microsoft.com> | 2021-12-05 14:54:00 -0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2021-12-07 17:24:28 +0000 |
commit | 7c7184e201a90a1d2376e615e55e3f4074731468 (patch) | |
tree | aef22a19e4fea3dcf85203900a626b0c000d72db | |
parent | 111f2228ddf487b0ac3491e416bb3dcdcfa4f979 (diff) | |
download | edk2-7c7184e201a90a1d2376e615e55e3f4074731468.zip edk2-7c7184e201a90a1d2376e615e55e3f4074731468.tar.gz edk2-7c7184e201a90a1d2376e615e55e3f4074731468.tar.bz2 |
IntelFsp2WrapperPkg: Apply uncrustify changes
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737
Apply uncrustify changes to .c/.h files in the IntelFsp2WrapperPkg package
Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
26 files changed, 589 insertions, 557 deletions
diff --git a/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.c b/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.c index 0af0ec7..21385ac 100644 --- a/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.c +++ b/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.c @@ -21,25 +21,25 @@ #include <Library/HobLib.h>
#include <FspStatusCode.h>
-#define FSP_API_NOTIFY_PHASE_AFTER_PCI_ENUMERATION BIT16
+#define FSP_API_NOTIFY_PHASE_AFTER_PCI_ENUMERATION BIT16
typedef
EFI_STATUS
-(EFIAPI * ADD_PERFORMANCE_RECORDS)(
+(EFIAPI *ADD_PERFORMANCE_RECORDS)(
IN CONST VOID *HobStart
);
struct _ADD_PERFORMANCE_RECORD_PROTOCOL {
- ADD_PERFORMANCE_RECORDS AddPerformanceRecords;
+ ADD_PERFORMANCE_RECORDS AddPerformanceRecords;
};
typedef struct _ADD_PERFORMANCE_RECORD_PROTOCOL ADD_PERFORMANCE_RECORD_PROTOCOL;
-extern EFI_GUID gAddPerfRecordProtocolGuid;
-extern EFI_GUID gFspHobGuid;
-extern EFI_GUID gFspApiPerformanceGuid;
+extern EFI_GUID gAddPerfRecordProtocolGuid;
+extern EFI_GUID gFspHobGuid;
+extern EFI_GUID gFspApiPerformanceGuid;
-static EFI_EVENT mExitBootServicesEvent = NULL;
+static EFI_EVENT mExitBootServicesEvent = NULL;
/**
Relocate this image under 4G memory.
@@ -53,8 +53,8 @@ static EFI_EVENT mExitBootServicesEvent = NULL; **/
EFI_STATUS
RelocateImageUnder4GIfNeeded (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
);
/**
@@ -70,9 +70,9 @@ OnPciEnumerationComplete ( IN VOID *Context
)
{
- NOTIFY_PHASE_PARAMS NotifyPhaseParams;
- EFI_STATUS Status;
- VOID *Interface;
+ NOTIFY_PHASE_PARAMS NotifyPhaseParams;
+ EFI_STATUS Status;
+ VOID *Interface;
//
// Try to locate it because gEfiPciEnumerationCompleteProtocolGuid will trigger it once when registration.
@@ -84,26 +84,26 @@ OnPciEnumerationComplete ( &Interface
);
if (EFI_ERROR (Status)) {
- return ;
+ return;
}
NotifyPhaseParams.Phase = EnumInitPhaseAfterPciEnumeration;
- PERF_START_EX(&gFspApiPerformanceGuid, "EventRec", NULL, 0, FSP_STATUS_CODE_POST_PCIE_ENUM_NOTIFICATION | FSP_STATUS_CODE_COMMON_CODE | FSP_STATUS_CODE_API_ENTRY);
+ PERF_START_EX (&gFspApiPerformanceGuid, "EventRec", NULL, 0, FSP_STATUS_CODE_POST_PCIE_ENUM_NOTIFICATION | FSP_STATUS_CODE_COMMON_CODE | FSP_STATUS_CODE_API_ENTRY);
Status = CallFspNotifyPhase (&NotifyPhaseParams);
- PERF_END_EX(&gFspApiPerformanceGuid, "EventRec", NULL, 0, FSP_STATUS_CODE_POST_PCIE_ENUM_NOTIFICATION | FSP_STATUS_CODE_COMMON_CODE | FSP_STATUS_CODE_API_EXIT);
+ PERF_END_EX (&gFspApiPerformanceGuid, "EventRec", NULL, 0, FSP_STATUS_CODE_POST_PCIE_ENUM_NOTIFICATION | FSP_STATUS_CODE_COMMON_CODE | FSP_STATUS_CODE_API_EXIT);
//
// Reset the system if FSP API returned FSP_STATUS_RESET_REQUIRED status
//
if ((Status >= FSP_STATUS_RESET_REQUIRED_COLD) && (Status <= FSP_STATUS_RESET_REQUIRED_8)) {
- DEBUG((DEBUG_INFO, "FSP NotifyPhase AfterPciEnumeration requested reset 0x%x\n", Status));
+ DEBUG ((DEBUG_INFO, "FSP NotifyPhase AfterPciEnumeration requested reset 0x%x\n", Status));
CallFspWrapperResetSystem ((UINT32)Status);
}
if (Status != EFI_SUCCESS) {
- DEBUG((DEBUG_ERROR, "FSP NotifyPhase AfterPciEnumeration failed, status: 0x%x\n", Status));
+ DEBUG ((DEBUG_ERROR, "FSP NotifyPhase AfterPciEnumeration failed, status: 0x%x\n", Status));
} else {
- DEBUG((DEBUG_INFO, "FSP NotifyPhase AfterPciEnumeration Success.\n"));
+ DEBUG ((DEBUG_INFO, "FSP NotifyPhase AfterPciEnumeration Success.\n"));
}
}
@@ -125,28 +125,28 @@ OnReadyToBoot ( IN VOID *Context
)
{
- NOTIFY_PHASE_PARAMS NotifyPhaseParams;
- EFI_STATUS Status;
+ NOTIFY_PHASE_PARAMS NotifyPhaseParams;
+ EFI_STATUS Status;
gBS->CloseEvent (Event);
NotifyPhaseParams.Phase = EnumInitPhaseReadyToBoot;
- PERF_START_EX(&gFspApiPerformanceGuid, "EventRec", NULL, 0, FSP_STATUS_CODE_READY_TO_BOOT_NOTIFICATION | FSP_STATUS_CODE_COMMON_CODE | FSP_STATUS_CODE_API_ENTRY);
+ PERF_START_EX (&gFspApiPerformanceGuid, "EventRec", NULL, 0, FSP_STATUS_CODE_READY_TO_BOOT_NOTIFICATION | FSP_STATUS_CODE_COMMON_CODE | FSP_STATUS_CODE_API_ENTRY);
Status = CallFspNotifyPhase (&NotifyPhaseParams);
- PERF_END_EX(&gFspApiPerformanceGuid, "EventRec", NULL, 0, FSP_STATUS_CODE_READY_TO_BOOT_NOTIFICATION | FSP_STATUS_CODE_COMMON_CODE | FSP_STATUS_CODE_API_EXIT);
+ PERF_END_EX (&gFspApiPerformanceGuid, "EventRec", NULL, 0, FSP_STATUS_CODE_READY_TO_BOOT_NOTIFICATION | FSP_STATUS_CODE_COMMON_CODE | FSP_STATUS_CODE_API_EXIT);
//
// Reset the system if FSP API returned FSP_STATUS_RESET_REQUIRED status
//
if ((Status >= FSP_STATUS_RESET_REQUIRED_COLD) && (Status <= FSP_STATUS_RESET_REQUIRED_8)) {
- DEBUG((DEBUG_INFO, "FSP NotifyPhase ReadyToBoot requested reset 0x%x\n", Status));
+ DEBUG ((DEBUG_INFO, "FSP NotifyPhase ReadyToBoot requested reset 0x%x\n", Status));
CallFspWrapperResetSystem ((UINT32)Status);
}
if (Status != EFI_SUCCESS) {
- DEBUG((DEBUG_ERROR, "FSP NotifyPhase ReadyToBoot failed, status: 0x%x\n", Status));
+ DEBUG ((DEBUG_ERROR, "FSP NotifyPhase ReadyToBoot failed, status: 0x%x\n", Status));
} else {
- DEBUG((DEBUG_INFO, "FSP NotifyPhase ReadyToBoot Success.\n"));
+ DEBUG ((DEBUG_INFO, "FSP NotifyPhase ReadyToBoot Success.\n"));
}
}
@@ -166,39 +166,40 @@ OnEndOfFirmware ( IN VOID *Context
)
{
- NOTIFY_PHASE_PARAMS NotifyPhaseParams;
- EFI_STATUS Status;
- ADD_PERFORMANCE_RECORD_PROTOCOL *AddPerfRecordInterface;
- EFI_PEI_HOB_POINTERS Hob;
- VOID **FspHobListPtr;
+ NOTIFY_PHASE_PARAMS NotifyPhaseParams;
+ EFI_STATUS Status;
+ ADD_PERFORMANCE_RECORD_PROTOCOL *AddPerfRecordInterface;
+ EFI_PEI_HOB_POINTERS Hob;
+ VOID **FspHobListPtr;
gBS->CloseEvent (Event);
NotifyPhaseParams.Phase = EnumInitPhaseEndOfFirmware;
- PERF_START_EX(&gFspApiPerformanceGuid, "EventRec", NULL, 0, FSP_STATUS_CODE_END_OF_FIRMWARE_NOTIFICATION | FSP_STATUS_CODE_COMMON_CODE | FSP_STATUS_CODE_API_ENTRY);
+ PERF_START_EX (&gFspApiPerformanceGuid, "EventRec", NULL, 0, FSP_STATUS_CODE_END_OF_FIRMWARE_NOTIFICATION | FSP_STATUS_CODE_COMMON_CODE | FSP_STATUS_CODE_API_ENTRY);
Status = CallFspNotifyPhase (&NotifyPhaseParams);
- PERF_END_EX(&gFspApiPerformanceGuid, "EventRec", NULL, 0, FSP_STATUS_CODE_END_OF_FIRMWARE_NOTIFICATION | FSP_STATUS_CODE_COMMON_CODE | FSP_STATUS_CODE_API_EXIT);
+ PERF_END_EX (&gFspApiPerformanceGuid, "EventRec", NULL, 0, FSP_STATUS_CODE_END_OF_FIRMWARE_NOTIFICATION | FSP_STATUS_CODE_COMMON_CODE | FSP_STATUS_CODE_API_EXIT);
//
// Reset the system if FSP API returned FSP_STATUS_RESET_REQUIRED status
//
if ((Status >= FSP_STATUS_RESET_REQUIRED_COLD) && (Status <= FSP_STATUS_RESET_REQUIRED_8)) {
- DEBUG((DEBUG_INFO, "FSP NotifyPhase EndOfFirmware requested reset 0x%x\n", Status));
+ DEBUG ((DEBUG_INFO, "FSP NotifyPhase EndOfFirmware requested reset 0x%x\n", Status));
CallFspWrapperResetSystem ((UINT32)Status);
}
if (Status != EFI_SUCCESS) {
- DEBUG((DEBUG_ERROR, "FSP NotifyPhase EndOfFirmware failed, status: 0x%x\n", Status));
+ DEBUG ((DEBUG_ERROR, "FSP NotifyPhase EndOfFirmware failed, status: 0x%x\n", Status));
} else {
- DEBUG((DEBUG_INFO, "FSP NotifyPhase EndOfFirmware Success.\n"));
+ DEBUG ((DEBUG_INFO, "FSP NotifyPhase EndOfFirmware Success.\n"));
}
+
Status = gBS->LocateProtocol (
&gAddPerfRecordProtocolGuid,
NULL,
- (VOID**) &AddPerfRecordInterface
+ (VOID **)&AddPerfRecordInterface
);
if (EFI_ERROR (Status)) {
- DEBUG((DEBUG_INFO, "gAddPerfRecordProtocolGuid - Locate protocol failed\n"));
+ DEBUG ((DEBUG_INFO, "gAddPerfRecordProtocolGuid - Locate protocol failed\n"));
return;
} else {
Hob.Raw = GetFirstGuidHob (&gFspHobGuid);
@@ -224,15 +225,15 @@ OnEndOfFirmware ( EFI_STATUS
EFIAPI
FspWrapperNotifyDxeEntryPoint (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
)
{
- EFI_STATUS Status;
- EFI_EVENT ReadyToBootEvent;
- VOID *Registration;
- EFI_EVENT ProtocolNotifyEvent;
- UINT32 FspApiMask;
+ EFI_STATUS Status;
+ EFI_EVENT ReadyToBootEvent;
+ VOID *Registration;
+ EFI_EVENT ProtocolNotifyEvent;
+ UINT32 FspApiMask;
//
// Load this driver's image to memory
@@ -274,4 +275,3 @@ FspWrapperNotifyDxeEntryPoint ( return EFI_SUCCESS;
}
-
diff --git a/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/LoadBelow4G.c b/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/LoadBelow4G.c index ebfeb67..97723aa 100644 --- a/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/LoadBelow4G.c +++ b/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/LoadBelow4G.c @@ -29,18 +29,18 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/
EFI_STATUS
RelocateImageUnder4GIfNeeded (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
)
{
- EFI_STATUS Status;
- UINT8 *Buffer;
- UINTN BufferSize;
- EFI_HANDLE NewImageHandle;
- UINTN Pages;
- EFI_PHYSICAL_ADDRESS FfsBuffer;
- PE_COFF_LOADER_IMAGE_CONTEXT ImageContext;
- VOID *Interface;
+ EFI_STATUS Status;
+ UINT8 *Buffer;
+ UINTN BufferSize;
+ EFI_HANDLE NewImageHandle;
+ UINTN Pages;
+ EFI_PHYSICAL_ADDRESS FfsBuffer;
+ PE_COFF_LOADER_IMAGE_CONTEXT ImageContext;
+ VOID *Interface;
//
// If it is already <4G, no need do relocate
@@ -64,22 +64,22 @@ RelocateImageUnder4GIfNeeded ( // Here we install a dummy handle
//
NewImageHandle = NULL;
- Status = gBS->InstallProtocolInterface (
- &NewImageHandle,
- &gEfiCallerIdGuid,
- EFI_NATIVE_INTERFACE,
- NULL
- );
+ Status = gBS->InstallProtocolInterface (
+ &NewImageHandle,
+ &gEfiCallerIdGuid,
+ EFI_NATIVE_INTERFACE,
+ NULL
+ );
ASSERT_EFI_ERROR (Status);
//
// Reload image itself to <4G mem
//
- Status = GetSectionFromAnyFv (
+ Status = GetSectionFromAnyFv (
&gEfiCallerIdGuid,
EFI_SECTION_PE32,
0,
- (VOID **) &Buffer,
+ (VOID **)&Buffer,
&BufferSize
);
ASSERT_EFI_ERROR (Status);
@@ -91,17 +91,18 @@ RelocateImageUnder4GIfNeeded ( Status = PeCoffLoaderGetImageInfo (&ImageContext);
ASSERT_EFI_ERROR (Status);
if (ImageContext.SectionAlignment > EFI_PAGE_SIZE) {
- Pages = EFI_SIZE_TO_PAGES ((UINTN) (ImageContext.ImageSize + ImageContext.SectionAlignment));
+ Pages = EFI_SIZE_TO_PAGES ((UINTN)(ImageContext.ImageSize + ImageContext.SectionAlignment));
} else {
- Pages = EFI_SIZE_TO_PAGES ((UINTN) ImageContext.ImageSize);
+ Pages = EFI_SIZE_TO_PAGES ((UINTN)ImageContext.ImageSize);
}
+
FfsBuffer = 0xFFFFFFFF;
- Status = gBS->AllocatePages (
- AllocateMaxAddress,
- EfiBootServicesCode,
- Pages,
- &FfsBuffer
- );
+ Status = gBS->AllocatePages (
+ AllocateMaxAddress,
+ EfiBootServicesCode,
+ Pages,
+ &FfsBuffer
+ );
ASSERT_EFI_ERROR (Status);
ImageContext.ImageAddress = (PHYSICAL_ADDRESS)(UINTN)FfsBuffer;
//
@@ -132,7 +133,7 @@ RelocateImageUnder4GIfNeeded ( InvalidateInstructionCacheRange ((VOID *)(UINTN)ImageContext.ImageAddress, (UINTN)ImageContext.ImageSize);
DEBUG ((DEBUG_INFO, "Loading driver at 0x%08x EntryPoint=0x%08x\n", (UINTN)ImageContext.ImageAddress, (UINTN)ImageContext.EntryPoint));
- Status = ((EFI_IMAGE_ENTRY_POINT)(UINTN)(ImageContext.EntryPoint)) (NewImageHandle, gST);
+ Status = ((EFI_IMAGE_ENTRY_POINT)(UINTN)(ImageContext.EntryPoint))(NewImageHandle, gST);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "Error: Image at 0x%08x start failed: %r\n", ImageContext.ImageAddress, Status));
gBS->FreePages (FfsBuffer, Pages);
diff --git a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c index 24ab534..287e7f9 100644 --- a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c +++ b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c @@ -8,7 +8,6 @@ **/
-
#include <PiPei.h>
#include <Library/PeimEntryPoint.h>
@@ -37,7 +36,7 @@ #include <FspEas.h>
#include <FspStatusCode.h>
-extern EFI_GUID gFspHobGuid;
+extern EFI_GUID gFspHobGuid;
/**
Call FspMemoryInit API.
@@ -49,26 +48,26 @@ PeiFspMemoryInit ( VOID
)
{
- FSP_INFO_HEADER *FspmHeaderPtr;
- EFI_STATUS Status;
- UINT64 TimeStampCounterStart;
- VOID *FspHobListPtr;
- VOID *HobData;
- FSPM_UPD_COMMON *FspmUpdDataPtr;
- UINTN *SourceData;
+ FSP_INFO_HEADER *FspmHeaderPtr;
+ EFI_STATUS Status;
+ UINT64 TimeStampCounterStart;
+ VOID *FspHobListPtr;
+ VOID *HobData;
+ FSPM_UPD_COMMON *FspmUpdDataPtr;
+ UINTN *SourceData;
DEBUG ((DEBUG_INFO, "PeiFspMemoryInit enter\n"));
- FspHobListPtr = NULL;
+ FspHobListPtr = NULL;
FspmUpdDataPtr = NULL;
- FspmHeaderPtr = (FSP_INFO_HEADER *) FspFindFspHeader (PcdGet32 (PcdFspmBaseAddress));
+ FspmHeaderPtr = (FSP_INFO_HEADER *)FspFindFspHeader (PcdGet32 (PcdFspmBaseAddress));
DEBUG ((DEBUG_INFO, "FspmHeaderPtr - 0x%x\n", FspmHeaderPtr));
if (FspmHeaderPtr == NULL) {
return EFI_DEVICE_ERROR;
}
- if (PcdGet32 (PcdFspmUpdDataAddress) == 0 && (FspmHeaderPtr->CfgRegionSize != 0) && (FspmHeaderPtr->CfgRegionOffset != 0)) {
+ if ((PcdGet32 (PcdFspmUpdDataAddress) == 0) && (FspmHeaderPtr->CfgRegionSize != 0) && (FspmHeaderPtr->CfgRegionOffset != 0)) {
//
// Copy default FSP-M UPD data from Flash
//
@@ -94,26 +93,26 @@ PeiFspMemoryInit ( DEBUG ((DEBUG_INFO, " HobListPtr - 0x%x\n", &FspHobListPtr));
TimeStampCounterStart = AsmReadTsc ();
- Status = CallFspMemoryInit (FspmUpdDataPtr, &FspHobListPtr);
+ Status = CallFspMemoryInit (FspmUpdDataPtr, &FspHobListPtr);
// Create hobs after memory initialization and not in temp RAM. Hence passing the recorded timestamp here
- PERF_START_EX(&gFspApiPerformanceGuid, "EventRec", NULL, TimeStampCounterStart, FSP_STATUS_CODE_MEMORY_INIT | FSP_STATUS_CODE_COMMON_CODE | FSP_STATUS_CODE_API_ENTRY);
- PERF_END_EX(&gFspApiPerformanceGuid, "EventRec", NULL, 0, FSP_STATUS_CODE_MEMORY_INIT | FSP_STATUS_CODE_COMMON_CODE | FSP_STATUS_CODE_API_EXIT);
+ PERF_START_EX (&gFspApiPerformanceGuid, "EventRec", NULL, TimeStampCounterStart, FSP_STATUS_CODE_MEMORY_INIT | FSP_STATUS_CODE_COMMON_CODE | FSP_STATUS_CODE_API_ENTRY);
+ PERF_END_EX (&gFspApiPerformanceGuid, "EventRec", NULL, 0, FSP_STATUS_CODE_MEMORY_INIT | FSP_STATUS_CODE_COMMON_CODE | FSP_STATUS_CODE_API_EXIT);
DEBUG ((DEBUG_INFO, "Total time spent executing FspMemoryInitApi: %d millisecond\n", DivU64x32 (GetTimeInNanoSecond (AsmReadTsc () - TimeStampCounterStart), 1000000)));
//
// Reset the system if FSP API returned FSP_STATUS_RESET_REQUIRED status
//
if ((Status >= FSP_STATUS_RESET_REQUIRED_COLD) && (Status <= FSP_STATUS_RESET_REQUIRED_8)) {
- DEBUG((DEBUG_INFO, "FspMemoryInitApi requested reset 0x%x\n", Status));
+ DEBUG ((DEBUG_INFO, "FspMemoryInitApi requested reset 0x%x\n", Status));
CallFspWrapperResetSystem ((UINT32)Status);
}
- if (EFI_ERROR(Status)) {
+ if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "ERROR - Failed to execute FspMemoryInitApi(), Status = %r\n", Status));
}
- DEBUG((DEBUG_INFO, "FspMemoryInit status: 0x%x\n", Status));
- ASSERT_EFI_ERROR (Status);
+ DEBUG ((DEBUG_INFO, "FspMemoryInit status: 0x%x\n", Status));
+ ASSERT_EFI_ERROR (Status);
Status = TestFspMemoryInitApiOutput (FspmUpdDataPtr, &FspHobListPtr);
if (EFI_ERROR (Status)) {
@@ -130,9 +129,9 @@ PeiFspMemoryInit ( // Save FspHobList pointer to hob, so that it can be got later
//
HobData = BuildGuidHob (
- &gFspHobGuid,
- sizeof (VOID *)
- );
+ &gFspHobGuid,
+ sizeof (VOID *)
+ );
ASSERT (HobData != NULL);
CopyMem (HobData, &FspHobListPtr, sizeof (FspHobListPtr));
@@ -150,18 +149,18 @@ FspmWrapperInit ( VOID
)
{
- EFI_STATUS Status;
- EFI_PEI_FIRMWARE_VOLUME_INFO_MEASUREMENT_EXCLUDED_PPI *MeasurementExcludedFvPpi;
- EFI_PEI_PPI_DESCRIPTOR *MeasurementExcludedPpiList;
-
- MeasurementExcludedFvPpi = AllocatePool (sizeof(*MeasurementExcludedFvPpi));
- ASSERT(MeasurementExcludedFvPpi != NULL);
- MeasurementExcludedFvPpi->Count = 1;
- MeasurementExcludedFvPpi->Fv[0].FvBase = PcdGet32 (PcdFspmBaseAddress);
- MeasurementExcludedFvPpi->Fv[0].FvLength = ((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 (PcdFspmBaseAddress))->FvLength;
-
- MeasurementExcludedPpiList = AllocatePool (sizeof(*MeasurementExcludedPpiList));
- ASSERT(MeasurementExcludedPpiList != NULL);
+ EFI_STATUS Status;
+ EFI_PEI_FIRMWARE_VOLUME_INFO_MEASUREMENT_EXCLUDED_PPI *MeasurementExcludedFvPpi;
+ EFI_PEI_PPI_DESCRIPTOR *MeasurementExcludedPpiList;
+
+ MeasurementExcludedFvPpi = AllocatePool (sizeof (*MeasurementExcludedFvPpi));
+ ASSERT (MeasurementExcludedFvPpi != NULL);
+ MeasurementExcludedFvPpi->Count = 1;
+ MeasurementExcludedFvPpi->Fv[0].FvBase = PcdGet32 (PcdFspmBaseAddress);
+ MeasurementExcludedFvPpi->Fv[0].FvLength = ((EFI_FIRMWARE_VOLUME_HEADER *)(UINTN)PcdGet32 (PcdFspmBaseAddress))->FvLength;
+
+ MeasurementExcludedPpiList = AllocatePool (sizeof (*MeasurementExcludedPpiList));
+ ASSERT (MeasurementExcludedPpiList != NULL);
MeasurementExcludedPpiList->Flags = EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST;
MeasurementExcludedPpiList->Guid = &gEfiPeiFirmwareVolumeInfoMeasurementExcludedPpiGuid;
MeasurementExcludedPpiList->Ppi = MeasurementExcludedFvPpi;
@@ -177,8 +176,8 @@ FspmWrapperInit ( PeiServicesInstallFvInfoPpi (
NULL,
- (VOID *)(UINTN) PcdGet32 (PcdFspmBaseAddress),
- (UINT32)((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 (PcdFspmBaseAddress))->FvLength,
+ (VOID *)(UINTN)PcdGet32 (PcdFspmBaseAddress),
+ (UINT32)((EFI_FIRMWARE_VOLUME_HEADER *)(UINTN)PcdGet32 (PcdFspmBaseAddress))->FvLength,
NULL,
NULL
);
@@ -200,12 +199,12 @@ FspmWrapperInit ( EFI_STATUS
EFIAPI
TcgPpiNotify (
- IN EFI_PEI_SERVICES **PeiServices,
- IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,
- IN VOID *Ppi
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,
+ IN VOID *Ppi
);
-EFI_PEI_NOTIFY_DESCRIPTOR mTcgPpiNotifyDesc = {
+EFI_PEI_NOTIFY_DESCRIPTOR mTcgPpiNotifyDesc = {
(EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
&gEdkiiTcgPpiGuid,
TcgPpiNotify
@@ -224,25 +223,33 @@ EFI_PEI_NOTIFY_DESCRIPTOR mTcgPpiNotifyDesc = { EFI_STATUS
EFIAPI
TcgPpiNotify (
- IN EFI_PEI_SERVICES **PeiServices,
- IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,
- IN VOID *Ppi
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,
+ IN VOID *Ppi
)
{
- UINT32 FspMeasureMask;
+ UINT32 FspMeasureMask;
DEBUG ((DEBUG_INFO, "TcgPpiNotify FSPM\n"));
FspMeasureMask = PcdGet32 (PcdFspMeasurementConfig);
if ((FspMeasureMask & FSP_MEASURE_FSPT) != 0) {
- MeasureFspFirmwareBlob (0, "FSPT", PcdGet32(PcdFsptBaseAddress),
- (UINT32)((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 (PcdFsptBaseAddress))->FvLength);
+ MeasureFspFirmwareBlob (
+ 0,
+ "FSPT",
+ PcdGet32 (PcdFsptBaseAddress),
+ (UINT32)((EFI_FIRMWARE_VOLUME_HEADER *)(UINTN)PcdGet32 (PcdFsptBaseAddress))->FvLength
+ );
}
if ((FspMeasureMask & FSP_MEASURE_FSPM) != 0) {
- MeasureFspFirmwareBlob (0, "FSPM", PcdGet32(PcdFspmBaseAddress),
- (UINT32)((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 (PcdFspmBaseAddress))->FvLength);
+ MeasureFspFirmwareBlob (
+ 0,
+ "FSPM",
+ PcdGet32 (PcdFspmBaseAddress),
+ (UINT32)((EFI_FIRMWARE_VOLUME_HEADER *)(UINTN)PcdGet32 (PcdFspmBaseAddress))->FvLength
+ );
}
return EFI_SUCCESS;
@@ -265,7 +272,7 @@ FspmWrapperPeimEntryPoint ( {
EFI_STATUS Status;
- DEBUG((DEBUG_INFO, "FspmWrapperPeimEntryPoint\n"));
+ DEBUG ((DEBUG_INFO, "FspmWrapperPeimEntryPoint\n"));
Status = PeiServicesNotifyPpi (&mTcgPpiNotifyDesc);
ASSERT_EFI_ERROR (Status);
diff --git a/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c b/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c index 9d4f279..f7459a9 100644 --- a/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c +++ b/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c @@ -37,8 +37,8 @@ #include <FspEas.h>
#include <FspStatusCode.h>
-extern EFI_PEI_NOTIFY_DESCRIPTOR mS3EndOfPeiNotifyDesc;
-extern EFI_GUID gFspHobGuid;
+extern EFI_PEI_NOTIFY_DESCRIPTOR mS3EndOfPeiNotifyDesc;
+extern EFI_GUID gFspHobGuid;
/**
This function handles S3 resume task at the end of PEI.
@@ -52,13 +52,13 @@ extern EFI_GUID gFspHobGuid; **/
EFI_STATUS
EFIAPI
-S3EndOfPeiNotify(
- IN EFI_PEI_SERVICES **PeiServices,
- IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,
- IN VOID *Ppi
+S3EndOfPeiNotify (
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,
+ IN VOID *Ppi
);
-EFI_PEI_NOTIFY_DESCRIPTOR mS3EndOfPeiNotifyDesc = {
+EFI_PEI_NOTIFY_DESCRIPTOR mS3EndOfPeiNotifyDesc = {
(EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
&gEfiEndOfPeiSignalPpiGuid,
S3EndOfPeiNotify
@@ -76,50 +76,50 @@ EFI_PEI_NOTIFY_DESCRIPTOR mS3EndOfPeiNotifyDesc = { **/
EFI_STATUS
EFIAPI
-S3EndOfPeiNotify(
- IN EFI_PEI_SERVICES **PeiServices,
- IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,
- IN VOID *Ppi
+S3EndOfPeiNotify (
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,
+ IN VOID *Ppi
)
{
- NOTIFY_PHASE_PARAMS NotifyPhaseParams;
- EFI_STATUS Status;
+ NOTIFY_PHASE_PARAMS NotifyPhaseParams;
+ EFI_STATUS Status;
- DEBUG((DEBUG_INFO, "S3EndOfPeiNotify enter\n"));
+ DEBUG ((DEBUG_INFO, "S3EndOfPeiNotify enter\n"));
NotifyPhaseParams.Phase = EnumInitPhaseAfterPciEnumeration;
- Status = CallFspNotifyPhase (&NotifyPhaseParams);
- DEBUG((DEBUG_INFO, "FSP S3NotifyPhase AfterPciEnumeration status: 0x%x\n", Status));
+ Status = CallFspNotifyPhase (&NotifyPhaseParams);
+ DEBUG ((DEBUG_INFO, "FSP S3NotifyPhase AfterPciEnumeration status: 0x%x\n", Status));
//
// Reset the system if FSP API returned FSP_STATUS_RESET_REQUIRED status
//
if ((Status >= FSP_STATUS_RESET_REQUIRED_COLD) && (Status <= FSP_STATUS_RESET_REQUIRED_8)) {
- DEBUG((DEBUG_INFO, "FSP S3NotifyPhase AfterPciEnumeration requested reset 0x%x\n", Status));
+ DEBUG ((DEBUG_INFO, "FSP S3NotifyPhase AfterPciEnumeration requested reset 0x%x\n", Status));
CallFspWrapperResetSystem ((UINT32)Status);
}
NotifyPhaseParams.Phase = EnumInitPhaseReadyToBoot;
- Status = CallFspNotifyPhase (&NotifyPhaseParams);
- DEBUG((DEBUG_INFO, "FSP S3NotifyPhase ReadyToBoot status: 0x%x\n", Status));
+ Status = CallFspNotifyPhase (&NotifyPhaseParams);
+ DEBUG ((DEBUG_INFO, "FSP S3NotifyPhase ReadyToBoot status: 0x%x\n", Status));
//
// Reset the system if FSP API returned FSP_STATUS_RESET_REQUIRED status
//
if ((Status >= FSP_STATUS_RESET_REQUIRED_COLD) && (Status <= FSP_STATUS_RESET_REQUIRED_8)) {
- DEBUG((DEBUG_INFO, "FSP S3NotifyPhase ReadyToBoot requested reset 0x%x\n", Status));
+ DEBUG ((DEBUG_INFO, "FSP S3NotifyPhase ReadyToBoot requested reset 0x%x\n", Status));
CallFspWrapperResetSystem ((UINT32)Status);
}
NotifyPhaseParams.Phase = EnumInitPhaseEndOfFirmware;
- Status = CallFspNotifyPhase (&NotifyPhaseParams);
- DEBUG((DEBUG_INFO, "FSP S3NotifyPhase EndOfFirmware status: 0x%x\n", Status));
+ Status = CallFspNotifyPhase (&NotifyPhaseParams);
+ DEBUG ((DEBUG_INFO, "FSP S3NotifyPhase EndOfFirmware status: 0x%x\n", Status));
//
// Reset the system if FSP API returned FSP_STATUS_RESET_REQUIRED status
//
if ((Status >= FSP_STATUS_RESET_REQUIRED_COLD) && (Status <= FSP_STATUS_RESET_REQUIRED_8)) {
- DEBUG((DEBUG_INFO, "FSP S3NotifyPhase EndOfFirmware requested reset 0x%x\n", Status));
+ DEBUG ((DEBUG_INFO, "FSP S3NotifyPhase EndOfFirmware requested reset 0x%x\n", Status));
CallFspWrapperResetSystem ((UINT32)Status);
}
@@ -138,16 +138,16 @@ S3EndOfPeiNotify( EFI_STATUS
EFIAPI
FspSiliconInitDoneGetFspHobList (
- IN CONST EFI_PEI_SERVICES **PeiServices,
- IN FSP_SILICON_INIT_DONE_PPI *This,
- OUT VOID **FspHobList
+ IN CONST EFI_PEI_SERVICES **PeiServices,
+ IN FSP_SILICON_INIT_DONE_PPI *This,
+ OUT VOID **FspHobList
);
-FSP_SILICON_INIT_DONE_PPI mFspSiliconInitDonePpi = {
+FSP_SILICON_INIT_DONE_PPI mFspSiliconInitDonePpi = {
FspSiliconInitDoneGetFspHobList
};
-EFI_PEI_PPI_DESCRIPTOR mPeiFspSiliconInitDonePpi = {
+EFI_PEI_PPI_DESCRIPTOR mPeiFspSiliconInitDonePpi = {
EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST,
&gFspSiliconInitDonePpiGuid,
&mFspSiliconInitDonePpi
@@ -165,16 +165,16 @@ EFI_PEI_PPI_DESCRIPTOR mPeiFspSiliconInitDonePpi = { EFI_STATUS
EFIAPI
FspSiliconInitDoneGetFspHobList (
- IN CONST EFI_PEI_SERVICES **PeiServices,
- IN FSP_SILICON_INIT_DONE_PPI *This,
- OUT VOID **FspHobList
+ IN CONST EFI_PEI_SERVICES **PeiServices,
+ IN FSP_SILICON_INIT_DONE_PPI *This,
+ OUT VOID **FspHobList
)
{
- EFI_HOB_GUID_TYPE *GuidHob;
+ EFI_HOB_GUID_TYPE *GuidHob;
GuidHob = GetFirstGuidHob (&gFspHobGuid);
if (GuidHob != NULL) {
- *FspHobList = *(VOID **)GET_GUID_HOB_DATA(GuidHob);
+ *FspHobList = *(VOID **)GET_GUID_HOB_DATA (GuidHob);
return EFI_SUCCESS;
} else {
return EFI_NOT_FOUND;
@@ -194,9 +194,9 @@ FspSiliconInitDoneGetFspHobList ( EFI_STATUS
EFIAPI
FspsWrapperEndOfPeiNotify (
- IN EFI_PEI_SERVICES **PeiServices,
- IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,
- IN VOID *Ppi
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,
+ IN VOID *Ppi
)
{
EFI_STATUS Status;
@@ -213,12 +213,12 @@ FspsWrapperEndOfPeiNotify ( // Install FspSiliconInitDonePpi so that any other driver can consume this info.
//
Status = PeiServicesInstallPpi (&mPeiFspSiliconInitDonePpi);
- ASSERT_EFI_ERROR(Status);
+ ASSERT_EFI_ERROR (Status);
return Status;
}
-EFI_PEI_NOTIFY_DESCRIPTOR mFspsWrapperEndOfPeiNotifyDesc = {
+EFI_PEI_NOTIFY_DESCRIPTOR mFspsWrapperEndOfPeiNotifyDesc = {
(EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
&gEfiEndOfPeiSignalPpiGuid,
FspsWrapperEndOfPeiNotify
@@ -237,12 +237,12 @@ EFI_PEI_NOTIFY_DESCRIPTOR mFspsWrapperEndOfPeiNotifyDesc = { EFI_STATUS
EFIAPI
PeiMemoryDiscoveredNotify (
- IN EFI_PEI_SERVICES **PeiServices,
- IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,
- IN VOID *Ppi
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,
+ IN VOID *Ppi
);
-EFI_PEI_NOTIFY_DESCRIPTOR mPeiMemoryDiscoveredNotifyDesc = {
+EFI_PEI_NOTIFY_DESCRIPTOR mPeiMemoryDiscoveredNotifyDesc = {
(EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
&gEfiPeiMemoryDiscoveredPpiGuid,
PeiMemoryDiscoveredNotify
@@ -261,18 +261,18 @@ EFI_PEI_NOTIFY_DESCRIPTOR mPeiMemoryDiscoveredNotifyDesc = { EFI_STATUS
EFIAPI
PeiMemoryDiscoveredNotify (
- IN EFI_PEI_SERVICES **PeiServices,
- IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,
- IN VOID *Ppi
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,
+ IN VOID *Ppi
)
{
- FSP_INFO_HEADER *FspsHeaderPtr;
- UINT64 TimeStampCounterStart;
- EFI_STATUS Status;
- VOID *FspHobListPtr;
- EFI_HOB_GUID_TYPE *GuidHob;
- FSPS_UPD_COMMON *FspsUpdDataPtr;
- UINTN *SourceData;
+ FSP_INFO_HEADER *FspsHeaderPtr;
+ UINT64 TimeStampCounterStart;
+ EFI_STATUS Status;
+ VOID *FspHobListPtr;
+ EFI_HOB_GUID_TYPE *GuidHob;
+ FSPS_UPD_COMMON *FspsUpdDataPtr;
+ UINTN *SourceData;
DEBUG ((DEBUG_INFO, "PeiMemoryDiscoveredNotify enter\n"));
FspsUpdDataPtr = NULL;
@@ -283,7 +283,7 @@ PeiMemoryDiscoveredNotify ( return EFI_DEVICE_ERROR;
}
- if (PcdGet32 (PcdFspsUpdDataAddress) == 0 && (FspsHeaderPtr->CfgRegionSize != 0) && (FspsHeaderPtr->CfgRegionOffset != 0)) {
+ if ((PcdGet32 (PcdFspsUpdDataAddress) == 0) && (FspsHeaderPtr->CfgRegionSize != 0) && (FspsHeaderPtr->CfgRegionOffset != 0)) {
//
// Copy default FSP-S UPD data from Flash
//
@@ -299,23 +299,24 @@ PeiMemoryDiscoveredNotify ( UpdateFspsUpdData ((VOID *)FspsUpdDataPtr);
TimeStampCounterStart = AsmReadTsc ();
- PERF_START_EX(&gFspApiPerformanceGuid, "EventRec", NULL, 0, FSP_STATUS_CODE_SILICON_INIT | FSP_STATUS_CODE_COMMON_CODE | FSP_STATUS_CODE_API_ENTRY);
+ PERF_START_EX (&gFspApiPerformanceGuid, "EventRec", NULL, 0, FSP_STATUS_CODE_SILICON_INIT | FSP_STATUS_CODE_COMMON_CODE | FSP_STATUS_CODE_API_ENTRY);
Status = CallFspSiliconInit ((VOID *)FspsUpdDataPtr);
- PERF_END_EX(&gFspApiPerformanceGuid, "EventRec", NULL, 0, FSP_STATUS_CODE_SILICON_INIT | FSP_STATUS_CODE_COMMON_CODE | FSP_STATUS_CODE_API_EXIT);
+ PERF_END_EX (&gFspApiPerformanceGuid, "EventRec", NULL, 0, FSP_STATUS_CODE_SILICON_INIT | FSP_STATUS_CODE_COMMON_CODE | FSP_STATUS_CODE_API_EXIT);
DEBUG ((DEBUG_INFO, "Total time spent executing FspSiliconInitApi: %d millisecond\n", DivU64x32 (GetTimeInNanoSecond (AsmReadTsc () - TimeStampCounterStart), 1000000)));
//
// Reset the system if FSP API returned FSP_STATUS_RESET_REQUIRED status
//
if ((Status >= FSP_STATUS_RESET_REQUIRED_COLD) && (Status <= FSP_STATUS_RESET_REQUIRED_8)) {
- DEBUG((DEBUG_INFO, "FspSiliconInitApi requested reset 0x%x\n", Status));
+ DEBUG ((DEBUG_INFO, "FspSiliconInitApi requested reset 0x%x\n", Status));
CallFspWrapperResetSystem ((UINT32)Status);
}
- if (EFI_ERROR(Status)) {
+ if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "ERROR - Failed to execute FspSiliconInitApi(), Status = %r\n", Status));
}
- DEBUG((DEBUG_INFO, "FspSiliconInit status: 0x%x\n", Status));
+
+ DEBUG ((DEBUG_INFO, "FspSiliconInit status: 0x%x\n", Status));
ASSERT_EFI_ERROR (Status);
Status = TestFspSiliconInitApiOutput ((VOID *)NULL);
@@ -336,7 +337,7 @@ PeiMemoryDiscoveredNotify ( // Install FspSiliconInitDonePpi so that any other driver can consume this info.
//
Status = PeiServicesInstallPpi (&mPeiFspSiliconInitDonePpi);
- ASSERT_EFI_ERROR(Status);
+ ASSERT_EFI_ERROR (Status);
return Status;
}
@@ -351,8 +352,8 @@ FspsWrapperInitApiMode ( VOID
)
{
- EFI_STATUS Status;
- EFI_BOOT_MODE BootMode;
+ EFI_STATUS Status;
+ EFI_BOOT_MODE BootMode;
//
// Register MemoryDiscovered Notify to run FspSiliconInit
@@ -382,18 +383,18 @@ FspsWrapperInitDispatchMode ( VOID
)
{
- EFI_STATUS Status;
- EFI_PEI_FIRMWARE_VOLUME_INFO_MEASUREMENT_EXCLUDED_PPI *MeasurementExcludedFvPpi;
- EFI_PEI_PPI_DESCRIPTOR *MeasurementExcludedPpiList;
-
- MeasurementExcludedFvPpi = AllocatePool (sizeof(*MeasurementExcludedFvPpi));
- ASSERT(MeasurementExcludedFvPpi != NULL);
- MeasurementExcludedFvPpi->Count = 1;
- MeasurementExcludedFvPpi->Fv[0].FvBase = PcdGet32 (PcdFspsBaseAddress);
- MeasurementExcludedFvPpi->Fv[0].FvLength = ((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 (PcdFspsBaseAddress))->FvLength;
-
- MeasurementExcludedPpiList = AllocatePool (sizeof(*MeasurementExcludedPpiList));
- ASSERT(MeasurementExcludedPpiList != NULL);
+ EFI_STATUS Status;
+ EFI_PEI_FIRMWARE_VOLUME_INFO_MEASUREMENT_EXCLUDED_PPI *MeasurementExcludedFvPpi;
+ EFI_PEI_PPI_DESCRIPTOR *MeasurementExcludedPpiList;
+
+ MeasurementExcludedFvPpi = AllocatePool (sizeof (*MeasurementExcludedFvPpi));
+ ASSERT (MeasurementExcludedFvPpi != NULL);
+ MeasurementExcludedFvPpi->Count = 1;
+ MeasurementExcludedFvPpi->Fv[0].FvBase = PcdGet32 (PcdFspsBaseAddress);
+ MeasurementExcludedFvPpi->Fv[0].FvLength = ((EFI_FIRMWARE_VOLUME_HEADER *)(UINTN)PcdGet32 (PcdFspsBaseAddress))->FvLength;
+
+ MeasurementExcludedPpiList = AllocatePool (sizeof (*MeasurementExcludedPpiList));
+ ASSERT (MeasurementExcludedPpiList != NULL);
MeasurementExcludedPpiList->Flags = EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST;
MeasurementExcludedPpiList->Guid = &gEfiPeiFirmwareVolumeInfoMeasurementExcludedPpiGuid;
MeasurementExcludedPpiList->Ppi = MeasurementExcludedFvPpi;
@@ -406,8 +407,8 @@ FspsWrapperInitDispatchMode ( //
PeiServicesInstallFvInfoPpi (
NULL,
- (VOID *)(UINTN) PcdGet32 (PcdFspsBaseAddress),
- (UINT32)((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 (PcdFspsBaseAddress))->FvLength,
+ (VOID *)(UINTN)PcdGet32 (PcdFspsBaseAddress),
+ (UINT32)((EFI_FIRMWARE_VOLUME_HEADER *)(UINTN)PcdGet32 (PcdFspsBaseAddress))->FvLength,
NULL,
NULL
);
@@ -432,12 +433,12 @@ FspsWrapperInitDispatchMode ( EFI_STATUS
EFIAPI
TcgPpiNotify (
- IN EFI_PEI_SERVICES **PeiServices,
- IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,
- IN VOID *Ppi
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,
+ IN VOID *Ppi
);
-EFI_PEI_NOTIFY_DESCRIPTOR mTcgPpiNotifyDesc = {
+EFI_PEI_NOTIFY_DESCRIPTOR mTcgPpiNotifyDesc = {
(EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
&gEdkiiTcgPpiGuid,
TcgPpiNotify
@@ -456,20 +457,24 @@ EFI_PEI_NOTIFY_DESCRIPTOR mTcgPpiNotifyDesc = { EFI_STATUS
EFIAPI
TcgPpiNotify (
- IN EFI_PEI_SERVICES **PeiServices,
- IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,
- IN VOID *Ppi
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,
+ IN VOID *Ppi
)
{
- UINT32 FspMeasureMask;
+ UINT32 FspMeasureMask;
DEBUG ((DEBUG_INFO, "TcgPpiNotify FSPS\n"));
FspMeasureMask = PcdGet32 (PcdFspMeasurementConfig);
if ((FspMeasureMask & FSP_MEASURE_FSPS) != 0) {
- MeasureFspFirmwareBlob (0, "FSPS", PcdGet32(PcdFspsBaseAddress),
- (UINT32)((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 (PcdFspsBaseAddress))->FvLength);
+ MeasureFspFirmwareBlob (
+ 0,
+ "FSPS",
+ PcdGet32 (PcdFspsBaseAddress),
+ (UINT32)((EFI_FIRMWARE_VOLUME_HEADER *)(UINTN)PcdGet32 (PcdFspsBaseAddress))->FvLength
+ );
}
return EFI_SUCCESS;
diff --git a/IntelFsp2WrapperPkg/Include/Library/FspMeasurementLib.h b/IntelFsp2WrapperPkg/Include/Library/FspMeasurementLib.h index 4620b4b..db599cc 100644 --- a/IntelFsp2WrapperPkg/Include/Library/FspMeasurementLib.h +++ b/IntelFsp2WrapperPkg/Include/Library/FspMeasurementLib.h @@ -9,11 +9,11 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #ifndef _FSP_MEASUREMENT_LIB_H_
#define _FSP_MEASUREMENT_LIB_H_
-#define FSP_MEASURE_FSP BIT0
-#define FSP_MEASURE_FSPT BIT1
-#define FSP_MEASURE_FSPM BIT2
-#define FSP_MEASURE_FSPS BIT3
-#define FSP_MEASURE_FSPUPD BIT31
+#define FSP_MEASURE_FSP BIT0
+#define FSP_MEASURE_FSPT BIT1
+#define FSP_MEASURE_FSPM BIT2
+#define FSP_MEASURE_FSPS BIT3
+#define FSP_MEASURE_FSPUPD BIT31
/**
Measure a FSP FirmwareBlob.
@@ -31,9 +31,10 @@ SPDX-License-Identifier: BSD-2-Clause-Patent EFI_STATUS
EFIAPI
MeasureFspFirmwareBlob (
- IN UINT32 PcrIndex,
- IN CHAR8 *Description OPTIONAL,
- IN EFI_PHYSICAL_ADDRESS FirmwareBlobBase,
- IN UINT64 FirmwareBlobLength
+ IN UINT32 PcrIndex,
+ IN CHAR8 *Description OPTIONAL,
+ IN EFI_PHYSICAL_ADDRESS FirmwareBlobBase,
+ IN UINT64 FirmwareBlobLength
);
+
#endif
diff --git a/IntelFsp2WrapperPkg/Include/Library/FspWrapperApiLib.h b/IntelFsp2WrapperPkg/Include/Library/FspWrapperApiLib.h index 11a3faa..d38582d 100644 --- a/IntelFsp2WrapperPkg/Include/Library/FspWrapperApiLib.h +++ b/IntelFsp2WrapperPkg/Include/Library/FspWrapperApiLib.h @@ -34,7 +34,7 @@ FspFindFspHeader ( EFI_STATUS
EFIAPI
CallFspNotifyPhase (
- IN NOTIFY_PHASE_PARAMS *NotifyPhaseParams
+ IN NOTIFY_PHASE_PARAMS *NotifyPhaseParams
);
/**
@@ -48,8 +48,8 @@ CallFspNotifyPhase ( EFI_STATUS
EFIAPI
CallFspMemoryInit (
- IN VOID *FspmUpdDataPtr,
- OUT VOID **HobListPtr
+ IN VOID *FspmUpdDataPtr,
+ OUT VOID **HobListPtr
);
/**
@@ -62,7 +62,7 @@ CallFspMemoryInit ( EFI_STATUS
EFIAPI
CallTempRamExit (
- IN VOID *TempRamExitParam
+ IN VOID *TempRamExitParam
);
/**
@@ -75,7 +75,7 @@ CallTempRamExit ( EFI_STATUS
EFIAPI
CallFspSiliconInit (
- IN VOID *FspsUpdDataPtr
+ IN VOID *FspsUpdDataPtr
);
#endif
diff --git a/IntelFsp2WrapperPkg/Include/Library/FspWrapperApiTestLib.h b/IntelFsp2WrapperPkg/Include/Library/FspWrapperApiTestLib.h index 62bb73b..2ff2d0c 100644 --- a/IntelFsp2WrapperPkg/Include/Library/FspWrapperApiTestLib.h +++ b/IntelFsp2WrapperPkg/Include/Library/FspWrapperApiTestLib.h @@ -22,8 +22,8 @@ EFI_STATUS
EFIAPI
TestFspMemoryInitApiOutput (
- IN VOID *FspmUpdDataPtr,
- IN VOID **HobListPtr
+ IN VOID *FspmUpdDataPtr,
+ IN VOID **HobListPtr
);
/**
@@ -36,7 +36,7 @@ TestFspMemoryInitApiOutput ( EFI_STATUS
EFIAPI
TestFspTempRamExitApiOutput (
- IN VOID *TempRamExitParam
+ IN VOID *TempRamExitParam
);
/**
@@ -49,7 +49,7 @@ TestFspTempRamExitApiOutput ( EFI_STATUS
EFIAPI
TestFspSiliconInitApiOutput (
- IN VOID *FspsUpdDataPtr
+ IN VOID *FspsUpdDataPtr
);
#endif
diff --git a/IntelFsp2WrapperPkg/Include/Library/FspWrapperHobProcessLib.h b/IntelFsp2WrapperPkg/Include/Library/FspWrapperHobProcessLib.h index 6df9223..c91dbb5 100644 --- a/IntelFsp2WrapperPkg/Include/Library/FspWrapperHobProcessLib.h +++ b/IntelFsp2WrapperPkg/Include/Library/FspWrapperHobProcessLib.h @@ -19,7 +19,7 @@ EFI_STATUS
EFIAPI
PostFspmHobProcess (
- IN VOID *FspHobList
+ IN VOID *FspHobList
);
/**
@@ -32,7 +32,7 @@ PostFspmHobProcess ( EFI_STATUS
EFIAPI
PostFspsHobProcess (
- IN VOID *FspHobList
+ IN VOID *FspHobList
);
#endif
diff --git a/IntelFsp2WrapperPkg/Include/Library/FspWrapperPlatformLib.h b/IntelFsp2WrapperPkg/Include/Library/FspWrapperPlatformLib.h index 2aa14c9..a6ade25 100644 --- a/IntelFsp2WrapperPkg/Include/Library/FspWrapperPlatformLib.h +++ b/IntelFsp2WrapperPkg/Include/Library/FspWrapperPlatformLib.h @@ -18,7 +18,7 @@ VOID
EFIAPI
UpdateFspmUpdData (
- IN OUT VOID *FspUpdRgnPtr
+ IN OUT VOID *FspUpdRgnPtr
);
/**
@@ -30,7 +30,7 @@ UpdateFspmUpdData ( VOID
EFIAPI
UpdateFspsUpdData (
- IN OUT VOID *FspUpdRgnPtr
+ IN OUT VOID *FspUpdRgnPtr
);
/**
@@ -60,8 +60,8 @@ UpdateTempRamExitParam ( EFI_STATUS
EFIAPI
GetS3MemoryInfo (
- OUT UINT64 *S3PeiMemSize,
- OUT EFI_PHYSICAL_ADDRESS *S3PeiMemBase
+ OUT UINT64 *S3PeiMemSize,
+ OUT EFI_PHYSICAL_ADDRESS *S3PeiMemBase
);
/**
@@ -74,7 +74,7 @@ GetS3MemoryInfo ( VOID
EFIAPI
CallFspWrapperResetSystem (
- IN UINT32 FspStatusResetType
+ IN UINT32 FspStatusResetType
);
#endif
diff --git a/IntelFsp2WrapperPkg/Include/Ppi/FspSiliconInitDone.h b/IntelFsp2WrapperPkg/Include/Ppi/FspSiliconInitDone.h index 0067339..addd86c 100644 --- a/IntelFsp2WrapperPkg/Include/Ppi/FspSiliconInitDone.h +++ b/IntelFsp2WrapperPkg/Include/Ppi/FspSiliconInitDone.h @@ -9,7 +9,7 @@ #ifndef _FSP_SILICON_INIT_DONE_H_
#define _FSP_SILICON_INIT_DONE_H_
-typedef struct _FSP_SILICON_INIT_DONE_PPI FSP_SILICON_INIT_DONE_PPI;
+typedef struct _FSP_SILICON_INIT_DONE_PPI FSP_SILICON_INIT_DONE_PPI;
/**
Return Hob list produced by FSP.
@@ -29,9 +29,9 @@ EFI_STATUS );
struct _FSP_SILICON_INIT_DONE_PPI {
- FSP_SILICON_INIT_DONE_GET_FSP_HOB_LIST GetFspHobList;
+ FSP_SILICON_INIT_DONE_GET_FSP_HOB_LIST GetFspHobList;
};
-extern EFI_GUID gFspSiliconInitDonePpiGuid;
+extern EFI_GUID gFspSiliconInitDonePpiGuid;
#endif
diff --git a/IntelFsp2WrapperPkg/Include/Ppi/TopOfTemporaryRam.h b/IntelFsp2WrapperPkg/Include/Ppi/TopOfTemporaryRam.h index 7d38e3b..0dfdbb0 100644 --- a/IntelFsp2WrapperPkg/Include/Ppi/TopOfTemporaryRam.h +++ b/IntelFsp2WrapperPkg/Include/Ppi/TopOfTemporaryRam.h @@ -9,6 +9,6 @@ #ifndef _TOP_OF_TEMPORARY_RAM_H_
#define _TOP_OF_TEMPORARY_RAM_H_
-extern EFI_GUID gTopOfTemporaryRamPpiGuid;
+extern EFI_GUID gTopOfTemporaryRamPpiGuid;
#endif
diff --git a/IntelFsp2WrapperPkg/Library/BaseFspMeasurementLib/FspMeasurementLib.c b/IntelFsp2WrapperPkg/Library/BaseFspMeasurementLib/FspMeasurementLib.c index 0fe0606..2c017a4 100644 --- a/IntelFsp2WrapperPkg/Library/BaseFspMeasurementLib/FspMeasurementLib.c +++ b/IntelFsp2WrapperPkg/Library/BaseFspMeasurementLib/FspMeasurementLib.c @@ -43,26 +43,26 @@ SPDX-License-Identifier: BSD-2-Clause-Patent EFI_STATUS
EFIAPI
TpmMeasureAndLogDataWithFlags (
- IN UINT32 PcrIndex,
- IN UINT32 EventType,
- IN VOID *EventLog,
- IN UINT32 LogLen,
- IN VOID *HashData,
- IN UINT64 HashDataLen,
- IN UINT64 Flags
+ IN UINT32 PcrIndex,
+ IN UINT32 EventType,
+ IN VOID *EventLog,
+ IN UINT32 LogLen,
+ IN VOID *HashData,
+ IN UINT64 HashDataLen,
+ IN UINT64 Flags
)
{
- EFI_STATUS Status;
- EDKII_TCG_PPI *TcgPpi;
- TCG_PCR_EVENT_HDR TcgEventHdr;
+ EFI_STATUS Status;
+ EDKII_TCG_PPI *TcgPpi;
+ TCG_PCR_EVENT_HDR TcgEventHdr;
- Status = PeiServicesLocatePpi(
+ Status = PeiServicesLocatePpi (
&gEdkiiTcgPpiGuid,
0,
NULL,
- (VOID**)&TcgPpi
+ (VOID **)&TcgPpi
);
- if (EFI_ERROR(Status)) {
+ if (EFI_ERROR (Status)) {
return Status;
}
@@ -99,60 +99,61 @@ STATIC EFI_STATUS
EFIAPI
MeasureFspFirmwareBlobWithCfg (
- IN CHAR8 *Description OPTIONAL,
- IN EFI_PHYSICAL_ADDRESS FirmwareBlobBase,
- IN UINT64 FirmwareBlobLength,
- IN UINT32 CfgRegionOffset,
- IN UINT32 CfgRegionSize
+ IN CHAR8 *Description OPTIONAL,
+ IN EFI_PHYSICAL_ADDRESS FirmwareBlobBase,
+ IN UINT64 FirmwareBlobLength,
+ IN UINT32 CfgRegionOffset,
+ IN UINT32 CfgRegionSize
)
{
- EFI_PLATFORM_FIRMWARE_BLOB FvBlob, UpdBlob;
- PLATFORM_FIRMWARE_BLOB2_STRUCT FvBlob2, UpdBlob2;
- VOID *FvName;
- UINT32 FvEventType;
- VOID *FvEventLog, *UpdEventLog;
- UINT32 FvEventLogSize, UpdEventLogSize;
- EFI_STATUS Status;
- HASH_HANDLE HashHandle;
- UINT8 *HashBase;
- UINTN HashSize;
- TPML_DIGEST_VALUES DigestList;
+ EFI_PLATFORM_FIRMWARE_BLOB FvBlob, UpdBlob;
+ PLATFORM_FIRMWARE_BLOB2_STRUCT FvBlob2, UpdBlob2;
+ VOID *FvName;
+ UINT32 FvEventType;
+ VOID *FvEventLog, *UpdEventLog;
+ UINT32 FvEventLogSize, UpdEventLogSize;
+ EFI_STATUS Status;
+ HASH_HANDLE HashHandle;
+ UINT8 *HashBase;
+ UINTN HashSize;
+ TPML_DIGEST_VALUES DigestList;
FvName = TpmMeasurementGetFvName (FirmwareBlobBase, FirmwareBlobLength);
if (((Description != NULL) || (FvName != NULL)) &&
- (PcdGet32(PcdTcgPfpMeasurementRevision) >= TCG_EfiSpecIDEventStruct_SPEC_ERRATA_TPM2_REV_105)) {
+ (PcdGet32 (PcdTcgPfpMeasurementRevision) >= TCG_EfiSpecIDEventStruct_SPEC_ERRATA_TPM2_REV_105))
+ {
if (Description != NULL) {
- AsciiSPrint((CHAR8*)FvBlob2.BlobDescription, sizeof(FvBlob2.BlobDescription), "%a", Description);
- AsciiSPrint((CHAR8*)UpdBlob2.BlobDescription, sizeof(UpdBlob2.BlobDescription), "%aUDP", Description);
- } else {
- AsciiSPrint((CHAR8*)FvBlob2.BlobDescription, sizeof(FvBlob2.BlobDescription), "Fv(%g)", FvName);
- AsciiSPrint((CHAR8*)UpdBlob2.BlobDescription, sizeof(UpdBlob2.BlobDescription), "(%g)UDP", FvName);
+ AsciiSPrint ((CHAR8 *)FvBlob2.BlobDescription, sizeof (FvBlob2.BlobDescription), "%a", Description);
+ AsciiSPrint ((CHAR8 *)UpdBlob2.BlobDescription, sizeof (UpdBlob2.BlobDescription), "%aUDP", Description);
+ } else {
+ AsciiSPrint ((CHAR8 *)FvBlob2.BlobDescription, sizeof (FvBlob2.BlobDescription), "Fv(%g)", FvName);
+ AsciiSPrint ((CHAR8 *)UpdBlob2.BlobDescription, sizeof (UpdBlob2.BlobDescription), "(%g)UDP", FvName);
}
- FvBlob2.BlobDescriptionSize = sizeof(FvBlob2.BlobDescription);
- FvBlob2.BlobBase = FirmwareBlobBase;
- FvBlob2.BlobLength = FirmwareBlobLength;
- FvEventType = EV_EFI_PLATFORM_FIRMWARE_BLOB2;
- FvEventLog = &FvBlob2;
- FvEventLogSize = sizeof(FvBlob2);
-
- UpdBlob2.BlobDescriptionSize = sizeof(UpdBlob2.BlobDescription);
- UpdBlob2.BlobBase = CfgRegionOffset;
- UpdBlob2.BlobLength = CfgRegionSize;
- UpdEventLog = &UpdBlob2;
- UpdEventLogSize = sizeof(UpdBlob2);
+ FvBlob2.BlobDescriptionSize = sizeof (FvBlob2.BlobDescription);
+ FvBlob2.BlobBase = FirmwareBlobBase;
+ FvBlob2.BlobLength = FirmwareBlobLength;
+ FvEventType = EV_EFI_PLATFORM_FIRMWARE_BLOB2;
+ FvEventLog = &FvBlob2;
+ FvEventLogSize = sizeof (FvBlob2);
+
+ UpdBlob2.BlobDescriptionSize = sizeof (UpdBlob2.BlobDescription);
+ UpdBlob2.BlobBase = CfgRegionOffset;
+ UpdBlob2.BlobLength = CfgRegionSize;
+ UpdEventLog = &UpdBlob2;
+ UpdEventLogSize = sizeof (UpdBlob2);
} else {
- FvBlob.BlobBase = FirmwareBlobBase;
+ FvBlob.BlobBase = FirmwareBlobBase;
FvBlob.BlobLength = FirmwareBlobLength;
- FvEventType = EV_EFI_PLATFORM_FIRMWARE_BLOB;
- FvEventLog = &FvBlob;
- FvEventLogSize = sizeof(FvBlob);
+ FvEventType = EV_EFI_PLATFORM_FIRMWARE_BLOB;
+ FvEventLog = &FvBlob;
+ FvEventLogSize = sizeof (FvBlob);
- UpdBlob.BlobBase = CfgRegionOffset;
+ UpdBlob.BlobBase = CfgRegionOffset;
UpdBlob.BlobLength = CfgRegionSize;
- UpdEventLog = &UpdBlob;
- UpdEventLogSize = sizeof(UpdBlob);
+ UpdEventLog = &UpdBlob;
+ UpdEventLogSize = sizeof (UpdBlob);
}
/** Initialize a SHA hash context. **/
@@ -163,18 +164,18 @@ MeasureFspFirmwareBlobWithCfg ( }
/** Hash FSP binary before UDP **/
- HashBase = (UINT8 *) (UINTN) FirmwareBlobBase;
- HashSize = (UINTN) CfgRegionOffset;
- Status = HashUpdate (HashHandle, HashBase, HashSize);
+ HashBase = (UINT8 *)(UINTN)FirmwareBlobBase;
+ HashSize = (UINTN)CfgRegionOffset;
+ Status = HashUpdate (HashHandle, HashBase, HashSize);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "HashUpdate failed - %r\n", Status));
return Status;
}
/** Hash FSP binary after UDP **/
- HashBase = (UINT8 *) (UINTN) FirmwareBlobBase + CfgRegionOffset + CfgRegionSize;
+ HashBase = (UINT8 *)(UINTN)FirmwareBlobBase + CfgRegionOffset + CfgRegionSize;
HashSize = (UINTN)(FirmwareBlobLength - CfgRegionOffset - CfgRegionSize);
- Status = HashUpdate (HashHandle, HashBase, HashSize);
+ Status = HashUpdate (HashHandle, HashBase, HashSize);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "HashUpdate failed - %r\n", Status));
return Status;
@@ -192,8 +193,8 @@ MeasureFspFirmwareBlobWithCfg ( FvEventType,
FvEventLog,
FvEventLogSize,
- (UINT8 *) &DigestList,
- (UINTN) sizeof(DigestList),
+ (UINT8 *)&DigestList,
+ (UINTN)sizeof (DigestList),
EDKII_TCG_PRE_HASH_LOG_ONLY
);
@@ -202,7 +203,7 @@ MeasureFspFirmwareBlobWithCfg ( EV_PLATFORM_CONFIG_FLAGS,
UpdEventLog,
UpdEventLogSize,
- (UINT8 *) (UINTN) FirmwareBlobBase + CfgRegionOffset,
+ (UINT8 *)(UINTN)FirmwareBlobBase + CfgRegionOffset,
CfgRegionSize
);
@@ -225,10 +226,10 @@ MeasureFspFirmwareBlobWithCfg ( EFI_STATUS
EFIAPI
MeasureFspFirmwareBlob (
- IN UINT32 PcrIndex,
- IN CHAR8 *Description OPTIONAL,
- IN EFI_PHYSICAL_ADDRESS FirmwareBlobBase,
- IN UINT64 FirmwareBlobLength
+ IN UINT32 PcrIndex,
+ IN CHAR8 *Description OPTIONAL,
+ IN EFI_PHYSICAL_ADDRESS FirmwareBlobBase,
+ IN UINT64 FirmwareBlobLength
)
{
UINT32 FspMeasureMask;
@@ -236,13 +237,17 @@ MeasureFspFirmwareBlob ( FspMeasureMask = PcdGet32 (PcdFspMeasurementConfig);
if ((FspMeasureMask & FSP_MEASURE_FSPUPD) != 0) {
- FspHeaderPtr = (FSP_INFO_HEADER *) FspFindFspHeader (FirmwareBlobBase);
+ FspHeaderPtr = (FSP_INFO_HEADER *)FspFindFspHeader (FirmwareBlobBase);
if (FspHeaderPtr != NULL) {
- return MeasureFspFirmwareBlobWithCfg(Description, FirmwareBlobBase, FirmwareBlobLength,
- FspHeaderPtr->CfgRegionOffset, FspHeaderPtr->CfgRegionSize);
+ return MeasureFspFirmwareBlobWithCfg (
+ Description,
+ FirmwareBlobBase,
+ FirmwareBlobLength,
+ FspHeaderPtr->CfgRegionOffset,
+ FspHeaderPtr->CfgRegionSize
+ );
}
}
return MeasureFirmwareBlob (PcrIndex, Description, FirmwareBlobBase, FirmwareBlobLength);
}
-
diff --git a/IntelFsp2WrapperPkg/Library/BaseFspWrapperApiLib/FspWrapperApiLib.c b/IntelFsp2WrapperPkg/Library/BaseFspWrapperApiLib/FspWrapperApiLib.c index 2732920..67faad9 100644 --- a/IntelFsp2WrapperPkg/Library/BaseFspWrapperApiLib/FspWrapperApiLib.c +++ b/IntelFsp2WrapperPkg/Library/BaseFspWrapperApiLib/FspWrapperApiLib.c @@ -24,9 +24,9 @@ **/
EFI_STATUS
Execute32BitCode (
- IN UINT64 Function,
- IN UINT64 Param1,
- IN UINT64 Param2
+ IN UINT64 Function,
+ IN UINT64 Param1,
+ IN UINT64 Param2
);
/**
@@ -42,9 +42,9 @@ FspFindFspHeader ( IN EFI_PHYSICAL_ADDRESS FlashFvFspBase
)
{
- UINT8 *CheckPointer;
+ UINT8 *CheckPointer;
- CheckPointer = (UINT8 *) (UINTN) FlashFvFspBase;
+ CheckPointer = (UINT8 *)(UINTN)FlashFvFspBase;
if (((EFI_FIRMWARE_VOLUME_HEADER *)CheckPointer)->Signature != EFI_FVH_SIGNATURE) {
return NULL;
@@ -53,12 +53,11 @@ FspFindFspHeader ( if (((EFI_FIRMWARE_VOLUME_HEADER *)CheckPointer)->ExtHeaderOffset != 0) {
CheckPointer = CheckPointer + ((EFI_FIRMWARE_VOLUME_HEADER *)CheckPointer)->ExtHeaderOffset;
CheckPointer = CheckPointer + ((EFI_FIRMWARE_VOLUME_EXT_HEADER *)CheckPointer)->ExtHeaderSize;
- CheckPointer = (UINT8 *) ALIGN_POINTER (CheckPointer, 8);
+ CheckPointer = (UINT8 *)ALIGN_POINTER (CheckPointer, 8);
} else {
CheckPointer = CheckPointer + ((EFI_FIRMWARE_VOLUME_HEADER *)CheckPointer)->HeaderLength;
}
-
CheckPointer = CheckPointer + sizeof (EFI_FFS_FILE_HEADER);
if (((EFI_RAW_SECTION *)CheckPointer)->Type != EFI_SECTION_RAW) {
@@ -80,13 +79,13 @@ FspFindFspHeader ( EFI_STATUS
EFIAPI
CallFspNotifyPhase (
- IN NOTIFY_PHASE_PARAMS *NotifyPhaseParams
+ IN NOTIFY_PHASE_PARAMS *NotifyPhaseParams
)
{
- FSP_INFO_HEADER *FspHeader;
- FSP_NOTIFY_PHASE NotifyPhaseApi;
- EFI_STATUS Status;
- BOOLEAN InterruptState;
+ FSP_INFO_HEADER *FspHeader;
+ FSP_NOTIFY_PHASE NotifyPhaseApi;
+ EFI_STATUS Status;
+ BOOLEAN InterruptState;
FspHeader = (FSP_INFO_HEADER *)FspFindFspHeader (PcdGet32 (PcdFspsBaseAddress));
if (FspHeader == NULL) {
@@ -95,7 +94,7 @@ CallFspNotifyPhase ( NotifyPhaseApi = (FSP_NOTIFY_PHASE)((UINTN)FspHeader->ImageBase + FspHeader->NotifyPhaseEntryOffset);
InterruptState = SaveAndDisableInterrupts ();
- Status = Execute32BitCode ((UINTN)NotifyPhaseApi, (UINTN)NotifyPhaseParams, (UINTN)NULL);
+ Status = Execute32BitCode ((UINTN)NotifyPhaseApi, (UINTN)NotifyPhaseParams, (UINTN)NULL);
SetInterruptState (InterruptState);
return Status;
@@ -112,14 +111,14 @@ CallFspNotifyPhase ( EFI_STATUS
EFIAPI
CallFspMemoryInit (
- IN VOID *FspmUpdDataPtr,
- OUT VOID **HobListPtr
+ IN VOID *FspmUpdDataPtr,
+ OUT VOID **HobListPtr
)
{
- FSP_INFO_HEADER *FspHeader;
- FSP_MEMORY_INIT FspMemoryInitApi;
- EFI_STATUS Status;
- BOOLEAN InterruptState;
+ FSP_INFO_HEADER *FspHeader;
+ FSP_MEMORY_INIT FspMemoryInitApi;
+ EFI_STATUS Status;
+ BOOLEAN InterruptState;
FspHeader = (FSP_INFO_HEADER *)FspFindFspHeader (PcdGet32 (PcdFspmBaseAddress));
if (FspHeader == NULL) {
@@ -127,8 +126,8 @@ CallFspMemoryInit ( }
FspMemoryInitApi = (FSP_MEMORY_INIT)((UINTN)FspHeader->ImageBase + FspHeader->FspMemoryInitEntryOffset);
- InterruptState = SaveAndDisableInterrupts ();
- Status = Execute32BitCode ((UINTN)FspMemoryInitApi, (UINTN)FspmUpdDataPtr, (UINTN)HobListPtr);
+ InterruptState = SaveAndDisableInterrupts ();
+ Status = Execute32BitCode ((UINTN)FspMemoryInitApi, (UINTN)FspmUpdDataPtr, (UINTN)HobListPtr);
SetInterruptState (InterruptState);
return Status;
@@ -144,13 +143,13 @@ CallFspMemoryInit ( EFI_STATUS
EFIAPI
CallTempRamExit (
- IN VOID *TempRamExitParam
+ IN VOID *TempRamExitParam
)
{
- FSP_INFO_HEADER *FspHeader;
- FSP_TEMP_RAM_EXIT TempRamExitApi;
- EFI_STATUS Status;
- BOOLEAN InterruptState;
+ FSP_INFO_HEADER *FspHeader;
+ FSP_TEMP_RAM_EXIT TempRamExitApi;
+ EFI_STATUS Status;
+ BOOLEAN InterruptState;
FspHeader = (FSP_INFO_HEADER *)FspFindFspHeader (PcdGet32 (PcdFspmBaseAddress));
if (FspHeader == NULL) {
@@ -159,7 +158,7 @@ CallTempRamExit ( TempRamExitApi = (FSP_TEMP_RAM_EXIT)((UINTN)FspHeader->ImageBase + FspHeader->TempRamExitEntryOffset);
InterruptState = SaveAndDisableInterrupts ();
- Status = Execute32BitCode ((UINTN)TempRamExitApi, (UINTN)TempRamExitParam, (UINTN)NULL);
+ Status = Execute32BitCode ((UINTN)TempRamExitApi, (UINTN)TempRamExitParam, (UINTN)NULL);
SetInterruptState (InterruptState);
return Status;
@@ -175,13 +174,13 @@ CallTempRamExit ( EFI_STATUS
EFIAPI
CallFspSiliconInit (
- IN VOID *FspsUpdDataPtr
+ IN VOID *FspsUpdDataPtr
)
{
- FSP_INFO_HEADER *FspHeader;
- FSP_SILICON_INIT FspSiliconInitApi;
- EFI_STATUS Status;
- BOOLEAN InterruptState;
+ FSP_INFO_HEADER *FspHeader;
+ FSP_SILICON_INIT FspSiliconInitApi;
+ EFI_STATUS Status;
+ BOOLEAN InterruptState;
FspHeader = (FSP_INFO_HEADER *)FspFindFspHeader (PcdGet32 (PcdFspsBaseAddress));
if (FspHeader == NULL) {
@@ -189,8 +188,8 @@ CallFspSiliconInit ( }
FspSiliconInitApi = (FSP_SILICON_INIT)((UINTN)FspHeader->ImageBase + FspHeader->FspSiliconInitEntryOffset);
- InterruptState = SaveAndDisableInterrupts ();
- Status = Execute32BitCode ((UINTN)FspSiliconInitApi, (UINTN)FspsUpdDataPtr, (UINTN)NULL);
+ InterruptState = SaveAndDisableInterrupts ();
+ Status = Execute32BitCode ((UINTN)FspSiliconInitApi, (UINTN)FspsUpdDataPtr, (UINTN)NULL);
SetInterruptState (InterruptState);
return Status;
diff --git a/IntelFsp2WrapperPkg/Library/BaseFspWrapperApiLib/IA32/DispatchExecute.c b/IntelFsp2WrapperPkg/Library/BaseFspWrapperApiLib/IA32/DispatchExecute.c index 3b3472e..4f6a8dd 100644 --- a/IntelFsp2WrapperPkg/Library/BaseFspWrapperApiLib/IA32/DispatchExecute.c +++ b/IntelFsp2WrapperPkg/Library/BaseFspWrapperApiLib/IA32/DispatchExecute.c @@ -19,7 +19,7 @@ **/
typedef
EFI_STATUS
-(EFIAPI *FSP_FUNCTION) (
+(EFIAPI *FSP_FUNCTION)(
IN VOID *Param1,
IN VOID *Param2
);
@@ -36,17 +36,16 @@ EFI_STATUS **/
EFI_STATUS
Execute32BitCode (
- IN UINT64 Function,
- IN UINT64 Param1,
- IN UINT64 Param2
+ IN UINT64 Function,
+ IN UINT64 Param1,
+ IN UINT64 Param2
)
{
- FSP_FUNCTION EntryFunc;
- EFI_STATUS Status;
+ FSP_FUNCTION EntryFunc;
+ EFI_STATUS Status;
- EntryFunc = (FSP_FUNCTION) (UINTN) (Function);
+ EntryFunc = (FSP_FUNCTION)(UINTN)(Function);
Status = EntryFunc ((VOID *)(UINTN)Param1, (VOID *)(UINTN)Param2);
return Status;
}
-
diff --git a/IntelFsp2WrapperPkg/Library/BaseFspWrapperApiLib/X64/DispatchExecute.c b/IntelFsp2WrapperPkg/Library/BaseFspWrapperApiLib/X64/DispatchExecute.c index 001fc6f..2ee5bc3 100644 --- a/IntelFsp2WrapperPkg/Library/BaseFspWrapperApiLib/X64/DispatchExecute.c +++ b/IntelFsp2WrapperPkg/Library/BaseFspWrapperApiLib/X64/DispatchExecute.c @@ -15,39 +15,49 @@ #pragma pack(1)
typedef union {
struct {
- UINT32 LimitLow : 16;
- UINT32 BaseLow : 16;
- UINT32 BaseMid : 8;
- UINT32 Type : 4;
- UINT32 System : 1;
- UINT32 Dpl : 2;
- UINT32 Present : 1;
- UINT32 LimitHigh : 4;
- UINT32 Software : 1;
- UINT32 Reserved : 1;
- UINT32 DefaultSize : 1;
- UINT32 Granularity : 1;
- UINT32 BaseHigh : 8;
+ UINT32 LimitLow : 16;
+ UINT32 BaseLow : 16;
+ UINT32 BaseMid : 8;
+ UINT32 Type : 4;
+ UINT32 System : 1;
+ UINT32 Dpl : 2;
+ UINT32 Present : 1;
+ UINT32 LimitHigh : 4;
+ UINT32 Software : 1;
+ UINT32 Reserved : 1;
+ UINT32 DefaultSize : 1;
+ UINT32 Granularity : 1;
+ UINT32 BaseHigh : 8;
} Bits;
- UINT64 Uint64;
+ UINT64 Uint64;
} IA32_GDT;
#pragma pack()
-GLOBAL_REMOVE_IF_UNREFERENCED IA32_GDT mGdtEntries[] = {
- {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, /* 0x0: reserve */
- {{0xFFFF, 0, 0, 0xB, 1, 0, 1, 0xF, 0, 0, 1, 1, 0}}, /* 0x8: compatibility mode */
- {{0xFFFF, 0, 0, 0xB, 1, 0, 1, 0xF, 0, 1, 0, 1, 0}}, /* 0x10: for long mode */
- {{0xFFFF, 0, 0, 0x3, 1, 0, 1, 0xF, 0, 0, 1, 1, 0}}, /* 0x18: data */
- {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, /* 0x20: reserve */
+GLOBAL_REMOVE_IF_UNREFERENCED IA32_GDT mGdtEntries[] = {
+ {
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+ }, /* 0x0: reserve */
+ {
+ { 0xFFFF, 0, 0, 0xB, 1, 0, 1, 0xF, 0, 0, 1, 1, 0 }
+ }, /* 0x8: compatibility mode */
+ {
+ { 0xFFFF, 0, 0, 0xB, 1, 0, 1, 0xF, 0, 1, 0, 1, 0 }
+ }, /* 0x10: for long mode */
+ {
+ { 0xFFFF, 0, 0, 0x3, 1, 0, 1, 0xF, 0, 0, 1, 1, 0 }
+ }, /* 0x18: data */
+ {
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+ }, /* 0x20: reserve */
};
//
// IA32 Gdt register
//
-GLOBAL_REMOVE_IF_UNREFERENCED IA32_DESCRIPTOR mGdt = {
+GLOBAL_REMOVE_IF_UNREFERENCED IA32_DESCRIPTOR mGdt = {
sizeof (mGdtEntries) - 1,
- (UINTN) mGdtEntries
- };
+ (UINTN)mGdtEntries
+};
/**
Assembly function to transition from long mode to compatibility mode to execute 32-bit code and then transit back to
@@ -81,9 +91,9 @@ AsmExecute32BitCode ( **/
EFI_STATUS
Execute32BitCode (
- IN UINT64 Function,
- IN UINT64 Param1,
- IN UINT64 Param2
+ IN UINT64 Function,
+ IN UINT64 Param1,
+ IN UINT64 Param2
)
{
EFI_STATUS Status;
@@ -100,4 +110,3 @@ Execute32BitCode ( return Status;
}
-
diff --git a/IntelFsp2WrapperPkg/Library/BaseFspWrapperApiTestLibNull/FspWrapperApiTestNull.c b/IntelFsp2WrapperPkg/Library/BaseFspWrapperApiTestLibNull/FspWrapperApiTestNull.c index 1de782c..4ac5d3d 100644 --- a/IntelFsp2WrapperPkg/Library/BaseFspWrapperApiTestLibNull/FspWrapperApiTestNull.c +++ b/IntelFsp2WrapperPkg/Library/BaseFspWrapperApiTestLibNull/FspWrapperApiTestNull.c @@ -19,8 +19,8 @@ EFI_STATUS
EFIAPI
TestFspMemoryInitApiOutput (
- IN VOID *FspmUpdDataPtr,
- IN VOID **HobListPtr
+ IN VOID *FspmUpdDataPtr,
+ IN VOID **HobListPtr
)
{
return RETURN_UNSUPPORTED;
@@ -36,7 +36,7 @@ TestFspMemoryInitApiOutput ( EFI_STATUS
EFIAPI
TestFspTempRamExitApiOutput (
- IN VOID *TempRamExitParam
+ IN VOID *TempRamExitParam
)
{
return RETURN_UNSUPPORTED;
@@ -52,7 +52,7 @@ TestFspTempRamExitApiOutput ( EFI_STATUS
EFIAPI
TestFspSiliconInitApiOutput (
- IN VOID *FspsUpdDataPtr
+ IN VOID *FspsUpdDataPtr
)
{
return RETURN_UNSUPPORTED;
diff --git a/IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformLibSample/FspWrapperPlatformLibSample.c b/IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformLibSample/FspWrapperPlatformLibSample.c index dddf80b..fa7d60c 100644 --- a/IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformLibSample/FspWrapperPlatformLibSample.c +++ b/IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformLibSample/FspWrapperPlatformLibSample.c @@ -20,7 +20,7 @@ VOID
EFIAPI
UpdateFspmUpdData (
- IN OUT VOID *FspUpdRgnPtr
+ IN OUT VOID *FspUpdRgnPtr
)
{
}
@@ -34,7 +34,7 @@ UpdateFspmUpdData ( VOID
EFIAPI
UpdateFspsUpdData (
- IN OUT VOID *FspUpdRgnPtr
+ IN OUT VOID *FspUpdRgnPtr
)
{
}
@@ -69,8 +69,8 @@ UpdateTempRamExitParam ( EFI_STATUS
EFIAPI
GetS3MemoryInfo (
- OUT UINT64 *S3PeiMemSize,
- OUT EFI_PHYSICAL_ADDRESS *S3PeiMemBase
+ OUT UINT64 *S3PeiMemSize,
+ OUT EFI_PHYSICAL_ADDRESS *S3PeiMemBase
)
{
return EFI_UNSUPPORTED;
@@ -86,12 +86,12 @@ GetS3MemoryInfo ( VOID
EFIAPI
CallFspWrapperResetSystem (
- IN UINT32 FspStatusResetType
+ IN UINT32 FspStatusResetType
)
{
//
// Perform reset according to the type.
//
- CpuDeadLoop();
+ CpuDeadLoop ();
}
diff --git a/IntelFsp2WrapperPkg/Library/PeiFspWrapperApiTestLib/FspWrapperApiTest.c b/IntelFsp2WrapperPkg/Library/PeiFspWrapperApiTestLib/FspWrapperApiTest.c index 2e8246b..0b48677 100644 --- a/IntelFsp2WrapperPkg/Library/PeiFspWrapperApiTestLib/FspWrapperApiTest.c +++ b/IntelFsp2WrapperPkg/Library/PeiFspWrapperApiTestLib/FspWrapperApiTest.c @@ -23,27 +23,30 @@ EFI_STATUS
EFIAPI
TestFspMemoryInitApiOutput (
- IN VOID *FspmUpdDataPtr,
- IN VOID **HobListPtr
+ IN VOID *FspmUpdDataPtr,
+ IN VOID **HobListPtr
)
{
DEBUG_CODE_BEGIN ();
- EFI_PEI_HOB_POINTERS Hob;
+ EFI_PEI_HOB_POINTERS Hob;
Hob.Raw = (UINT8 *)(*(HobListPtr));
while (TRUE) {
- if (END_OF_HOB_LIST(Hob) == TRUE) {
- DEBUG((DEBUG_INFO, "gFspBootLoaderTolumHobGuid not Found\n"));
+ if (END_OF_HOB_LIST (Hob) == TRUE) {
+ DEBUG ((DEBUG_INFO, "gFspBootLoaderTolumHobGuid not Found\n"));
break;
}
+
if ((CompareGuid (&Hob.ResourceDescriptor->Owner, &gFspBootLoaderTolumHobGuid))) {
DEBUG ((DEBUG_INFO, "gFspBootLoaderTolumHobGuid Found\n"));
DEBUG ((DEBUG_INFO, "Fill Boot Loader reserved memory range with 0x5A for testing purpose\n"));
SetMem ((VOID *)(UINTN)Hob.ResourceDescriptor->PhysicalStart, (UINTN)Hob.ResourceDescriptor->ResourceLength, 0x5A);
break;
}
+
Hob.Raw = GET_NEXT_HOB (Hob);
}
+
DEBUG_CODE_END ();
return RETURN_SUCCESS;
@@ -59,7 +62,7 @@ TestFspMemoryInitApiOutput ( EFI_STATUS
EFIAPI
TestFspTempRamExitApiOutput (
- IN VOID *TempRamExitParam
+ IN VOID *TempRamExitParam
)
{
return RETURN_SUCCESS;
@@ -75,7 +78,7 @@ TestFspTempRamExitApiOutput ( EFI_STATUS
EFIAPI
TestFspSiliconInitApiOutput (
- IN VOID *FspsUpdDataPtr
+ IN VOID *FspsUpdDataPtr
)
{
return RETURN_SUCCESS;
diff --git a/IntelFsp2WrapperPkg/Library/PeiFspWrapperHobProcessLibSample/FspWrapperHobProcessLibSample.c b/IntelFsp2WrapperPkg/Library/PeiFspWrapperHobProcessLibSample/FspWrapperHobProcessLibSample.c index 48f4b02..84360ac 100644 --- a/IntelFsp2WrapperPkg/Library/PeiFspWrapperHobProcessLibSample/FspWrapperHobProcessLibSample.c +++ b/IntelFsp2WrapperPkg/Library/PeiFspWrapperHobProcessLibSample/FspWrapperHobProcessLibSample.c @@ -26,7 +26,7 @@ // Additional pages are used by DXE memory manager.
// It should be consistent between RetrieveRequiredMemorySize() and GetPeiMemSize()
//
-#define PEI_ADDITIONAL_MEMORY_SIZE (16 * EFI_PAGE_SIZE)
+#define PEI_ADDITIONAL_MEMORY_SIZE (16 * EFI_PAGE_SIZE)
/**
Get the mem size in memory type information table.
@@ -37,22 +37,23 @@ **/
UINT64
GetMemorySizeInMemoryTypeInformation (
- IN EFI_PEI_SERVICES **PeiServices
+ IN EFI_PEI_SERVICES **PeiServices
)
{
- EFI_STATUS Status;
- EFI_PEI_HOB_POINTERS Hob;
- EFI_MEMORY_TYPE_INFORMATION *MemoryData;
- UINT8 Index;
- UINTN TempPageNum;
+ EFI_STATUS Status;
+ EFI_PEI_HOB_POINTERS Hob;
+ EFI_MEMORY_TYPE_INFORMATION *MemoryData;
+ UINT8 Index;
+ UINTN TempPageNum;
MemoryData = NULL;
- Status = (*PeiServices)->GetHobList ((CONST EFI_PEI_SERVICES**)PeiServices, (VOID **) &Hob.Raw);
+ Status = (*PeiServices)->GetHobList ((CONST EFI_PEI_SERVICES **)PeiServices, (VOID **)&Hob.Raw);
ASSERT_EFI_ERROR (Status);
while (!END_OF_HOB_LIST (Hob)) {
- if (Hob.Header->HobType == EFI_HOB_TYPE_GUID_EXTENSION &&
- CompareGuid (&Hob.Guid->Name, &gEfiMemoryTypeInformationGuid)) {
- MemoryData = (EFI_MEMORY_TYPE_INFORMATION *) (Hob.Raw + sizeof (EFI_HOB_GENERIC_HEADER) + sizeof (EFI_GUID));
+ if ((Hob.Header->HobType == EFI_HOB_TYPE_GUID_EXTENSION) &&
+ CompareGuid (&Hob.Guid->Name, &gEfiMemoryTypeInformationGuid))
+ {
+ MemoryData = (EFI_MEMORY_TYPE_INFORMATION *)(Hob.Raw + sizeof (EFI_HOB_GENERIC_HEADER) + sizeof (EFI_GUID));
break;
}
@@ -83,10 +84,10 @@ GetMemorySizeInMemoryTypeInformation ( **/
UINT64
RetrieveRequiredMemorySize (
- IN EFI_PEI_SERVICES **PeiServices
+ IN EFI_PEI_SERVICES **PeiServices
)
{
- UINT64 Size;
+ UINT64 Size;
Size = GetMemorySizeInMemoryTypeInformation (PeiServices);
return Size + PEI_ADDITIONAL_MEMORY_SIZE;
@@ -102,12 +103,12 @@ RetrieveRequiredMemorySize ( **/
UINT64
GetPeiMemSize (
- IN EFI_PEI_SERVICES **PeiServices,
- IN UINT32 BootMode
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN UINT32 BootMode
)
{
- UINT64 Size;
- UINT64 MinSize;
+ UINT64 Size;
+ UINT64 MinSize;
if (BootMode == BOOT_IN_RECOVERY_MODE) {
return PcdGet32 (PcdPeiRecoveryMinMemSize);
@@ -137,34 +138,34 @@ GetPeiMemSize ( EFI_STATUS
EFIAPI
PostFspmHobProcess (
- IN VOID *FspHobList
+ IN VOID *FspHobList
)
{
- EFI_PEI_HOB_POINTERS Hob;
- UINT64 LowMemorySize;
- UINT64 FspMemorySize;
- EFI_PHYSICAL_ADDRESS FspMemoryBase;
- UINT64 PeiMemSize;
- EFI_PHYSICAL_ADDRESS PeiMemBase;
- UINT64 S3PeiMemSize;
- EFI_PHYSICAL_ADDRESS S3PeiMemBase;
- BOOLEAN FoundFspMemHob;
- EFI_STATUS Status;
- EFI_BOOT_MODE BootMode;
- EFI_PEI_CAPSULE_PPI *Capsule;
- VOID *CapsuleBuffer;
- UINTN CapsuleBufferLength;
- UINT64 RequiredMemSize;
- EFI_PEI_SERVICES **PeiServices;
+ EFI_PEI_HOB_POINTERS Hob;
+ UINT64 LowMemorySize;
+ UINT64 FspMemorySize;
+ EFI_PHYSICAL_ADDRESS FspMemoryBase;
+ UINT64 PeiMemSize;
+ EFI_PHYSICAL_ADDRESS PeiMemBase;
+ UINT64 S3PeiMemSize;
+ EFI_PHYSICAL_ADDRESS S3PeiMemBase;
+ BOOLEAN FoundFspMemHob;
+ EFI_STATUS Status;
+ EFI_BOOT_MODE BootMode;
+ EFI_PEI_CAPSULE_PPI *Capsule;
+ VOID *CapsuleBuffer;
+ UINTN CapsuleBufferLength;
+ UINT64 RequiredMemSize;
+ EFI_PEI_SERVICES **PeiServices;
PeiServices = (EFI_PEI_SERVICES **)GetPeiServicesTablePointer ();
PeiServicesGetBootMode (&BootMode);
- PeiMemBase = 0;
- LowMemorySize = 0;
- FspMemorySize = 0;
- FspMemoryBase = 0;
+ PeiMemBase = 0;
+ LowMemorySize = 0;
+ FspMemorySize = 0;
+ FspMemoryBase = 0;
FoundFspMemHob = FALSE;
//
@@ -172,34 +173,37 @@ PostFspmHobProcess ( // Report all the resource hob except the memory between 1M and 4G
//
Hob.Raw = (UINT8 *)(UINTN)FspHobList;
- DEBUG((DEBUG_INFO, "FspHobList - 0x%x\n", FspHobList));
+ DEBUG ((DEBUG_INFO, "FspHobList - 0x%x\n", FspHobList));
while ((Hob.Raw = GetNextHob (EFI_HOB_TYPE_RESOURCE_DESCRIPTOR, Hob.Raw)) != NULL) {
- DEBUG((DEBUG_INFO, "\nResourceType: 0x%x\n", Hob.ResourceDescriptor->ResourceType));
+ DEBUG ((DEBUG_INFO, "\nResourceType: 0x%x\n", Hob.ResourceDescriptor->ResourceType));
if ((Hob.ResourceDescriptor->ResourceType == EFI_RESOURCE_SYSTEM_MEMORY) ||
- (Hob.ResourceDescriptor->ResourceType == EFI_RESOURCE_MEMORY_RESERVED)) {
- DEBUG((DEBUG_INFO, "ResourceAttribute: 0x%x\n", Hob.ResourceDescriptor->ResourceAttribute));
- DEBUG((DEBUG_INFO, "PhysicalStart: 0x%x\n", Hob.ResourceDescriptor->PhysicalStart));
- DEBUG((DEBUG_INFO, "ResourceLength: 0x%x\n", Hob.ResourceDescriptor->ResourceLength));
- DEBUG((DEBUG_INFO, "Owner: %g\n\n", &Hob.ResourceDescriptor->Owner));
+ (Hob.ResourceDescriptor->ResourceType == EFI_RESOURCE_MEMORY_RESERVED))
+ {
+ DEBUG ((DEBUG_INFO, "ResourceAttribute: 0x%x\n", Hob.ResourceDescriptor->ResourceAttribute));
+ DEBUG ((DEBUG_INFO, "PhysicalStart: 0x%x\n", Hob.ResourceDescriptor->PhysicalStart));
+ DEBUG ((DEBUG_INFO, "ResourceLength: 0x%x\n", Hob.ResourceDescriptor->ResourceLength));
+ DEBUG ((DEBUG_INFO, "Owner: %g\n\n", &Hob.ResourceDescriptor->Owner));
}
- if ((Hob.ResourceDescriptor->ResourceType == EFI_RESOURCE_SYSTEM_MEMORY) // Found the low memory length below 4G
- && (Hob.ResourceDescriptor->PhysicalStart >= BASE_1MB)
- && (Hob.ResourceDescriptor->PhysicalStart + Hob.ResourceDescriptor->ResourceLength <= BASE_4GB)) {
- LowMemorySize += Hob.ResourceDescriptor->ResourceLength;
- Hob.Raw = GET_NEXT_HOB (Hob);
+ if ( (Hob.ResourceDescriptor->ResourceType == EFI_RESOURCE_SYSTEM_MEMORY) // Found the low memory length below 4G
+ && (Hob.ResourceDescriptor->PhysicalStart >= BASE_1MB)
+ && (Hob.ResourceDescriptor->PhysicalStart + Hob.ResourceDescriptor->ResourceLength <= BASE_4GB))
+ {
+ LowMemorySize += Hob.ResourceDescriptor->ResourceLength;
+ Hob.Raw = GET_NEXT_HOB (Hob);
continue;
}
- if ((Hob.ResourceDescriptor->ResourceType == EFI_RESOURCE_MEMORY_RESERVED) // Found the low memory length below 4G
- && (Hob.ResourceDescriptor->PhysicalStart >= BASE_1MB)
- && (Hob.ResourceDescriptor->PhysicalStart + Hob.ResourceDescriptor->ResourceLength <= BASE_4GB)
- && (CompareGuid (&Hob.ResourceDescriptor->Owner, &gFspReservedMemoryResourceHobGuid))) {
+ if ( (Hob.ResourceDescriptor->ResourceType == EFI_RESOURCE_MEMORY_RESERVED) // Found the low memory length below 4G
+ && (Hob.ResourceDescriptor->PhysicalStart >= BASE_1MB)
+ && (Hob.ResourceDescriptor->PhysicalStart + Hob.ResourceDescriptor->ResourceLength <= BASE_4GB)
+ && (CompareGuid (&Hob.ResourceDescriptor->Owner, &gFspReservedMemoryResourceHobGuid)))
+ {
FoundFspMemHob = TRUE;
- FspMemoryBase = Hob.ResourceDescriptor->PhysicalStart;
- FspMemorySize = Hob.ResourceDescriptor->ResourceLength;
- DEBUG((DEBUG_INFO, "Find fsp mem hob, base 0x%x, len 0x%x\n", FspMemoryBase, FspMemorySize));
+ FspMemoryBase = Hob.ResourceDescriptor->PhysicalStart;
+ FspMemorySize = Hob.ResourceDescriptor->ResourceLength;
+ DEBUG ((DEBUG_INFO, "Find fsp mem hob, base 0x%x, len 0x%x\n", FspMemoryBase, FspMemorySize));
}
//
@@ -216,25 +220,25 @@ PostFspmHobProcess ( }
if (!FoundFspMemHob) {
- DEBUG((DEBUG_INFO, "Didn't find the fsp used memory information.\n"));
- //ASSERT(FALSE);
+ DEBUG ((DEBUG_INFO, "Didn't find the fsp used memory information.\n"));
+ // ASSERT(FALSE);
}
- DEBUG((DEBUG_INFO, "LowMemorySize: 0x%x.\n", LowMemorySize));
- DEBUG((DEBUG_INFO, "FspMemoryBase: 0x%x.\n", FspMemoryBase));
- DEBUG((DEBUG_INFO, "FspMemorySize: 0x%x.\n", FspMemorySize));
+ DEBUG ((DEBUG_INFO, "LowMemorySize: 0x%x.\n", LowMemorySize));
+ DEBUG ((DEBUG_INFO, "FspMemoryBase: 0x%x.\n", FspMemoryBase));
+ DEBUG ((DEBUG_INFO, "FspMemorySize: 0x%x.\n", FspMemorySize));
if (BootMode == BOOT_ON_S3_RESUME) {
BuildResourceDescriptorHob (
EFI_RESOURCE_SYSTEM_MEMORY,
(
- EFI_RESOURCE_ATTRIBUTE_PRESENT |
- EFI_RESOURCE_ATTRIBUTE_INITIALIZED |
- // EFI_RESOURCE_ATTRIBUTE_TESTED |
- EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE |
- EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE |
- EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE |
- EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE
+ EFI_RESOURCE_ATTRIBUTE_PRESENT |
+ EFI_RESOURCE_ATTRIBUTE_INITIALIZED |
+ // EFI_RESOURCE_ATTRIBUTE_TESTED |
+ EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE |
+ EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE |
+ EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE |
+ EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE
),
BASE_1MB,
LowMemorySize
@@ -242,9 +246,9 @@ PostFspmHobProcess ( S3PeiMemBase = 0;
S3PeiMemSize = 0;
- Status = GetS3MemoryInfo (&S3PeiMemSize, &S3PeiMemBase);
+ Status = GetS3MemoryInfo (&S3PeiMemSize, &S3PeiMemBase);
ASSERT_EFI_ERROR (Status);
- DEBUG((DEBUG_INFO, "S3 memory %Xh - %Xh bytes\n", S3PeiMemBase, S3PeiMemSize));
+ DEBUG ((DEBUG_INFO, "S3 memory %Xh - %Xh bytes\n", S3PeiMemBase, S3PeiMemSize));
//
// Make sure Stack and PeiMemory are not overlap
@@ -257,20 +261,20 @@ PostFspmHobProcess ( ASSERT_EFI_ERROR (Status);
} else {
PeiMemSize = GetPeiMemSize (PeiServices, BootMode);
- DEBUG((DEBUG_INFO, "PEI memory size = %Xh bytes\n", PeiMemSize));
+ DEBUG ((DEBUG_INFO, "PEI memory size = %Xh bytes\n", PeiMemSize));
//
// Capsule mode
//
- Capsule = NULL;
- CapsuleBuffer = NULL;
+ Capsule = NULL;
+ CapsuleBuffer = NULL;
CapsuleBufferLength = 0;
if (BootMode == BOOT_ON_FLASH_UPDATE) {
Status = PeiServicesLocatePpi (
&gEfiPeiCapsulePpiGuid,
0,
NULL,
- (VOID **) &Capsule
+ (VOID **)&Capsule
);
ASSERT_EFI_ERROR (Status);
@@ -278,7 +282,7 @@ PostFspmHobProcess ( //
// Make sure Stack and CapsuleBuffer are not overlap
//
- CapsuleBuffer = (VOID *)(UINTN)BASE_1MB;
+ CapsuleBuffer = (VOID *)(UINTN)BASE_1MB;
CapsuleBufferLength = (UINTN)(LowMemorySize - PeiMemSize);
//
// Call the Capsule PPI Coalesce function to coalesce the capsule data.
@@ -288,7 +292,7 @@ PostFspmHobProcess ( }
RequiredMemSize = RetrieveRequiredMemorySize (PeiServices);
- DEBUG((DEBUG_INFO, "Required memory size = %Xh bytes\n", RequiredMemSize));
+ DEBUG ((DEBUG_INFO, "Required memory size = %Xh bytes\n", RequiredMemSize));
//
// Report the main memory
@@ -296,13 +300,13 @@ PostFspmHobProcess ( BuildResourceDescriptorHob (
EFI_RESOURCE_SYSTEM_MEMORY,
(
- EFI_RESOURCE_ATTRIBUTE_PRESENT |
- EFI_RESOURCE_ATTRIBUTE_INITIALIZED |
- EFI_RESOURCE_ATTRIBUTE_TESTED |
- EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE |
- EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE |
- EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE |
- EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE
+ EFI_RESOURCE_ATTRIBUTE_PRESENT |
+ EFI_RESOURCE_ATTRIBUTE_INITIALIZED |
+ EFI_RESOURCE_ATTRIBUTE_TESTED |
+ EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE |
+ EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE |
+ EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE |
+ EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE
),
BASE_1MB,
LowMemorySize
@@ -316,10 +320,10 @@ PostFspmHobProcess ( // Install efi memory
//
PeiMemBase = BASE_1MB + LowMemorySize - PeiMemSize;
- Status = PeiServicesInstallPeiMemory (
- PeiMemBase,
- PeiMemSize - RequiredMemSize
- );
+ Status = PeiServicesInstallPeiMemory (
+ PeiMemBase,
+ PeiMemSize - RequiredMemSize
+ );
ASSERT_EFI_ERROR (Status);
if (Capsule != NULL) {
@@ -338,7 +342,7 @@ PostFspmHobProcess ( **/
VOID
ProcessFspHobList (
- IN VOID *FspHobList
+ IN VOID *FspHobList
)
{
EFI_PEI_HOB_POINTERS FspHob;
@@ -353,14 +357,15 @@ ProcessFspHobList ( //
// Skip FSP binary creates PcdDataBaseHobGuid
//
- if (!CompareGuid(&FspHob.Guid->Name, &gPcdDataBaseHobGuid)) {
+ if (!CompareGuid (&FspHob.Guid->Name, &gPcdDataBaseHobGuid)) {
BuildGuidDataHob (
&FspHob.Guid->Name,
- GET_GUID_HOB_DATA(FspHob),
- GET_GUID_HOB_DATA_SIZE(FspHob)
- );
+ GET_GUID_HOB_DATA (FspHob),
+ GET_GUID_HOB_DATA_SIZE (FspHob)
+ );
}
}
+
FspHob.Raw = GET_NEXT_HOB (FspHob);
}
}
@@ -375,7 +380,7 @@ ProcessFspHobList ( EFI_STATUS
EFIAPI
PostFspsHobProcess (
- IN VOID *FspHobList
+ IN VOID *FspHobList
)
{
//
@@ -392,5 +397,6 @@ PostFspsHobProcess ( ASSERT (FspHobList != NULL);
ProcessFspHobList (FspHobList);
}
+
return EFI_SUCCESS;
}
diff --git a/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/FspWrapperPlatformSecLibSample.c b/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/FspWrapperPlatformSecLibSample.c index 0902cad..29d4bb7 100644 --- a/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/FspWrapperPlatformSecLibSample.c +++ b/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/FspWrapperPlatformSecLibSample.c @@ -29,9 +29,9 @@ EFI_STATUS
EFIAPI
SecPlatformInformation (
- IN CONST EFI_PEI_SERVICES **PeiServices,
- IN OUT UINT64 *StructureSize,
- OUT EFI_SEC_PLATFORM_INFORMATION_RECORD *PlatformInformationRecord
+ IN CONST EFI_PEI_SERVICES **PeiServices,
+ IN OUT UINT64 *StructureSize,
+ OUT EFI_SEC_PLATFORM_INFORMATION_RECORD *PlatformInformationRecord
);
/**
@@ -95,30 +95,30 @@ EFI_PEI_PPI_DESCRIPTOR mPeiSecPlatformPpi[] = { EFI_PEI_PPI_DESCRIPTOR *
EFIAPI
SecPlatformMain (
- IN OUT EFI_SEC_PEI_HAND_OFF *SecCoreData
+ IN OUT EFI_SEC_PEI_HAND_OFF *SecCoreData
)
{
- EFI_PEI_PPI_DESCRIPTOR *PpiList;
+ EFI_PEI_PPI_DESCRIPTOR *PpiList;
- DEBUG((DEBUG_INFO, "SecPlatformMain\n"));
+ DEBUG ((DEBUG_INFO, "SecPlatformMain\n"));
- DEBUG((DEBUG_INFO, "BootFirmwareVolumeBase - 0x%x\n", SecCoreData->BootFirmwareVolumeBase));
- DEBUG((DEBUG_INFO, "BootFirmwareVolumeSize - 0x%x\n", SecCoreData->BootFirmwareVolumeSize));
- DEBUG((DEBUG_INFO, "TemporaryRamBase - 0x%x\n", SecCoreData->TemporaryRamBase));
- DEBUG((DEBUG_INFO, "TemporaryRamSize - 0x%x\n", SecCoreData->TemporaryRamSize));
- DEBUG((DEBUG_INFO, "PeiTemporaryRamBase - 0x%x\n", SecCoreData->PeiTemporaryRamBase));
- DEBUG((DEBUG_INFO, "PeiTemporaryRamSize - 0x%x\n", SecCoreData->PeiTemporaryRamSize));
- DEBUG((DEBUG_INFO, "StackBase - 0x%x\n", SecCoreData->StackBase));
- DEBUG((DEBUG_INFO, "StackSize - 0x%x\n", SecCoreData->StackSize));
+ DEBUG ((DEBUG_INFO, "BootFirmwareVolumeBase - 0x%x\n", SecCoreData->BootFirmwareVolumeBase));
+ DEBUG ((DEBUG_INFO, "BootFirmwareVolumeSize - 0x%x\n", SecCoreData->BootFirmwareVolumeSize));
+ DEBUG ((DEBUG_INFO, "TemporaryRamBase - 0x%x\n", SecCoreData->TemporaryRamBase));
+ DEBUG ((DEBUG_INFO, "TemporaryRamSize - 0x%x\n", SecCoreData->TemporaryRamSize));
+ DEBUG ((DEBUG_INFO, "PeiTemporaryRamBase - 0x%x\n", SecCoreData->PeiTemporaryRamBase));
+ DEBUG ((DEBUG_INFO, "PeiTemporaryRamSize - 0x%x\n", SecCoreData->PeiTemporaryRamSize));
+ DEBUG ((DEBUG_INFO, "StackBase - 0x%x\n", SecCoreData->StackBase));
+ DEBUG ((DEBUG_INFO, "StackSize - 0x%x\n", SecCoreData->StackSize));
- InitializeApicTimer (0, (UINT32) -1, TRUE, 5);
+ InitializeApicTimer (0, (UINT32)-1, TRUE, 5);
//
// Use middle of Heap as temp buffer, it will be copied by caller.
// Do not use Stack, because it will cause wrong calculation on stack by PeiCore
//
PpiList = (VOID *)((UINTN)SecCoreData->PeiTemporaryRamBase + (UINTN)SecCoreData->PeiTemporaryRamSize/2);
- CopyMem (PpiList, mPeiSecPlatformPpi, sizeof(mPeiSecPlatformPpi));
+ CopyMem (PpiList, mPeiSecPlatformPpi, sizeof (mPeiSecPlatformPpi));
//
// Patch TopOfTemporaryRamPpi
diff --git a/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/Ia32/Fsp.h b/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/Ia32/Fsp.h index b654a47..d2af7a5 100644 --- a/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/Ia32/Fsp.h +++ b/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/Ia32/Fsp.h @@ -12,34 +12,34 @@ //
// Fv Header
//
-#define FVH_FV_LENGTH_OFFSET 0x20
-#define FVH_SIGINATURE_OFFSET 0x28
-#define FVH_SIGINATURE_VALID_VALUE 0x4856465F // valid signature:_FVH
-#define FVH_HEADER_LENGTH_OFFSET 0x30
-#define FVH_EXTHEADER_OFFSET_OFFSET 0x34
-#define FVH_EXTHEADER_SIZE_OFFSET 0x10
+#define FVH_FV_LENGTH_OFFSET 0x20
+#define FVH_SIGINATURE_OFFSET 0x28
+#define FVH_SIGINATURE_VALID_VALUE 0x4856465F // valid signature:_FVH
+#define FVH_HEADER_LENGTH_OFFSET 0x30
+#define FVH_EXTHEADER_OFFSET_OFFSET 0x34
+#define FVH_EXTHEADER_SIZE_OFFSET 0x10
//
// Ffs Header
//
-#define FSP_HEADER_SIGNATURE_OFFSET 0x1C
-#define FSP_HEADER_SIGNATURE 0x48505346 ; valid signature:FSPH
-#define FSP_HEADER_GUID_DWORD1 0x912740BE
-#define FSP_HEADER_GUID_DWORD2 0x47342284
-#define FSP_HEADER_GUID_DWORD3 0xB08471B9
-#define FSP_HEADER_GUID_DWORD4 0x0C3F3527
-#define FFS_HEADER_SIZE_VALUE 0x18
+#define FSP_HEADER_SIGNATURE_OFFSET 0x1C
+#define FSP_HEADER_SIGNATURE 0x48505346 ; valid signature:FSPH
+#define FSP_HEADER_GUID_DWORD1 0x912740BE
+#define FSP_HEADER_GUID_DWORD2 0x47342284
+#define FSP_HEADER_GUID_DWORD3 0xB08471B9
+#define FSP_HEADER_GUID_DWORD4 0x0C3F3527
+#define FFS_HEADER_SIZE_VALUE 0x18
//
// Section Header
//
-#define SECTION_HEADER_TYPE_OFFSET 0x03
-#define RAW_SECTION_HEADER_SIZE_VALUE 0x04
+#define SECTION_HEADER_TYPE_OFFSET 0x03
+#define RAW_SECTION_HEADER_SIZE_VALUE 0x04
//
// Fsp Header
//
-#define FSP_HEADER_IMAGEBASE_OFFSET 0x1C
-#define FSP_HEADER_TEMPRAMINIT_OFFSET 0x30
+#define FSP_HEADER_IMAGEBASE_OFFSET 0x1C
+#define FSP_HEADER_TEMPRAMINIT_OFFSET 0x30
#endif
diff --git a/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/PlatformInit.c b/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/PlatformInit.c index 0523d0c..eae4746 100644 --- a/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/PlatformInit.c +++ b/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/PlatformInit.c @@ -6,7 +6,6 @@ **/
-
#include <PiPei.h>
#include <Library/DebugLib.h>
#include <Library/SerialPortLib.h>
@@ -21,9 +20,9 @@ VOID
EFIAPI
PlatformInit (
- IN VOID *FspHobList,
- IN VOID *StartOfRange,
- IN VOID *EndOfRange
+ IN VOID *FspHobList,
+ IN VOID *StartOfRange,
+ IN VOID *EndOfRange
)
{
//
diff --git a/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecGetPerformance.c b/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecGetPerformance.c index 9ae15d1..6946f4a 100644 --- a/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecGetPerformance.c +++ b/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecGetPerformance.c @@ -53,7 +53,7 @@ SecGetPerformance ( &gTopOfTemporaryRamPpiGuid,
0,
NULL,
- (VOID **) &TopOfTemporaryRamPpi
+ (VOID **)&TopOfTemporaryRamPpi
);
if (EFI_ERROR (Status)) {
return EFI_NOT_FOUND;
@@ -72,12 +72,12 @@ SecGetPerformance ( // | TSC[31:00] |
// |--------------|
//
- TopOfTemporaryRam = (UINT32)(UINTN)TopOfTemporaryRamPpi - sizeof(UINT32);
- TopOfTemporaryRam -= sizeof(UINT32) * 2;
- Count = *(UINT32 *) (UINTN) (TopOfTemporaryRam - sizeof (UINT32));
- Size = Count * sizeof (UINT64);
+ TopOfTemporaryRam = (UINT32)(UINTN)TopOfTemporaryRamPpi - sizeof (UINT32);
+ TopOfTemporaryRam -= sizeof (UINT32) * 2;
+ Count = *(UINT32 *)(UINTN)(TopOfTemporaryRam - sizeof (UINT32));
+ Size = Count * sizeof (UINT64);
- Ticker = *(UINT64 *) (UINTN) (TopOfTemporaryRam - sizeof (UINT32) - Size - sizeof (UINT32) * 2);
+ Ticker = *(UINT64 *)(UINTN)(TopOfTemporaryRam - sizeof (UINT32) - Size - sizeof (UINT32) * 2);
Performance->ResetEnd = GetTimeInNanoSecond (Ticker);
return EFI_SUCCESS;
diff --git a/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecPlatformInformation.c b/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecPlatformInformation.c index 28e25fd..1406d0f 100644 --- a/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecPlatformInformation.c +++ b/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecPlatformInformation.c @@ -28,9 +28,9 @@ EFI_STATUS
EFIAPI
SecPlatformInformation (
- IN CONST EFI_PEI_SERVICES **PeiServices,
- IN OUT UINT64 *StructureSize,
- OUT EFI_SEC_PLATFORM_INFORMATION_RECORD *PlatformInformationRecord
+ IN CONST EFI_PEI_SERVICES **PeiServices,
+ IN OUT UINT64 *StructureSize,
+ OUT EFI_SEC_PLATFORM_INFORMATION_RECORD *PlatformInformationRecord
)
{
UINT32 *Bist;
@@ -47,7 +47,7 @@ SecPlatformInformation ( &gTopOfTemporaryRamPpiGuid,
0,
NULL,
- (VOID **) &TopOfTemporaryRamPpi
+ (VOID **)&TopOfTemporaryRamPpi
);
if (EFI_ERROR (Status)) {
return EFI_NOT_FOUND;
@@ -59,18 +59,18 @@ SecPlatformInformation ( // This routine copies the BIST information to the buffer pointed by
// PlatformInformationRecord for output.
//
- TopOfTemporaryRam = (UINT32)(UINTN)TopOfTemporaryRamPpi - sizeof (UINT32);
- TopOfTemporaryRam -= sizeof(UINT32) * 2;
- Count = *((UINT32 *)(UINTN) (TopOfTemporaryRam - sizeof (UINT32)));
- Size = Count * sizeof (IA32_HANDOFF_STATUS);
+ TopOfTemporaryRam = (UINT32)(UINTN)TopOfTemporaryRamPpi - sizeof (UINT32);
+ TopOfTemporaryRam -= sizeof (UINT32) * 2;
+ Count = *((UINT32 *)(UINTN)(TopOfTemporaryRam - sizeof (UINT32)));
+ Size = Count * sizeof (IA32_HANDOFF_STATUS);
- if ((*StructureSize) < (UINT64) Size) {
+ if ((*StructureSize) < (UINT64)Size) {
*StructureSize = Size;
return EFI_BUFFER_TOO_SMALL;
}
- *StructureSize = Size;
- Bist = (UINT32 *) (TopOfTemporaryRam - sizeof (UINT32) - Size);
+ *StructureSize = Size;
+ Bist = (UINT32 *)(TopOfTemporaryRam - sizeof (UINT32) - Size);
CopyMem (PlatformInformationRecord, Bist, Size);
diff --git a/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecRamInitData.c b/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecRamInitData.c index e57b5b5..03616cb 100644 --- a/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecRamInitData.c +++ b/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecRamInitData.c @@ -10,10 +10,10 @@ #include <FspEas.h>
typedef struct {
- UINT32 MicrocodeRegionBase;
- UINT32 MicrocodeRegionSize;
- UINT32 CodeRegionBase;
- UINT32 CodeRegionSize;
+ UINT32 MicrocodeRegionBase;
+ UINT32 MicrocodeRegionSize;
+ UINT32 CodeRegionBase;
+ UINT32 CodeRegionSize;
} FSPT_CORE_UPD;
typedef struct {
@@ -25,7 +25,7 @@ typedef struct { FSPT_CORE_UPD FsptCoreUpd;
} FSPT_UPD_CORE_DATA;
-GLOBAL_REMOVE_IF_UNREFERENCED CONST FSPT_UPD_CORE_DATA FsptUpdDataPtr = {
+GLOBAL_REMOVE_IF_UNREFERENCED CONST FSPT_UPD_CORE_DATA FsptUpdDataPtr = {
{
0x4450555F54505346,
//
@@ -33,8 +33,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED CONST FSPT_UPD_CORE_DATA FsptUpdDataPtr = { //
0x02,
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
- }
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }
},
//
// If platform does not support FSP spec 2.2 remove FSPT_ARCH_UPD structure.
@@ -58,4 +57,3 @@ GLOBAL_REMOVE_IF_UNREFERENCED CONST FSPT_UPD_CORE_DATA FsptUpdDataPtr = { FixedPcdGet32 (PcdFlashCodeCacheSize),
}
};
-
diff --git a/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecTempRamDone.c b/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecTempRamDone.c index eafbadb..ef426b3 100644 --- a/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecTempRamDone.c +++ b/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecTempRamDone.c @@ -23,21 +23,21 @@ SecPlatformDisableTemporaryMemory ( VOID
)
{
- EFI_STATUS Status;
- VOID *TempRamExitParam;
- FSP_INFO_HEADER *FspHeader;
+ EFI_STATUS Status;
+ VOID *TempRamExitParam;
+ FSP_INFO_HEADER *FspHeader;
- FspHeader = FspFindFspHeader (PcdGet32(PcdFspmBaseAddress));
+ FspHeader = FspFindFspHeader (PcdGet32 (PcdFspmBaseAddress));
if (FspHeader == NULL) {
- return ;
+ return;
}
- DEBUG((DEBUG_INFO, "SecPlatformDisableTemporaryMemory enter\n"));
+ DEBUG ((DEBUG_INFO, "SecPlatformDisableTemporaryMemory enter\n"));
TempRamExitParam = UpdateTempRamExitParam ();
- Status = CallTempRamExit (TempRamExitParam);
- DEBUG((DEBUG_INFO, "TempRamExit status: 0x%x\n", Status));
- ASSERT_EFI_ERROR(Status);
+ Status = CallTempRamExit (TempRamExitParam);
+ DEBUG ((DEBUG_INFO, "TempRamExit status: 0x%x\n", Status));
+ ASSERT_EFI_ERROR (Status);
- return ;
+ return;
}
|