[U-Boot] [PATCH 0/5] efi_loader: rework loading and starting of images

Heinrich Schuchardt xypron.glpk at gmx.de
Fri Dec 28 11:41:11 UTC 2018


This patch series starts the necessary changes needed to correctly
implement the unloading of images in Exit().

If we want to properly unload images in Exit() the memory should always be
allocated in the same way. As we allocate memory when reading from file we
should do the same when the original image is in memory.

Up to now efi_load_pe() returns the entry point or NULL in case of an
error. This does not allow to return correct error codes from LoadImage().

Let efi_load_pe() return a status code and fill in the entry point in the
corresponding field of the image object.

We use u16* for Unicode strings and efi_uintn_t for UINTN. Correct the
signature of efi_exit() and efi_start_image().

Remove the duplicate code in efi_do_enter() and use efi_start_image() to
start the image invoked by the bootefi command.

Adjust a debug message.

Further patches will be needed:
- use LoadImage() in bootefi and bootmgr
- implement correct unloading of images in Exit()

Heinrich Schuchardt (5):
  efi_loader: LoadImage: always allocate new pages
  efi_loader: set entry point in efi_load_pe()
  efi_loader: avoid unnecessary pointer to long conversion
  efi_loader: signature of StartImage and Exit
  efi_loader: use efi_start_image() for bootefi

 cmd/bootefi.c                     | 33 ++------------
 include/efi_api.h                 |  6 +--
 include/efi_loader.h              | 10 +++--
 lib/efi_loader/efi_bootmgr.c      |  2 +-
 lib/efi_loader/efi_boottime.c     | 74 +++++++++++++++++++------------
 lib/efi_loader/efi_image_loader.c | 34 ++++++++------
 6 files changed, 81 insertions(+), 78 deletions(-)

-- 
2.19.2



More information about the U-Boot mailing list