]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdePkg/Base: introduce MAX_ALLOC_ADDRESS
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Fri, 7 Dec 2018 10:27:32 +0000 (11:27 +0100)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Thu, 20 Dec 2018 10:01:38 +0000 (11:01 +0100)
On some architectures, the maximum representable address deviates from
the virtual address range that is accessible by the firmware at boot
time. For instance, on AArch64, UEFI mandates a 4 KB page size, which
limits the address space to 48 bits, while more than that may be
populated on a particular platform, for use by the OS.

So introduce a new macro MAX_ALLOC_ADDRESS, which represent the maximum
address the firmware should take into account when allocating memory
ranges that need to be accessible by the CPU at boot time.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
MdePkg/Include/AArch64/ProcessorBind.h
MdePkg/Include/Arm/ProcessorBind.h
MdePkg/Include/Ebc/ProcessorBind.h
MdePkg/Include/Ia32/ProcessorBind.h
MdePkg/Include/X64/ProcessorBind.h

index 968c18f915ae2762a5a645e39a3246fbb1513a1b..f4a544b34d7851150c39307681f5ed373750fd07 100644 (file)
@@ -142,6 +142,11 @@ typedef INT64   INTN;
 ///\r
 #define MAX_ADDRESS   0xFFFFFFFFFFFFFFFFULL\r
 \r
+///\r
+/// Maximum usable address at boot time (48 bits using 4 KB pages)\r
+///\r
+#define MAX_ALLOC_ADDRESS   0xFFFFFFFFFFFFULL\r
+\r
 ///\r
 /// Maximum legal AArch64 INTN and UINTN values.\r
 ///\r
index 8cca0f3bb0503c1fbb8ebea2376b61e222686f20..16a61fc7a32588474c3379c21ddcf0d0e8c0d172 100644 (file)
@@ -148,6 +148,11 @@ typedef INT32   INTN;
 ///\r
 #define MAX_ADDRESS  0xFFFFFFFF\r
 \r
+///\r
+/// Maximum usable address at boot time\r
+///\r
+#define MAX_ALLOC_ADDRESS   MAX_ALLOC_ADDRESS\r
+\r
 ///\r
 /// Maximum legal ARM INTN and UINTN values.\r
 ///\r
index 5217cfd97eac2e469be021576e83b41d8fc42f41..45beb757281775052b07f3577d31bb5b4cffec0b 100644 (file)
@@ -103,6 +103,11 @@ typedef unsigned long         UINTN;
 ///\r
 #define MAX_ADDRESS   ((UINTN)(~0ULL >> (64 - sizeof (INTN) * 8)))\r
 \r
+///\r
+/// Maximum usable address at boot time (48 bits using 4 KB pages)\r
+///\r
+#define MAX_ALLOC_ADDRESS   MAX_ADDRESS\r
+\r
 ///\r
 /// Maximum legal EBC INTN and UINTN values.\r
 ///\r
index 8e4de7029cfc4466fad476485950a1beb7e9ed0a..71d53e2543bbc021d8ce8b689c44363ac83ce72c 100644 (file)
@@ -246,6 +246,11 @@ typedef INT32   INTN;
 ///\r
 #define MAX_ADDRESS   0xFFFFFFFF\r
 \r
+///\r
+/// Maximum usable address at boot time\r
+///\r
+#define MAX_ALLOC_ADDRESS   MAX_ADDRESS\r
+\r
 ///\r
 /// Maximum legal IA-32 INTN and UINTN values.\r
 ///\r
index e4254285877bba28a846f2103b1aa9c4f06bb67c..1c04090c7d0384572f9bf3183bc6f87d973e988b 100644 (file)
@@ -260,6 +260,11 @@ typedef INT64   INTN;
 ///\r
 #define MAX_ADDRESS   0xFFFFFFFFFFFFFFFFULL\r
 \r
+///\r
+/// Maximum usable address at boot time\r
+///\r
+#define MAX_ALLOC_ADDRESS   MAX_ADDRESS\r
+\r
 ///\r
 /// Maximum legal x64 INTN and UINTN values.\r
 ///\r