]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkModulePkg/Core/DxeIplX64Peim/DxeLoadX64.c
Use CPU_STACK_ALIGNMENT to align stack allocated for used in the DXE Phase.
[mirror_edk2.git] / EdkModulePkg / Core / DxeIplX64Peim / DxeLoadX64.c
index c7d6dd7aac8150c5648924c279352fdbca6fb6c0..c9792eeaa194cb5abe8e1220542e7bb866b12e4d 100644 (file)
@@ -262,7 +262,8 @@ Returns:
   // Compute the top of the stack we were allocated. Pre-allocate a 32 bytes\r
   // for safety (PpisNeededByDxe and DxeCore).\r
   //\r
-  TopOfStack = BaseOfStack + EFI_SIZE_TO_PAGES (STACK_SIZE) * EFI_PAGE_SIZE - 32;\r
+  TopOfStack = BaseOfStack + EFI_SIZE_TO_PAGES (STACK_SIZE) * EFI_PAGE_SIZE - CPU_STACK_ALIGNMENT;\r
+  TopOfStack = ALIGN_POINTER (TopOfStack, CPU_STACK_ALIGNMENT);\r
 \r
   //\r
   // Add architecture-specifc HOBs (including the BspStore HOB)\r