TianoCore EDK2 master
Loading...
Searching...
No Matches
FirmwarePerformanceDxe.c File Reference
#include <PiDxe.h>
#include <Protocol/ReportStatusCodeHandler.h>
#include <Protocol/AcpiTable.h>
#include <Protocol/LockBox.h>
#include <Protocol/Variable.h>
#include <Protocol/VariablePolicy.h>
#include <Guid/Acpi.h>
#include <Guid/FirmwarePerformance.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Library/BaseLib.h>
#include <Library/DebugLib.h>
#include <Library/DxeServicesLib.h>
#include <Library/TimerLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/PcdLib.h>
#include <Library/HobLib.h>
#include <Library/LockBoxLib.h>
#include <Library/UefiLib.h>
#include <Library/VariablePolicyHelperLib.h>
#include <Library/PerformanceLib.h>

Go to the source code of this file.

Macros

#define SMM_BOOT_RECORD_COMM_SIZE   (OFFSET_OF (EFI_SMM_COMMUNICATE_HEADER, Data) + sizeof(SMM_BOOT_RECORD_COMMUNICATE))
 

Functions

VOID FpdtAcpiTableChecksum (IN UINT8 *Buffer, IN UINTN Size)
 
VOID EFIAPI FpdtAllocateS3PerformanceTableMemory (IN EFI_EVENT Event, IN VOID *Context)
 
EFI_STATUS InstallFirmwarePerformanceDataTable (VOID)
 
EFI_STATUS EFIAPI FpdtStatusCodeListenerDxe (IN EFI_STATUS_CODE_TYPE CodeType, IN EFI_STATUS_CODE_VALUE Value, IN UINT32 Instance, IN EFI_GUID *CallerId, IN EFI_STATUS_CODE_DATA *Data)
 
VOID EFIAPI FpdtEndOfDxeEventNotify (IN EFI_EVENT Event, IN VOID *Context)
 
VOID EFIAPI FpdtExitBootServicesEventNotify (IN EFI_EVENT Event, IN VOID *Context)
 
