[edk2-devel] [PATCH v2 1/2] MdeModulePkg: Set EFI_MEMORY_RUNTIME with GCD

Akihiko Odaki akihiko.odaki at gmail.com
Mon Apr 11 02:46:43 UTC 2022


Signed-off-by: Akihiko Odaki <akihiko.odaki at gmail.com>
---
 MdeModulePkg/Core/Dxe/Gcd/Gcd.c | 9 +++++++++
 MdePkg/Include/Pi/PiHob.h       | 2 ++
 2 files changed, 11 insertions(+)

diff --git a/MdeModulePkg/Core/Dxe/Gcd/Gcd.c b/MdeModulePkg/Core/Dxe/Gcd/Gcd.c
index 3763467bdb..623b316c61 100644
--- a/MdeModulePkg/Core/Dxe/Gcd/Gcd.c
+++ b/MdeModulePkg/Core/Dxe/Gcd/Gcd.c
@@ -2628,6 +2628,15 @@ CoreInitializeGcdServices (
                    ResourceHob->ResourceLength,
                    Capabilities
                    );
+
+        if (!EFI_ERROR (Status) &&
+            (ResourceHob->ResourceAttribute & EFI_RESOURCE_ATTRIBUTE_RUNTIME) == EFI_RESOURCE_ATTRIBUTE_RUNTIME) {
+          Status = CoreSetMemorySpaceAttributes(
+            ResourceHob->PhysicalStart,
+            ResourceHob->ResourceLength,
+            EFI_MEMORY_RUNTIME
+            );
+        }
       }
 
       if (GcdIoType != EfiGcdIoTypeNonExistent) {
diff --git a/MdePkg/Include/Pi/PiHob.h b/MdePkg/Include/Pi/PiHob.h
index e9f0ab4309..92bacbe62c 100644
--- a/MdePkg/Include/Pi/PiHob.h
+++ b/MdePkg/Include/Pi/PiHob.h
@@ -296,6 +296,8 @@ typedef UINT32 EFI_RESOURCE_ATTRIBUTE_TYPE;
 //
 #define EFI_RESOURCE_ATTRIBUTE_MORE_RELIABLE  0x02000000
 
+#define EFI_RESOURCE_ATTRIBUTE_RUNTIME 0x04000000
+
 ///
 /// Describes the resource properties of all fixed,
 /// nonrelocatable resource ranges found on the processor
-- 
2.35.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#88728): https://edk2.groups.io/g/devel/message/88728
Mute This Topic: https://groups.io/mt/90407107/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-




More information about the edk2-devel-archive mailing list