diff options
Diffstat (limited to 'EmbeddedPkg')
-rw-r--r-- | EmbeddedPkg/Library/PrePiHobLib/Hob.c | 15 | ||||
-rw-r--r-- | EmbeddedPkg/Library/PrePiHobLib/PrePiHobLib.inf | 38 | ||||
-rw-r--r-- | EmbeddedPkg/Library/PrePiLib/PrePi.h | 2 | ||||
-rw-r--r-- | EmbeddedPkg/Library/PrePiLib/PrePiLib.c | 16 | ||||
-rw-r--r-- | EmbeddedPkg/Library/PrePiLib/PrePiLib.inf | 3 |
5 files changed, 74 insertions, 0 deletions
diff --git a/EmbeddedPkg/Library/PrePiHobLib/Hob.c b/EmbeddedPkg/Library/PrePiHobLib/Hob.c new file mode 100644 index 0000000000..081b0b85d9 --- /dev/null +++ b/EmbeddedPkg/Library/PrePiHobLib/Hob.c @@ -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 index 0000000000..a69c46fb0f --- /dev/null +++ b/EmbeddedPkg/Library/PrePiHobLib/PrePiHobLib.inf @@ -0,0 +1,38 @@ +#/** @file
+# Hob lib that does not contain the APIs as they are already in the PrePiLib
+#
+# Copyright (c) 2008 - 2010, Apple, Inc.
+#
+# 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.
+#
+#
+#**/
+
+[Defines]
+ INF_VERSION = 0x00010005
+ BASE_NAME = PrePiLib
+ FILE_GUID = 1F3A3278-82EB-4C0D-86F1-5BCDA5846CB2
+ MODULE_TYPE = BASE
+ VERSION_STRING = 1.0
+ LIBRARY_CLASS = PrePiLib
+
+
+#
+# VALID_ARCHITECTURES = IA32 X64 IPF EBC
+#
+
+[Sources.common]
+ Hob.c
+
+[Packages]
+ MdePkg/MdePkg.dec
+
+
+[LibraryClasses]
+
+
diff --git a/EmbeddedPkg/Library/PrePiLib/PrePi.h b/EmbeddedPkg/Library/PrePiLib/PrePi.h index dc3ef48614..8cf1a2322b 100644 --- a/EmbeddedPkg/Library/PrePiLib/PrePi.h +++ b/EmbeddedPkg/Library/PrePiLib/PrePi.h @@ -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> diff --git a/EmbeddedPkg/Library/PrePiLib/PrePiLib.c b/EmbeddedPkg/Library/PrePiLib/PrePiLib.c index f92be0fea3..a359d5bdb0 100644 --- a/EmbeddedPkg/Library/PrePiLib/PrePiLib.c +++ b/EmbeddedPkg/Library/PrePiLib/PrePiLib.c @@ -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, diff --git a/EmbeddedPkg/Library/PrePiLib/PrePiLib.inf b/EmbeddedPkg/Library/PrePiLib/PrePiLib.inf index 72e41c999f..e0989b1b2c 100644 --- a/EmbeddedPkg/Library/PrePiLib/PrePiLib.inf +++ b/EmbeddedPkg/Library/PrePiLib/PrePiLib.inf @@ -55,6 +55,9 @@ PrintLib
SerialPortLib
ExtractGuidedSectionLib
+ TimerLib
+ PerformanceLib
+
[Guids]
gEfiHobMemoryAllocModuleGuid
|