]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Add supported for performance libraries.
authorandrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 13 Apr 2010 22:28:14 +0000 (22:28 +0000)
committerandrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 13 Apr 2010 22:28:14 +0000 (22:28 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10367 6f19259b-4bc3-4df7-8a09-765794883524

EmbeddedPkg/Library/PrePiHobLib/Hob.c [new file with mode: 0644]
EmbeddedPkg/Library/PrePiHobLib/PrePiHobLib.inf [new file with mode: 0644]
EmbeddedPkg/Library/PrePiLib/PrePi.h
EmbeddedPkg/Library/PrePiLib/PrePiLib.c
EmbeddedPkg/Library/PrePiLib/PrePiLib.inf

diff --git a/EmbeddedPkg/Library/PrePiHobLib/Hob.c b/EmbeddedPkg/Library/PrePiHobLib/Hob.c
new file mode 100644 (file)
index 0000000..081b0b8
--- /dev/null
@@ -0,0 +1,15 @@
+/** @file
+  File intentionally blank
+
+  Copyright (c) 2010, Apple Inc. All rights reserved.
+  
+  All rights reserved. This program and the accompanying materials
+  are licensed and made available under the terms and conditions of the BSD License
+  which accompanies this distribution.  The full text of the license may be found at
+  http://opensource.org/licenses/bsd-license.php
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
diff --git a/EmbeddedPkg/Library/PrePiHobLib/PrePiHobLib.inf b/EmbeddedPkg/Library/PrePiHobLib/PrePiHobLib.inf
new file mode 100644 (file)
index 0000000..a69c46f
--- /dev/null
@@ -0,0 +1,38 @@
+#/** @file\r
+#  Hob lib that does not contain the APIs as they are already in the PrePiLib\r
+#\r
+#  Copyright (c) 2008 - 2010, Apple, Inc.\r
+#\r
+#  All rights reserved. This program and the accompanying materials\r
+#  are licensed and made available under the terms and conditions of the BSD License\r
+#  which accompanies this distribution. The full text of the license may be found at\r
+#  http://opensource.org/licenses/bsd-license.php\r
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+#\r
+#\r
+#**/\r
+\r
+[Defines]\r
+  INF_VERSION                    = 0x00010005\r
+  BASE_NAME                      = PrePiLib\r
+  FILE_GUID                      = 1F3A3278-82EB-4C0D-86F1-5BCDA5846CB2\r
+  MODULE_TYPE                    = BASE\r
+  VERSION_STRING                 = 1.0\r
+  LIBRARY_CLASS                  = PrePiLib \r
+\r
+\r
+#\r
+#  VALID_ARCHITECTURES           = IA32 X64 IPF EBC\r
+#\r
+\r
+[Sources.common]\r
+  Hob.c\r
+\r
+[Packages]\r
+  MdePkg/MdePkg.dec\r
+\r
+\r
+[LibraryClasses]\r
+  \r
+\r
index dc3ef48614b35ae77a9428b97d5a27f1f49ad5aa..8cf1a2322be452fe135265fc7459162e92382692 100644 (file)
@@ -26,6 +26,8 @@
 #include <Library/UefiDecompressLib.h>
 #include <Library/PeCoffLib.h>
 #include <Library/CacheMaintenanceLib.h>
+#include <Library/TimerLib.h>
+#include <Library/PerformanceLib.h>
 
 #include <Guid/MemoryAllocationHob.h>
 
index f92be0fea34c85764a91f898b248821ab28e941d..a359d5bdb0bc426757309889ca270dda6f3b5d56 100644 (file)
@@ -115,7 +115,10 @@ LoadDxeCoreFromFfsFile (
   VOID                    *TopOfStack;
   VOID                    *Hob;
   EFI_FV_FILE_INFO        FvFileInfo;
+  UINT64                  Tick;
 
+  Tick = 0;
+  PERF_START (NULL, "SEC", NULL, 1);
 
   Status = FfsFindSectionData (EFI_SECTION_PE32, FileHandle, &PeCoffImage);
   if (EFI_ERROR  (Status)) {
@@ -140,6 +143,13 @@ LoadDxeCoreFromFfsFile (
   Hob = GetHobList ();
   if (StackSize == 0) {
     // User the current stack
+  
+  
+    if (PerformanceMeasurementEnabled ()) {
+      Tick = GetPerformanceCounter ();
+    }
+    PERF_END (NULL, "SEC", NULL, Tick);
+
     ((DXE_CORE_ENTRY_POINT)(UINTN)EntryPoint) (Hob);
   } else {
     
@@ -161,6 +171,12 @@ LoadDxeCoreFromFfsFile (
     //    
     UpdateStackHob ((EFI_PHYSICAL_ADDRESS)(UINTN) BaseOfStack, StackSize);
     
+
+    if (PerformanceMeasurementEnabled ()) {
+      Tick = GetPerformanceCounter ();
+    }
+    PERF_END (NULL, "SEC", NULL, Tick);
+
     SwitchStack (
       (SWITCH_STACK_ENTRY_POINT)(UINTN)EntryPoint,
       Hob,
index 72e41c999ff34e4bee4df08f41e97da06797714e..e0989b1b2c89fa17f4c5fe62204f04e419724557 100644 (file)
@@ -55,6 +55,9 @@
   PrintLib\r
   SerialPortLib\r
   ExtractGuidedSectionLib\r
+  TimerLib\r
+  PerformanceLib\r
+  \r
 \r
 [Guids]\r
   gEfiHobMemoryAllocModuleGuid\r