SecurityPkg/Tcg: Add use case for new Perf macro

Add an example case for the usage of
PERF_CALLBACK_BEGIN/PERF_CALLBACK_END

Cc: Liming Gao <liming.gao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Chao Zhang<chao.b.zhang@intel.com>
This commit is contained in:
Dandan Bi 2018-07-17 13:09:02 +08:00 committed by Liming Gao
parent 05aba7e37b
commit d9c5beb159
3 changed files with 10 additions and 0 deletions

View File

@ -161,6 +161,8 @@ EndofPeiSignalNotifyCallBack (
MeasuredHobData = NULL; MeasuredHobData = NULL;
PERF_CALLBACK_BEGIN (&gEfiEndOfPeiSignalPpiGuid);
// //
// Create a Guid hob to save all measured Fv // Create a Guid hob to save all measured Fv
// //
@ -186,6 +188,8 @@ EndofPeiSignalNotifyCallBack (
CopyMem (&MeasuredHobData->MeasuredFvBuf[mMeasuredBaseFvIndex] , mMeasuredChildFvInfo, sizeof(EFI_PLATFORM_FIRMWARE_BLOB) * (mMeasuredChildFvIndex)); CopyMem (&MeasuredHobData->MeasuredFvBuf[mMeasuredBaseFvIndex] , mMeasuredChildFvInfo, sizeof(EFI_PLATFORM_FIRMWARE_BLOB) * (mMeasuredChildFvIndex));
} }
PERF_CALLBACK_END (&gEfiEndOfPeiSignalPpiGuid);
return EFI_SUCCESS; return EFI_SUCCESS;
} }

View File

@ -41,6 +41,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Library/Tpm12DeviceLib.h> #include <Library/Tpm12DeviceLib.h>
#include <Library/Tpm12CommandLib.h> #include <Library/Tpm12CommandLib.h>
#include <Library/BaseCryptLib.h> #include <Library/BaseCryptLib.h>
#include <Library/PerformanceLib.h>
BOOLEAN mImageInMemory = FALSE; BOOLEAN mImageInMemory = FALSE;
@ -170,6 +171,8 @@ EndofPeiSignalNotifyCallBack (
MeasuredHobData = NULL; MeasuredHobData = NULL;
PERF_CALLBACK_BEGIN (&gEfiEndOfPeiSignalPpiGuid);
// //
// Create a Guid hob to save all measured Fv // Create a Guid hob to save all measured Fv
// //
@ -195,6 +198,8 @@ EndofPeiSignalNotifyCallBack (
CopyMem (&MeasuredHobData->MeasuredFvBuf[mMeasuredBaseFvIndex] , mMeasuredChildFvInfo, sizeof(EFI_PLATFORM_FIRMWARE_BLOB) * (mMeasuredChildFvIndex)); CopyMem (&MeasuredHobData->MeasuredFvBuf[mMeasuredBaseFvIndex] , mMeasuredChildFvInfo, sizeof(EFI_PLATFORM_FIRMWARE_BLOB) * (mMeasuredChildFvIndex));
} }
PERF_CALLBACK_END (&gEfiEndOfPeiSignalPpiGuid);
return EFI_SUCCESS; return EFI_SUCCESS;
} }

View File

@ -56,6 +56,7 @@
MemoryAllocationLib MemoryAllocationLib
ReportStatusCodeLib ReportStatusCodeLib
Tpm12CommandLib Tpm12CommandLib
PerformanceLib
[Guids] [Guids]
gTcgEventEntryHobGuid ## PRODUCES ## HOB gTcgEventEntryHobGuid ## PRODUCES ## HOB