24#define FSP_API_NOTIFY_PHASE_AFTER_PCI_ENUMERATION BIT16
28(EFIAPI *ADD_PERFORMANCE_RECORDS)(
33 ADD_PERFORMANCE_RECORDS AddPerformanceRecords;
38extern EFI_GUID gAddPerfRecordProtocolGuid;
40extern EFI_GUID gFspApiPerformanceGuid;
81 Status =
gBS->LocateProtocol (
82 &gEfiPciEnumerationCompleteProtocolGuid,
86 if (EFI_ERROR (Status)) {
91 PERF_START_EX (&gFspApiPerformanceGuid,
"EventRec",
NULL, 0, FSP_STATUS_CODE_POST_PCIE_ENUM_NOTIFICATION | FSP_STATUS_CODE_COMMON_CODE | FSP_STATUS_CODE_API_ENTRY);
93 PERF_END_EX (&gFspApiPerformanceGuid,
"EventRec",
NULL, 0, FSP_STATUS_CODE_POST_PCIE_ENUM_NOTIFICATION | FSP_STATUS_CODE_COMMON_CODE | FSP_STATUS_CODE_API_EXIT);
98 if ((Status >= FSP_STATUS_RESET_REQUIRED_COLD) && (Status <= FSP_STATUS_RESET_REQUIRED_8)) {
99 DEBUG ((DEBUG_INFO,
"FSP NotifyPhase AfterPciEnumeration requested reset 0x%x\n", Status));
104 DEBUG ((DEBUG_ERROR,
"FSP NotifyPhase AfterPciEnumeration failed, status: 0x%x\n", Status));
106 DEBUG ((DEBUG_INFO,
"FSP NotifyPhase AfterPciEnumeration Success.\n"));
131 gBS->CloseEvent (Event);
134 PERF_START_EX (&gFspApiPerformanceGuid,
"EventRec",
NULL, 0, FSP_STATUS_CODE_READY_TO_BOOT_NOTIFICATION | FSP_STATUS_CODE_COMMON_CODE | FSP_STATUS_CODE_API_ENTRY);
136 PERF_END_EX (&gFspApiPerformanceGuid,
"EventRec",
NULL, 0, FSP_STATUS_CODE_READY_TO_BOOT_NOTIFICATION | FSP_STATUS_CODE_COMMON_CODE | FSP_STATUS_CODE_API_EXIT);
141 if ((Status >= FSP_STATUS_RESET_REQUIRED_COLD) && (Status <= FSP_STATUS_RESET_REQUIRED_8)) {
142 DEBUG ((DEBUG_INFO,
"FSP NotifyPhase ReadyToBoot requested reset 0x%x\n", Status));
147 DEBUG ((DEBUG_ERROR,
"FSP NotifyPhase ReadyToBoot failed, status: 0x%x\n", Status));
149 DEBUG ((DEBUG_INFO,
"FSP NotifyPhase ReadyToBoot Success.\n"));
173 VOID **FspHobListPtr;
175 gBS->CloseEvent (Event);
178 PERF_START_EX (&gFspApiPerformanceGuid,
"EventRec",
NULL, 0, FSP_STATUS_CODE_END_OF_FIRMWARE_NOTIFICATION | FSP_STATUS_CODE_COMMON_CODE | FSP_STATUS_CODE_API_ENTRY);
180 PERF_END_EX (&gFspApiPerformanceGuid,
"EventRec",
NULL, 0, FSP_STATUS_CODE_END_OF_FIRMWARE_NOTIFICATION | FSP_STATUS_CODE_COMMON_CODE | FSP_STATUS_CODE_API_EXIT);
185 if ((Status >= FSP_STATUS_RESET_REQUIRED_COLD) && (Status <= FSP_STATUS_RESET_REQUIRED_8)) {
186 DEBUG ((DEBUG_INFO,
"FSP NotifyPhase EndOfFirmware requested reset 0x%x\n", Status));
191 DEBUG ((DEBUG_ERROR,
"FSP NotifyPhase EndOfFirmware failed, status: 0x%x\n", Status));
193 DEBUG ((DEBUG_INFO,
"FSP NotifyPhase EndOfFirmware Success.\n"));
196 Status =
gBS->LocateProtocol (
197 &gAddPerfRecordProtocolGuid,
199 (VOID **)&AddPerfRecordInterface
201 if (EFI_ERROR (Status)) {
202 DEBUG ((DEBUG_INFO,
"gAddPerfRecordProtocolGuid - Locate protocol failed\n"));
206 if (Hob.Raw !=
NULL) {
207 FspHobListPtr = GET_GUID_HOB_DATA (Hob.Raw);
208 AddPerfRecordInterface->AddPerformanceRecords ((VOID *)(
UINTN)(((UINT32)(
UINTN)*FspHobListPtr) & 0xFFFFFFFF));
242 if (EFI_ERROR (Status)) {
246 FspApiMask =
PcdGet32 (PcdSkipFspApi);
247 if ((FspApiMask & FSP_API_NOTIFY_PHASE_AFTER_PCI_ENUMERATION) == 0) {
249 &gEfiPciEnumerationCompleteProtocolGuid,
255 ASSERT (ProtocolNotifyEvent !=
NULL);
266 Status =
gBS->CreateEventEx (
271 &gEfiEventExitBootServicesGuid,
272 &mExitBootServicesEvent
VOID *EFIAPI GetFirstGuidHob(IN CONST EFI_GUID *Guid)
@ EnumInitPhaseAfterPciEnumeration
@ EnumInitPhaseReadyToBoot
@ EnumInitPhaseEndOfFirmware
EFI_STATUS EFIAPI CallFspNotifyPhase(IN NOTIFY_PHASE_PARAMS *NotifyPhaseParams)
VOID EFIAPI OnEndOfFirmware(IN EFI_EVENT Event, IN VOID *Context)
EFI_STATUS EFIAPI FspWrapperNotifyDxeEntryPoint(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
VOID EFIAPI OnReadyToBoot(IN EFI_EVENT Event, IN VOID *Context)
EFI_STATUS RelocateImageUnder4GIfNeeded(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
VOID EFIAPI OnPciEnumerationComplete(IN EFI_EVENT Event, IN VOID *Context)
#define ASSERT_EFI_ERROR(StatusParameter)
#define DEBUG(Expression)
#define PcdGet32(TokenName)
EFI_STATUS EFIAPI EfiCreateEventReadyToBootEx(IN EFI_TPL NotifyTpl, IN EFI_EVENT_NOTIFY NotifyFunction OPTIONAL, IN VOID *NotifyContext OPTIONAL, OUT EFI_EVENT *ReadyToBootEvent)
EFI_EVENT EFIAPI EfiCreateProtocolNotifyEvent(IN EFI_GUID *ProtocolGuid, IN EFI_TPL NotifyTpl, IN EFI_EVENT_NOTIFY NotifyFunction, IN VOID *NotifyContext OPTIONAL, OUT VOID **Registration)