summaryrefslogtreecommitdiff
path: root/EdkModulePkg
diff options
context:
space:
mode:
authormdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>2006-11-28 02:45:20 +0000
committermdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>2006-11-28 02:45:20 +0000
commit6f4f08890de71e0c28fcc5f23b7f92cb55d6160e (patch)
treee6357bc8723575532776bae604d539b4ea318727 /EdkModulePkg
parentd57427a7f74cba303ff9cc82a1380f16ef07c52f (diff)
downloadedk2-platforms-6f4f08890de71e0c28fcc5f23b7f92cb55d6160e.tar.xz
Add JumpBuffer field to the static structure
Align all Jump Context buffers according to the CPU specific alignment requirements git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2024 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkModulePkg')
-rw-r--r--EdkModulePkg/Core/Dxe/Image/Image.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/EdkModulePkg/Core/Dxe/Image/Image.c b/EdkModulePkg/Core/Dxe/Image/Image.c
index 0bef1ff82e..7810e6b093 100644
--- a/EdkModulePkg/Core/Dxe/Image/Image.c
+++ b/EdkModulePkg/Core/Dxe/Image/Image.c
@@ -74,6 +74,7 @@ LOADED_IMAGE_PRIVATE_DATA mCorePrivateImage = {
EFI_SUCCESS, // Status
0, // ExitDataSize
NULL, // ExitData
+ NULL, // JumpBuffer
NULL, // JumpContext
0, // Machine
NULL, // Ebc
@@ -949,12 +950,15 @@ Returns:
//
// Set long jump for Exit() support
+ // JumpContext must be aligned on a CPU specific boundary.
+ // Overallocate the buffer and force the required alignment
//
- Image->JumpContext = CoreAllocateBootServicesPool (sizeof (*Image->JumpContext));
- if (Image->JumpContext == NULL) {
+ Image->JumpBuffer = CoreAllocateBootServicesPool (sizeof (*Image->JumpContext) + BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT);
+ if (Image->JumpBuffer == NULL) {
PERF_END (ImageHandle, START_IMAGE_TOK, NULL, 0);
return EFI_OUT_OF_RESOURCES;
}
+ Image->JumpContext = (VOID *)((UINTN)(ALIGN_POINTER (Image->JumpBuffer, BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT)) + BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT);
SetJumpFlag = SetJump (Image->JumpContext);
//
@@ -991,7 +995,7 @@ Returns:
ASSERT (Image->Tpl == gEfiCurrentTpl);
CoreRestoreTpl (Image->Tpl);
- CoreFreePool (Image->JumpContext);
+ CoreFreePool (Image->JumpBuffer);
//
// Pop the current start image context