]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPlatformPkg/PrePi/PrePi.c
ArmPlatformPkg: Store initial timer value
[mirror_edk2.git] / ArmPlatformPkg / PrePi / PrePi.c
index e548ccace09730b78851b987d7b902a5bb7a84c5..e5016ea45359f74e7688adb2504784070dde0dce 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 *\r
-*  Copyright (c) 2011-2014, ARM Limited. All rights reserved.\r
+*  Copyright (c) 2011-2017, ARM Limited. All rights reserved.\r
 *\r
 *  This program and the accompanying materials\r
 *  are licensed and made available under the terms and conditions of the BSD License\r
@@ -24,6 +24,7 @@
 \r
 #include <Ppi/GuidedSectionExtraction.h>\r
 #include <Ppi/ArmMpCoreInfo.h>\r
+#include <Ppi/SecPerformance.h>\r
 #include <Guid/LzmaDecompress.h>\r
 \r
 #include "PrePi.h"\r
@@ -86,6 +87,7 @@ PrePiMain (
   CHAR8                         Buffer[100];\r
   UINTN                         CharCount;\r
   UINTN                         StacksSize;\r
+  FIRMWARE_SEC_PERFORMANCE      Performance;\r
 \r
   // If ensure the FD is either part of the System Memory or totally outside of the System Memory (XIP)\r
   ASSERT (IS_XIP() ||\r
@@ -146,6 +148,12 @@ PrePiMain (
     }\r
   }\r
 \r
+  // Store timer value logged at the beginning of firmware image execution\r
+  Performance.ResetEnd = GetTimeInNanoSecond (StartTimeStamp);\r
+\r
+  // Build SEC Performance Data Hob\r
+  BuildGuidDataHob (&gEfiFirmwarePerformanceGuid, &Performance, sizeof (Performance));\r
+\r
   // Set the Boot Mode\r
   SetBootMode (ArmPlatformGetBootMode ());\r
 \r