EFI_STATUS EFIAPI FirmwarePerformanceDxeEntryPoint (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 

Variables

EFI_RSC_HANDLER_PROTOCOLmRscHandlerProtocol = NULL
 
BOOLEAN mLockBoxReady = FALSE
 
EFI_EVENT mReadyToBootEvent
 
EFI_EVENT mLegacyBootEvent
 
UINTN mFirmwarePerformanceTableTemplateKey = 0
 
BOOLEAN mDxeCoreReportStatusCodeEnable = FALSE
 
BOOT_PERFORMANCE_TABLEmAcpiBootPerformanceTable = NULL
 
BOOT_PERFORMANCE_TABLEmReceivedAcpiBootPerformanceTable = NULL
 
S3_PERFORMANCE_TABLEmAcpiS3PerformanceTable = NULL
 
FIRMWARE_PERFORMANCE_TABLE mFirmwarePerformanceTableTemplate
 
BOOT_PERFORMANCE_TABLE mBootPerformanceTableTemplate
 
S3_PERFORMANCE_TABLE mS3PerformanceTableTemplate
 

Detailed Description

This module install ACPI Firmware Performance Data Table (FPDT).

This module register report status code listener to collect performance data for Firmware Basic Boot Performance Record and other boot performance records, and install FPDT to ACPI table.

Copyright (c) 2011 - 2021, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file FirmwarePerformanceDxe.c.

Macro Definition Documentation

◆ SMM_BOOT_RECORD_COMM_SIZE

#define SMM_BOOT_RECORD_COMM_SIZE   (OFFSET_OF (EFI_SMM_COMMUNICATE_HEADER, Data) + sizeof(SMM_BOOT_RECORD_COMMUNICATE))

Definition at line 39 of file FirmwarePerformanceDxe.c.

Function Documentation

◆ FirmwarePerformanceDxeEntryPoint()

EFI_STATUS EFIAPI FirmwarePerformanceDxeEntryPoint ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

The module Entry Point of the Firmware Performance Data Table DXE driver.

Parameters
[in]ImageHandleThe firmware allocated handle for the EFI image.
[in]SystemTableA pointer to the EFI System Table.
Return values
EFI_SUCCESSThe entry point is executed successfully.
OtherSome error occurs when executing this entry point.

Definition at line 649 of file FirmwarePerformanceDxe.c.

◆ FpdtAcpiTableChecksum()

VOID FpdtAcpiTableChecksum ( IN UINT8 *  Buffer,
IN UINTN  Size 
)

This function calculates and updates an UINT8 checksum.

Parameters
[in]BufferPointer to buffer to checksum
[in]SizeNumber of bytes to checksum

Definition at line 158 of file FirmwarePerformanceDxe.c.

◆ FpdtAllocateS3PerformanceTableMemory()

VOID EFIAPI FpdtAllocateS3PerformanceTableMemory ( IN EFI_EVENT  Event,
IN VOID *  Context 
)

Callback function upon VariableArchProtocol and LockBoxProtocol to allocate S3 performance table memory and save the pointer to LockBox.

Parameters
[in]EventEvent whose notification function is being invoked.
[in]ContextPointer to the notification function's context.

Definition at line 187 of file FirmwarePerformanceDxe.c.

◆ FpdtEndOfDxeEventNotify()

VOID EFIAPI FpdtEndOfDxeEventNotify ( IN EFI_EVENT  Event,
IN VOID *  Context 
)

Notify function for event EndOfDxe.

This is used to install ACPI Firmware Performance Data Table for basic boot records.

Parameters
[in]EventThe Event that is being processed.
[in]ContextThe Event Context.

Definition at line 573 of file FirmwarePerformanceDxe.c.

◆ FpdtExitBootServicesEventNotify()

VOID EFIAPI FpdtExitBootServicesEventNotify ( IN EFI_EVENT  Event,
IN VOID *  Context 
)

Notify function for event EVT_SIGNAL_EXIT_BOOT_SERVICES. This is used to record performance data for ExitBootServicesEntry in FPDT.

Parameters
[in]EventThe Event that is being processed.
[in]ContextThe Event Context.

Definition at line 600 of file FirmwarePerformanceDxe.c.

◆ FpdtStatusCodeListenerDxe()

EFI_STATUS EFIAPI FpdtStatusCodeListenerDxe ( IN EFI_STATUS_CODE_TYPE  CodeType,
IN EFI_STATUS_CODE_VALUE  Value,
IN UINT32  Instance,
IN EFI_GUID CallerId,
IN EFI_STATUS_CODE_DATA Data 
)

Report status code listener of FPDT. This is used to collect performance data for OsLoaderLoadImageStart and OsLoaderStartImageStart in FPDT.

Parameters
[in]CodeTypeIndicates the type of status code being reported.
[in]ValueDescribes the current status of a hardware or software entity. This included information about the class and subclass that is used to classify the entity as well as an operation.
[in]InstanceThe enumeration of a hardware or software entity within the system. Valid instance numbers start with 1.
[in]CallerIdThis optional parameter may be used to identify the caller. This parameter allows the status code driver to apply different rules to different callers.
[in]DataThis optional parameter may be used to pass additional data.
Return values
EFI_SUCCESSStatus code is what we expected.
EFI_UNSUPPORTEDStatus code not supported.

Definition at line 456 of file FirmwarePerformanceDxe.c.

◆ InstallFirmwarePerformanceDataTable()

EFI_STATUS InstallFirmwarePerformanceDataTable ( VOID  )

Install ACPI Firmware Performance Data Table (FPDT).

Returns
Status code.

Definition at line 282 of file FirmwarePerformanceDxe.c.

Variable Documentation

◆ mAcpiBootPerformanceTable

BOOT_PERFORMANCE_TABLE* mAcpiBootPerformanceTable = NULL

Definition at line 50 of file FirmwarePerformanceDxe.c.

◆ mAcpiS3PerformanceTable

S3_PERFORMANCE_TABLE* mAcpiS3PerformanceTable = NULL

Definition at line 52 of file FirmwarePerformanceDxe.c.

◆ mBootPerformanceTableTemplate

BOOT_PERFORMANCE_TABLE mBootPerformanceTableTemplate
Initial value:
= {
{
},
{
{
EFI_ACPI_5_0_FPDT_RUNTIME_RECORD_TYPE_FIRMWARE_BASIC_BOOT,
EFI_ACPI_5_0_FPDT_RUNTIME_RECORD_REVISION_FIRMWARE_BASIC_BOOT
},
0,
0,
0,
0,
0,
0
}
}
#define EFI_ACPI_5_0_FPDT_BOOT_PERFORMANCE_TABLE_SIGNATURE
Definition: Acpi50.h:1225

Definition at line 95 of file FirmwarePerformanceDxe.c.

◆ mDxeCoreReportStatusCodeEnable

BOOLEAN mDxeCoreReportStatusCodeEnable = FALSE

Definition at line 48 of file FirmwarePerformanceDxe.c.

◆ mFirmwarePerformanceTableTemplate

FIRMWARE_PERFORMANCE_TABLE mFirmwarePerformanceTableTemplate

Definition at line 54 of file FirmwarePerformanceDxe.c.

◆ mFirmwarePerformanceTableTemplateKey

UINTN mFirmwarePerformanceTableTemplateKey = 0

Definition at line 47 of file FirmwarePerformanceDxe.c.

◆ mLegacyBootEvent

EFI_EVENT mLegacyBootEvent

Definition at line 45 of file FirmwarePerformanceDxe.c.

◆ mLockBoxReady

BOOLEAN mLockBoxReady = FALSE

Definition at line 43 of file FirmwarePerformanceDxe.c.

◆ mReadyToBootEvent

EFI_EVENT mReadyToBootEvent

Definition at line 44 of file FirmwarePerformanceDxe.c.

◆ mReceivedAcpiBootPerformanceTable

BOOT_PERFORMANCE_TABLE* mReceivedAcpiBootPerformanceTable = NULL

Definition at line 51 of file FirmwarePerformanceDxe.c.

◆ mRscHandlerProtocol

EFI_RSC_HANDLER_PROTOCOL* mRscHandlerProtocol = NULL

Definition at line 41 of file FirmwarePerformanceDxe.c.

◆ mS3PerformanceTableTemplate

S3_PERFORMANCE_TABLE mS3PerformanceTableTemplate

Definition at line 118 of file FirmwarePerformanceDxe.c.