summaryrefslogtreecommitdiffstats
path: root/UefiCpuPkg/SecCore/SecMain.c
diff options
context:
space:
mode:
authorStar Zeng <star.zeng@intel.com>2017-07-28 10:05:08 +0800
committerStar Zeng <star.zeng@intel.com>2017-08-01 17:49:18 +0800
commitf2e70629742fe1d387186d9f2bb5cdb338b46009 (patch)
tree871965c6e44a230176973e9149e8561e9d2b22c7 /UefiCpuPkg/SecCore/SecMain.c
parent9e9ca2100f22be29f1a53129d741f4305ff34a71 (diff)
downloadedk2-f2e70629742fe1d387186d9f2bb5cdb338b46009.tar.gz
edk2-f2e70629742fe1d387186d9f2bb5cdb338b46009.tar.bz2
edk2-f2e70629742fe1d387186d9f2bb5cdb338b46009.zip
UefiCpuPkg SecCore: Add SecPerformancePpiCallBack
Add SecPerformancePpiCallBack to get SEC performance data and build HOB to convey the SEC performance data to DXE phase. Cc: Liming Gao <liming.gao@intel.com> Cc: Jeff Fan <jeff.fan@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'UefiCpuPkg/SecCore/SecMain.c')
-rw-r--r--UefiCpuPkg/SecCore/SecMain.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/UefiCpuPkg/SecCore/SecMain.c b/UefiCpuPkg/SecCore/SecMain.c
index 18b7782bb8..e9e243ca05 100644
--- a/UefiCpuPkg/SecCore/SecMain.c
+++ b/UefiCpuPkg/SecCore/SecMain.c
@@ -22,6 +22,14 @@ EFI_SEC_PLATFORM_INFORMATION_PPI mSecPlatformInformationPpi = { SecPlatformInfo
EFI_PEI_PPI_DESCRIPTOR mPeiSecPlatformInformationPpi[] = {
{
+ //
+ // SecPerformance PPI notify descriptor.
+ //
+ EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK,
+ &gPeiSecPerformancePpiGuid,
+ (VOID *) (UINTN) SecPerformancePpiCallBack
+ },
+ {
EFI_PEI_PPI_DESCRIPTOR_PPI,
&gEfiTemporaryRamDonePpiGuid,
&gSecTemporaryRamDonePpi
@@ -56,6 +64,44 @@ SecStartupPhase2(
);
/**
+ Entry point of the notification callback function itself within the PEIM.
+ It is to get SEC performance data and build HOB to convey the SEC performance
+ data to DXE phase.
+
+ @param PeiServices Indirect reference to the PEI Services Table.
+ @param NotifyDescriptor Address of the notification descriptor data structure.
+ @param Ppi Address of the PPI that was installed.
+
+ @return Status of the notification.
+ The status code returned from this function is ignored.
+**/
+EFI_STATUS
+EFIAPI
+SecPerformancePpiCallBack (
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor,
+ IN VOID *Ppi
+ )
+{
+ EFI_STATUS Status;
+ PEI_SEC_PERFORMANCE_PPI *SecPerf;
+ FIRMWARE_SEC_PERFORMANCE Performance;
+
+ SecPerf = (PEI_SEC_PERFORMANCE_PPI *) Ppi;
+ Status = SecPerf->GetPerformance ((CONST EFI_PEI_SERVICES **) PeiServices, SecPerf, &Performance);
+ if (!EFI_ERROR (Status)) {
+ BuildGuidDataHob (
+ &gEfiFirmwarePerformanceGuid,
+ &Performance,
+ sizeof (FIRMWARE_SEC_PERFORMANCE)
+ );
+ DEBUG ((DEBUG_INFO, "FPDT: SEC Performance Hob ResetEnd = %ld\n", Performance.ResetEnd));
+ }
+
+ return Status;
+}
+
+/**
Entry point to the C language phase of SEC. After the SEC assembly
code has initialized some temporary memory and set up the stack,