The UEFI spec differs between architectures in the minimum alignment
and granularity of page allocations that are visible to the OS as
EFI_MEMORY_RUNTIME regions.
So define macros that carry these values to the respective ProcessorBind.h
header files.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
///\r
#define CPU_STACK_ALIGNMENT 16\r
\r
///\r
#define CPU_STACK_ALIGNMENT 16\r
\r
+///\r
+/// Page allocation granularity for AARCH64\r
+///\r
+#define DEFAULT_PAGE_ALLOCATION_GRANULARITY (0x1000)\r
+#define RUNTIME_PAGE_ALLOCATION_GRANULARITY (0x10000)\r
+\r
//\r
// Modifier to ensure that all protocol member functions and EFI intrinsics\r
// use the correct C calling convention. All protocol member functions and\r
//\r
// Modifier to ensure that all protocol member functions and EFI intrinsics\r
// use the correct C calling convention. All protocol member functions and\r
///\r
#define CPU_STACK_ALIGNMENT sizeof(UINT64)\r
\r
///\r
#define CPU_STACK_ALIGNMENT sizeof(UINT64)\r
\r
+///\r
+/// Page allocation granularity for ARM\r
+///\r
+#define DEFAULT_PAGE_ALLOCATION_GRANULARITY (0x1000)\r
+#define RUNTIME_PAGE_ALLOCATION_GRANULARITY (0x1000)\r
+\r
//\r
// Modifier to ensure that all protocol member functions and EFI intrinsics\r
// use the correct C calling convention. All protocol member functions and\r
//\r
// Modifier to ensure that all protocol member functions and EFI intrinsics\r
// use the correct C calling convention. All protocol member functions and\r
///\r
#define CPU_STACK_ALIGNMENT sizeof(UINTN)\r
\r
///\r
#define CPU_STACK_ALIGNMENT sizeof(UINTN)\r
\r
+///\r
+/// Page allocation granularity for EBC\r
+///\r
+#define DEFAULT_PAGE_ALLOCATION_GRANULARITY (0x1000)\r
+#define RUNTIME_PAGE_ALLOCATION_GRANULARITY (0x1000)\r
+\r
///\r
/// Modifier to ensure that all protocol member functions and EFI intrinsics\r
/// use the correct C calling convention. All protocol member functions and\r
///\r
/// Modifier to ensure that all protocol member functions and EFI intrinsics\r
/// use the correct C calling convention. All protocol member functions and\r
///\r
#define CPU_STACK_ALIGNMENT sizeof(UINTN)\r
\r
///\r
#define CPU_STACK_ALIGNMENT sizeof(UINTN)\r
\r
+///\r
+/// Page allocation granularity for IA-32.\r
+///\r
+#define DEFAULT_PAGE_ALLOCATION_GRANULARITY (0x1000)\r
+#define RUNTIME_PAGE_ALLOCATION_GRANULARITY (0x1000)\r
+\r
//\r
// Modifier to ensure that all protocol member functions and EFI intrinsics\r
// use the correct C calling convention. All protocol member functions and\r
//\r
// Modifier to ensure that all protocol member functions and EFI intrinsics\r
// use the correct C calling convention. All protocol member functions and\r
///\r
#define CPU_STACK_ALIGNMENT 16\r
\r
///\r
#define CPU_STACK_ALIGNMENT 16\r
\r
+///\r
+/// Page allocation granularity for Itanium\r
+///\r
+#define DEFAULT_PAGE_ALLOCATION_GRANULARITY (0x1000)\r
+#define RUNTIME_PAGE_ALLOCATION_GRANULARITY (0x2000)\r
+\r
//\r
// Modifier to ensure that all protocol member functions and EFI intrinsics\r
// use the correct C calling convention. All protocol member functions and\r
//\r
// Modifier to ensure that all protocol member functions and EFI intrinsics\r
// use the correct C calling convention. All protocol member functions and\r
///\r
#define CPU_STACK_ALIGNMENT 16\r
\r
///\r
#define CPU_STACK_ALIGNMENT 16\r
\r
+///\r
+/// Page allocation granularity for x64\r
+///\r
+#define DEFAULT_PAGE_ALLOCATION_GRANULARITY (0x1000)\r
+#define RUNTIME_PAGE_ALLOCATION_GRANULARITY (0x1000)\r
+\r
//\r
// Modifier to ensure that all protocol member functions and EFI intrinsics\r
// use the correct C calling convention. All protocol member functions and\r
//\r
// Modifier to ensure that all protocol member functions and EFI intrinsics\r
// use the correct C calling convention. All protocol member functions and\r