summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MdePkg/Library/PeiServicesTablePointerLibKr7/PeiServicesTablePointer.c24
-rw-r--r--MdePkg/Library/PeiServicesTablePointerLibKr7/PeiServicesTablePointerLibKr7.inf7
2 files changed, 30 insertions, 1 deletions
diff --git a/MdePkg/Library/PeiServicesTablePointerLibKr7/PeiServicesTablePointer.c b/MdePkg/Library/PeiServicesTablePointerLibKr7/PeiServicesTablePointer.c
index bc189cd428..94895b30c9 100644
--- a/MdePkg/Library/PeiServicesTablePointerLibKr7/PeiServicesTablePointer.c
+++ b/MdePkg/Library/PeiServicesTablePointerLibKr7/PeiServicesTablePointer.c
@@ -39,3 +39,27 @@ GetPeiServicesTablePointer (
return PeiServices;
}
+/**
+ The constructor function caches the pointer to PEI services.
+
+ The constructor function caches the pointer to PEI services.
+ It will always return EFI_SUCCESS.
+
+ @param FfsHeader Pointer to FFS header the loaded driver.
+ @param PeiServices Pointer to the PEI services.
+
+ @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.
+
+**/
+EFI_STATUS
+EFIAPI
+PeiServicesTablePointerLibConstructor (
+ IN EFI_FFS_FILE_HEADER *FfsHeader,
+ IN EFI_PEI_SERVICES **PeiServices
+ )
+{
+ AsmWriteKr7 ((UINT64)(UINTN)PeiServices);
+ return EFI_SUCCESS;
+}
+
+
diff --git a/MdePkg/Library/PeiServicesTablePointerLibKr7/PeiServicesTablePointerLibKr7.inf b/MdePkg/Library/PeiServicesTablePointerLibKr7/PeiServicesTablePointerLibKr7.inf
index 5d2dca8f66..8c1c5fff6b 100644
--- a/MdePkg/Library/PeiServicesTablePointerLibKr7/PeiServicesTablePointerLibKr7.inf
+++ b/MdePkg/Library/PeiServicesTablePointerLibKr7/PeiServicesTablePointerLibKr7.inf
@@ -19,10 +19,11 @@
FILE_GUID = E0E7D776-E7EB-4e5f-9AA8-54CF3AA64A43
MODULE_TYPE = PEIM
VERSION_STRING = 1.0
- LIBRARY_CLASS = PeiServicesTablePointerLib|PEIM PEI_CORE
+ LIBRARY_CLASS = PeiServicesTablePointerLib|PEIM PEI_CORE
EDK_RELEASE_VERSION = 0x00020000
EFI_SPECIFICATION_VERSION = 0x00020000
+ CONSTRUCTOR = PeiServicesTablePointerLibConstructor
#
# VALID_ARCHITECTURES = IPF
@@ -31,6 +32,10 @@
[Sources.Ipf]
PeiServicesTablePointer.c
+[Packages]
+ MdePkg/MdePkg.dec
+
[LibraryClasses]
DebugLib
+ BaseLib