2011-03-10 07:39:51 +00:00
|
|
|
/** @file
|
|
|
|
|
Performance Library used in SMM phase.
|
|
|
|
|
|
|
|
|
|
This library instance provides infrastructure for SMM drivers to log performance
|
2012-04-24 09:12:36 +00:00
|
|
|
data. It consumes SMM PerformanceEx or Performance Protocol published by SmmCorePerformanceLib
|
|
|
|
|
to log performance data. If both SMM PerformanceEx and Performance Protocol are not available, it does not log any
|
2011-03-10 07:39:51 +00:00
|
|
|
performance information.
|
|
|
|
|
|
2023-05-31 18:18:45 +08:00
|
|
|
Copyright (c) 2011 - 2023, Intel Corporation. All rights reserved.<BR>
|
2025-02-03 10:03:40 -05:00
|
|
|
Copyright (c) Microsoft Corporation.
|
2019-04-03 16:05:13 -07:00
|
|
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
2011-03-10 07:39:51 +00:00
|
|
|
|
|
|
|
|
**/
|
|
|
|
|
|
2025-02-03 10:03:40 -05:00
|
|
|
#include <PiMm.h>
|
|
|
|
|
#include <Protocol/SmmExitBootServices.h>
|
|
|
|
|
#include "SmmPerformanceLibInternal.h"
|
2011-03-10 07:39:51 +00:00
|
|
|
|
|
|
|
|
/**
|
2025-02-03 10:03:40 -05:00
|
|
|
The constructor function initializes the Performance Measurement Enable flag.
|
2011-03-10 07:39:51 +00:00
|
|
|
|
2025-02-03 10:03:40 -05:00
|
|
|
@param[in] ImageHandle The firmware allocated handle for the EFI image.
|
|
|
|
|
@param[in] SystemTable A pointer to the EFI System Table.
|
2011-03-10 07:39:51 +00:00
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.
|
|
|
|
|
|
|
|
|
|
**/
|
|
|
|
|
EFI_STATUS
|
|
|
|
|
EFIAPI
|
|
|
|
|
SmmPerformanceLibConstructor (
|
|
|
|
|
IN EFI_HANDLE ImageHandle,
|
|
|
|
|
IN EFI_SYSTEM_TABLE *SystemTable
|
|
|
|
|
)
|
|
|
|
|
{
|
2025-02-03 10:03:40 -05:00
|
|
|
return RegisterExitBootServicesCallback (&gEdkiiSmmExitBootServicesProtocolGuid);
|
2023-05-31 18:18:45 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
The destructor function frees resources allocated by constructor.
|
|
|
|
|
|
2025-02-03 10:03:40 -05:00
|
|
|
@param[in] ImageHandle The firmware allocated handle for the EFI image.
|
|
|
|
|
@param[in] SystemTable A pointer to the EFI System Table.
|
2023-05-31 18:18:45 +08:00
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS The destructor always returns EFI_SUCCESS.
|
2025-02-03 10:03:40 -05:00
|
|
|
|
2023-05-31 18:18:45 +08:00
|
|
|
**/
|
|
|
|
|
EFI_STATUS
|
|
|
|
|
EFIAPI
|
|
|
|
|
SmmPerformanceLibDestructor (
|
|
|
|
|
IN EFI_HANDLE ImageHandle,
|
|
|
|
|
IN EFI_SYSTEM_TABLE *SystemTable
|
|
|
|
|
)
|
|
|
|
|
{
|
2025-02-03 10:03:40 -05:00
|
|
|
return UnregisterExitBootServicesCallback (&gEdkiiSmmExitBootServicesProtocolGuid);
|
2018-06-22 16:56:19 +08:00
|
|
|
}
|