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

Heinrich Schuchardt xypron.glpk at gmx.de
Fri Feb 8 18:46:46 UTC 2019


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.

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

Clean up bootefi_test_prepare().

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

Heinrich Schuchardt (4):
  efi_loader: LoadImage: always allocate new pages
  efi_loader: set entry point in efi_load_pe()
  efi_loader: use efi_start_image() for bootefi
  efi_loader: clean up bootefi_test_prepare()

 cmd/bootefi.c                     |  91 ++++++++++--------------
 include/efi_loader.h              |  10 ++-
 lib/efi_loader/efi_bootmgr.c      |   2 +-
 lib/efi_loader/efi_boottime.c     | 112 ++++++++++++++++++++----------
 lib/efi_loader/efi_image_loader.c |  37 +++++-----
 5 files changed, 141 insertions(+), 111 deletions(-)

-- 
2.20.1



More information about the U-Boot mailing list