efi_loader: refactor efi_setup_loaded_image()

Create the handle of loaded images and the EFI_LOADED_IMAGE_PROTOCOL
inside efi_setup_loaded_image(). Do not use local variables.

Currently we expect the loaded image handle to point to the loaded image
protocol. Additionally we have appended private fields to the protocol.

With the patch the handle points to a loaded image object and the private
fields are added here. This matches how we handle the net and the gop
object.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
Heinrich Schuchardt
2018-09-23 17:21:51 +02:00
committed by Alexander Graf
parent a47c1b5b87
commit c982874e93
5 changed files with 117 additions and 100 deletions

View File

@ -339,14 +339,6 @@ struct efi_loaded_image {
unsigned int image_code_type;
unsigned int image_data_type;
unsigned long unload;
/* Below are efi loader private fields */
#ifdef CONFIG_EFI_LOADER
void *reloc_base;
aligned_u64 reloc_size;
efi_status_t exit_status;
struct jmp_buf_data exit_jmp;
#endif
};
#define DEVICE_PATH_GUID \