Skip to content

Commit

Permalink
OcBootManagementLib: Add missing explicit initialisation of mImageLoa…
Browse files Browse the repository at this point in the history
…derCaps in OcImageLoaderLoad (#496)

Fix mentioned in changelog incorporates this and the previous commit
  • Loading branch information
mikebeaton authored Oct 30, 2023
1 parent c6060b2 commit 7f08cc7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ OpenCore Changelog
- Updated builtin firmware versions for SMBIOS and the rest
- Fixed hang while generating boot entries on some systems
- Added `efidebug.tool` support for 32-bit on 32-bit using GDB or LLDB
- Fixed potential incorrect values in kernel image capabilities calculation

#### v0.9.5
- Fixed GUID formatting for legacy NVRAM saving
Expand Down
13 changes: 13 additions & 0 deletions Library/OcBootManagementLib/ImageLoader.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,17 @@ OcImageLoaderLoad (
OC_LOADED_IMAGE_PROTOCOL *OcLoadedImage;
EFI_LOADED_IMAGE_PROTOCOL *LoadedImage;

//
// For OcImageLoaderLoad always assume target default.
//
#ifdef MDE_CPU_IA32
mImageLoaderCaps = OC_KERN_CAPABILITY_K32_U32 | OC_KERN_CAPABILITY_K32_U64;
#else
mImageLoaderCaps = OC_KERN_CAPABILITY_K64_U64;
#endif

mImageLoaderCapsHandle = NULL;

ASSERT (SourceBuffer != NULL);

//
Expand Down Expand Up @@ -411,6 +422,8 @@ OcImageLoaderLoad (
return Status;
}

mImageLoaderCapsHandle = *ImageHandle;

DEBUG ((DEBUG_VERBOSE, "OCB: Loaded image at %p\n", *ImageHandle));

return EFI_SUCCESS;
Expand Down

0 comments on commit 7f08cc7

Please sign in to comment.