From ad9e507a58a663b2035232360a7ade02399b80a8 Mon Sep 17 00:00:00 2001 From: mdkinney Date: Wed, 8 Aug 2007 20:44:44 +0000 Subject: [PATCH] Change EfiConvertPointer() and EfiSetVirtualAddressMap() to use gRT instead of mRT because these two functions must only be called in physical mode, so there is never any need for them to use mRT that is converted to a virtual address git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3581 6f19259b-4bc3-4df7-8a09-765794883524 --- MdePkg/Library/UefiRuntimeLib/RuntimeLib.c | 3 +-- .../UefiRuntimeLib/RuntimeLibInternal.h | 1 + .../Library/UefiRuntimeLib/RuntimeService.c | 4 ++-- .../Library/UefiRuntimeLib/UefiRuntimeLib.inf | 19 ++----------------- 4 files changed, 6 insertions(+), 21 deletions(-) diff --git a/MdePkg/Library/UefiRuntimeLib/RuntimeLib.c b/MdePkg/Library/UefiRuntimeLib/RuntimeLib.c index 2b0155e691..39be3cb0cf 100644 --- a/MdePkg/Library/UefiRuntimeLib/RuntimeLib.c +++ b/MdePkg/Library/UefiRuntimeLib/RuntimeLib.c @@ -87,8 +87,7 @@ RuntimeDriverLibConstruct ( { EFI_STATUS Status; - ASSERT (SystemTable != NULL); - mRT = SystemTable->RuntimeServices; + mRT = gRT; ASSERT (mRT != NULL); // diff --git a/MdePkg/Library/UefiRuntimeLib/RuntimeLibInternal.h b/MdePkg/Library/UefiRuntimeLib/RuntimeLibInternal.h index e9b4c9d764..66157feed7 100644 --- a/MdePkg/Library/UefiRuntimeLib/RuntimeLibInternal.h +++ b/MdePkg/Library/UefiRuntimeLib/RuntimeLibInternal.h @@ -19,6 +19,7 @@ #include #include #include +#include extern EFI_RUNTIME_SERVICES *mRT; diff --git a/MdePkg/Library/UefiRuntimeLib/RuntimeService.c b/MdePkg/Library/UefiRuntimeLib/RuntimeService.c index 48db6bdcc8..34e4738102 100644 --- a/MdePkg/Library/UefiRuntimeLib/RuntimeService.c +++ b/MdePkg/Library/UefiRuntimeLib/RuntimeService.c @@ -258,7 +258,7 @@ EfiConvertPointer ( IN OUT VOID **Address ) { - return mRT->ConvertPointer (DebugDisposition, Address); + return gRT->ConvertPointer (DebugDisposition, Address); } @@ -335,7 +335,7 @@ EfiSetVirtualAddressMap ( IN CONST EFI_MEMORY_DESCRIPTOR *VirtualMap ) { - return mRT->SetVirtualAddressMap ( + return gRT->SetVirtualAddressMap ( MemoryMapSize, DescriptorSize, DescriptorVersion, diff --git a/MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf b/MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf index de4dd1235a..ae464fa693 100644 --- a/MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf +++ b/MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf @@ -29,36 +29,21 @@ DESTRUCTOR = RuntimeDriverLibDeconstruct # -# VALID_ARCHITECTURES = IA32 X64 EBC +# VALID_ARCHITECTURES = IA32 X64 IPF EBC # [Sources.common] RuntimeLibInternal.h - -[Sources.Ia32] - RuntimeService.c - RuntimeLib.c - -[Sources.X64] - RuntimeService.c - RuntimeLib.c - -[Sources.EBC] RuntimeService.c RuntimeLib.c - - [Packages] MdePkg/MdePkg.dec -[Packages.IPF] - MdePkg/MdePkg.dec - - [LibraryClasses] UefiBootServicesTableLib + UefiRuntimeServicesTableLib DebugLib -- 2.39.2