diff --git a/MdePkg/Include/Ebc/ProcessorBind.h b/MdePkg/Include/Ebc/ProcessorBind.h index 5a6e7dc9bb..2cb0753867 100644 --- a/MdePkg/Include/Ebc/ProcessorBind.h +++ b/MdePkg/Include/Ebc/ProcessorBind.h @@ -61,6 +61,12 @@ typedef unsigned long UINTN; // Maximum legal EBC address // #define MAX_ADDRESS ((UINTN) ~0) + +// +// The stack alignment required for EBC +// +#define CPU_STACK_ALIGNMENT sizeof(UINTN) + // // Modifier to ensure that all protocol member functions and EFI intrinsics // use the correct C calling convention. All protocol member functions and diff --git a/MdePkg/Include/Ia32/ProcessorBind.h b/MdePkg/Include/Ia32/ProcessorBind.h index e0ddba4fe5..b0a991ef81 100644 --- a/MdePkg/Include/Ia32/ProcessorBind.h +++ b/MdePkg/Include/Ia32/ProcessorBind.h @@ -146,6 +146,11 @@ typedef INT32 INTN; // #define MAX_ADDRESS 0xFFFFFFFF +// +// The stack alignment required for IA-32 +// +#define CPU_STACK_ALIGNMENT sizeof(UINTN) + // // Modifier to ensure that all protocol member functions and EFI intrinsics // use the correct C calling convention. All protocol member functions and diff --git a/MdePkg/Include/Ipf/ProcessorBind.h b/MdePkg/Include/Ipf/ProcessorBind.h index 86374b2249..f3706a782a 100644 --- a/MdePkg/Include/Ipf/ProcessorBind.h +++ b/MdePkg/Include/Ipf/ProcessorBind.h @@ -171,6 +171,12 @@ typedef INT64 INTN; // #define MAX_ADDRESS 0xFFFFFFFFFFFFFFFFULL +// +// Per the Itanium Software Conventions and Runtime Architecture Guide, +// section 3.3.4, IPF stack must always be 16-byte aligned. +// +#define CPU_STACK_ALIGNMENT 16 + // // Modifier to ensure that all protocol member functions and EFI intrinsics // use the correct C calling convention. All protocol member functions and diff --git a/MdePkg/Include/x64/ProcessorBind.h b/MdePkg/Include/x64/ProcessorBind.h index 3a2fea26ce..d8c76922c8 100644 --- a/MdePkg/Include/x64/ProcessorBind.h +++ b/MdePkg/Include/x64/ProcessorBind.h @@ -159,10 +159,15 @@ typedef INT64 INTN; #define MAX_2_BITS 0xC000000000000000 // -// Maximum legal Itanium-based address +// Maximum legal X64 address // #define MAX_ADDRESS 0xFFFFFFFFFFFFFFFF +// +// The stack alignment required for X64 +// +#define CPU_STACK_ALIGNMENT sizeof(UINTN) + // // Modifier to ensure that all protocol member functions and EFI intrinsics // use the correct C calling convention. All protocol member functions and