diff options
author | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-11-13 07:10:54 +0000 |
---|---|---|
committer | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-11-13 07:10:54 +0000 |
commit | 3e025b69934d9bb7ba172e4ff3591cc2eea7621c (patch) | |
tree | 8165609260f29e30b993df06161e14357b13c754 | |
parent | 15db5db9f17d9771495b042abcc4b1af72b238c5 (diff) | |
download | edk2-platforms-3e025b69934d9bb7ba172e4ff3591cc2eea7621c.tar.xz |
Add comments about why pre-allocate 32 bytes for load 64bit dxe core and Add code to make sure the stack is aligned to 16 bytes.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1935 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r-- | EdkModulePkg/Core/DxeIplX64Peim/DxeLoadX64.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/EdkModulePkg/Core/DxeIplX64Peim/DxeLoadX64.c b/EdkModulePkg/Core/DxeIplX64Peim/DxeLoadX64.c index 7b293ef0c2..655d89045d 100644 --- a/EdkModulePkg/Core/DxeIplX64Peim/DxeLoadX64.c +++ b/EdkModulePkg/Core/DxeIplX64Peim/DxeLoadX64.c @@ -259,8 +259,8 @@ Returns: ASSERT (BaseOfStack != 0);
//
- // Compute the top of the stack we were allocated. Pre-allocate a 32 bytes
- // for x64 calling convention.
+ // Compute the top of the stack we were allocated, which is used to load X64 dxe core.
+ // Pre-allocate a 32 bytes which confroms to x64 calling convention.
//
// The first four parameters to a function are passed in rcx, rdx, r8 and r9.
// Any further parameters are pushed on the stack. Furthermore, space (4 * 8bytes) for the
@@ -270,6 +270,11 @@ Returns: TopOfStack = BaseOfStack + EFI_SIZE_TO_PAGES (STACK_SIZE) * EFI_PAGE_SIZE - 32;
//
+ // X64 Calling Conventions requires that the stack must be aligned to 16 bytes
+ //
+ TopOfStack = ALIGN_POINTER (TopOfStack, 16);
+
+ //
// Add architecture-specifc HOBs (including the BspStore HOB)
//
Status = CreateArchSpecificHobs (&BspStore);
|