EFI_SUCCESS, // Status\r
0, // ExitDataSize\r
NULL, // ExitData\r
+ NULL, // JumpBuffer\r
NULL, // JumpContext\r
0, // Machine\r
NULL, // Ebc\r
UINTN StartIndex;\r
CHAR8 EfiFileName[256];\r
\r
- DEBUG ((EFI_D_INFO | EFI_D_LOAD, "Loading driver at 0x%08x EntryPoint=0x%08x ", (UINTN)Image->ImageContext.ImageAddress, (UINTN)Image->ImageContext.EntryPoint));\r
+ DEBUG ((EFI_D_INFO | EFI_D_LOAD, "Loading driver at 0x%10p EntryPoint=0x%10p ", (VOID *)(UINTN)Image->ImageContext.ImageAddress, (VOID *)(UINTN)Image->ImageContext.EntryPoint));\r
if (Image->ImageContext.PdbPointer != NULL) {\r
StartIndex = 0;\r
for (Index = 0; Image->ImageContext.PdbPointer[Index] != 0; Index++) {\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
//\r
DEBUG_CODE_BEGIN ();\r
if (EFI_ERROR (Image->Status)) {\r
- DEBUG ((EFI_D_ERROR, "Error: Image at %08X start failed: %x\n", Image->Info.ImageBase, Image->Status));\r
+ DEBUG ((EFI_D_ERROR, "Error: Image at %10p start failed: %r\n", Image->Info.ImageBase, Image->Status));\r
}\r
DEBUG_CODE_END ();\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