EFI_SUCCESS, // Status\r
0, // ExitDataSize\r
NULL, // ExitData\r
+ NULL, // JumpBuffer\r
NULL, // JumpContext\r
0, // Machine\r
NULL, // Ebc\r
\r
//\r
// Set long jump for Exit() support\r
+ // JumpContext must be aligned on a CPU specific boundary.\r
+ // Overallocate the buffer and force the required alignment\r
//\r
- Image->JumpContext = CoreAllocateBootServicesPool (sizeof (*Image->JumpContext));\r
- if (Image->JumpContext == NULL) {\r
+ Image->JumpBuffer = CoreAllocateBootServicesPool (sizeof (*Image->JumpContext) + BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT);\r
+ if (Image->JumpBuffer == NULL) {\r
PERF_END (ImageHandle, START_IMAGE_TOK, NULL, 0);\r
return EFI_OUT_OF_RESOURCES;\r
}\r
+ Image->JumpContext = (VOID *)((UINTN)(ALIGN_POINTER (Image->JumpBuffer, BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT)) + BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT);\r
\r
SetJumpFlag = SetJump (Image->JumpContext);\r
//\r
ASSERT (Image->Tpl == gEfiCurrentTpl);\r
CoreRestoreTpl (Image->Tpl);\r
\r
- CoreFreePool (Image->JumpContext);\r
+ CoreFreePool (Image->JumpBuffer);\r
\r
//\r
// Pop the current start image context\r