TianoCore EDK2 master
Loading...
Searching...
No Matches
FirmwarePerformanceCommon.c File Reference

Go to the source code of this file.

Functions

EFI_STATUS EFIAPI FpdtStatusCodeListenerMm (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)
 
EFI_STATUS FirmwarePerformanceCommonEntryPoint (VOID)
 

Variables

EFI_MM_RSC_HANDLER_PROTOCOLmRscHandlerProtocol = NULL
 
UINT64 mSuspendStartTime = 0
 
BOOLEAN mS3SuspendLockBoxSaved = FALSE
 

Detailed Description

This module collects performance data for MM driver boot records and S3 Suspend Performance Record.

This module registers report status code listener to collect performance data for MM driver boot records and S3 Suspend Performance Record.

Caution: This module requires additional review when modified. This driver will have external input - communicate buffer in MM mode. This external input must be validated carefully to avoid security issue like buffer overflow, integer overflow.

FpdtSmiHandler() will receive untrusted input and do basic validation.

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

Definition in file FirmwarePerformanceCommon.c.

Function Documentation

◆ FirmwarePerformanceCommonEntryPoint()

EFI_STATUS FirmwarePerformanceCommonEntryPoint ( VOID  )

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

Return values
EFI_SUCCESSThe entry point is executed successfully.
OtherSome error occurs when executing this entry point.

Definition at line 141 of file FirmwarePerformanceCommon.c.

◆ FpdtStatusCodeListenerMm()

EFI_STATUS EFIAPI FpdtStatusCodeListenerMm ( 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 for MM. This is used to record the performance data for S3 Suspend Start and S3 Suspend End 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 59 of file FirmwarePerformanceCommon.c.

Variable Documentation

◆ mRscHandlerProtocol

EFI_MM_RSC_HANDLER_PROTOCOL* mRscHandlerProtocol = NULL

Definition at line 34 of file FirmwarePerformanceCommon.c.

◆ mS3SuspendLockBoxSaved

BOOLEAN mS3SuspendLockBoxSaved = FALSE

Definition at line 36 of file FirmwarePerformanceCommon.c.

◆ mSuspendStartTime

UINT64 mSuspendStartTime = 0

Definition at line 35 of file FirmwarePerformanceCommon.c.