From af1a266670d040d2f4083ff309d732d648afba2a Mon Sep 17 00:00:00 2001 From: Angelos Mouzakitis Date: Tue, 10 Oct 2023 14:33:42 +0000 Subject: Add submodule dependency files Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec --- .../UefiRuntimeServicesTableLib.c | 43 ++++++++++++++++++++++ .../UefiRuntimeServicesTableLib.inf | 36 ++++++++++++++++++ .../UefiRuntimeServicesTableLib.uni | 16 ++++++++ 3 files changed, 95 insertions(+) create mode 100644 roms/edk2/MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.c create mode 100644 roms/edk2/MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf create mode 100644 roms/edk2/MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.uni (limited to 'roms/edk2/MdePkg/Library/UefiRuntimeServicesTableLib') diff --git a/roms/edk2/MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.c b/roms/edk2/MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.c new file mode 100644 index 000000000..e2e91939e --- /dev/null +++ b/roms/edk2/MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.c @@ -0,0 +1,43 @@ +/** @file + UEFI Runtime Services Table Library. + + This library instance retrieve EFI_RUNTIME_SERVICES pointer from EFI system table + in library's constructor. + + Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include + +EFI_RUNTIME_SERVICES *gRT = NULL; + +/** + The constructor function caches the pointer of Runtime Services Table. + + The constructor function caches the pointer of Runtime Services Table. + It will ASSERT() if the pointer of Runtime Services Table is NULL. + It will always return EFI_SUCCESS. + + @param ImageHandle The firmware allocated handle for the EFI image. + @param SystemTable A pointer to the EFI System Table. + + @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS. + +**/ +EFI_STATUS +EFIAPI +UefiRuntimeServicesTableLibConstructor ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + // + // Cache pointer to the EFI Runtime Services Table + // + gRT = SystemTable->RuntimeServices; + ASSERT (gRT != NULL); + return EFI_SUCCESS; +} diff --git a/roms/edk2/MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf b/roms/edk2/MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf new file mode 100644 index 000000000..43406208c --- /dev/null +++ b/roms/edk2/MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf @@ -0,0 +1,36 @@ +## @file +# UEFI Runtime Services Table Library implementation. +# +# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +# +## + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = UefiRuntimeServicesTableLib + MODULE_UNI_FILE = UefiRuntimeServicesTableLib.uni + FILE_GUID = 19cbbb97-ff61-45ff-8c3f-dfa66dd118c8 + MODULE_TYPE = UEFI_DRIVER + VERSION_STRING = 1.0 + LIBRARY_CLASS = UefiRuntimeServicesTableLib|DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER SMM_CORE + + CONSTRUCTOR = UefiRuntimeServicesTableLibConstructor + +# +# VALID_ARCHITECTURES = IA32 X64 EBC +# + +[Sources] + UefiRuntimeServicesTableLib.c + + +[Packages] + MdePkg/MdePkg.dec + + +[LibraryClasses] + DebugLib + diff --git a/roms/edk2/MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.uni b/roms/edk2/MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.uni new file mode 100644 index 000000000..da320bb70 --- /dev/null +++ b/roms/edk2/MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.uni @@ -0,0 +1,16 @@ +// /** @file +// UEFI Runtime Services Table Library implementation. +// +// UEFI Runtime Services Table Library implementation. +// +// Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.
+// +// SPDX-License-Identifier: BSD-2-Clause-Patent +// +// **/ + + +#string STR_MODULE_ABSTRACT #language en-US "UEFI Runtime Services Table Library implementation" + +#string STR_MODULE_DESCRIPTION #language en-US "UEFI Runtime Services Table Library implementation." + -- cgit 1.2.3-korg