mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-17 20:51:39 +00:00
efi_loader: use efi_start_image() for bootefi
Remove the duplicate code in efi_do_enter() and use efi_start_image() to start the image invoked by the bootefi command. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
This commit is contained in:
parent
8f7e2b2980
commit
f69d63fae2
3 changed files with 8 additions and 24 deletions
|
@ -133,20 +133,6 @@ done:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static efi_status_t efi_do_enter(
|
|
||||||
efi_handle_t image_handle, struct efi_system_table *st,
|
|
||||||
EFIAPI efi_status_t (*entry)(
|
|
||||||
efi_handle_t image_handle,
|
|
||||||
struct efi_system_table *st))
|
|
||||||
{
|
|
||||||
efi_status_t ret = EFI_LOAD_ERROR;
|
|
||||||
|
|
||||||
if (entry)
|
|
||||||
ret = entry(image_handle, st);
|
|
||||||
st->boottime->exit(image_handle, ret, 0, NULL);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* efi_carve_out_dt_rsv() - Carve out DT reserved memory ranges
|
* efi_carve_out_dt_rsv() - Carve out DT reserved memory ranges
|
||||||
*
|
*
|
||||||
|
@ -315,13 +301,7 @@ static efi_status_t do_bootefi_exec(void *efi,
|
||||||
|
|
||||||
/* Call our payload! */
|
/* Call our payload! */
|
||||||
debug("%s: Jumping to 0x%p\n", __func__, image_obj->entry);
|
debug("%s: Jumping to 0x%p\n", __func__, image_obj->entry);
|
||||||
|
ret = EFI_CALL(efi_start_image(&image_obj->header, NULL, NULL));
|
||||||
if (setjmp(&image_obj->exit_jmp)) {
|
|
||||||
ret = image_obj->exit_status;
|
|
||||||
goto err_prepare;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = efi_do_enter(&image_obj->header, &systab, image_obj->entry);
|
|
||||||
|
|
||||||
err_prepare:
|
err_prepare:
|
||||||
/* image has returned, loaded-image obj goes *poof*: */
|
/* image has returned, loaded-image obj goes *poof*: */
|
||||||
|
|
|
@ -320,6 +320,10 @@ efi_status_t efi_create_handle(efi_handle_t *handle);
|
||||||
void efi_delete_handle(efi_handle_t obj);
|
void efi_delete_handle(efi_handle_t obj);
|
||||||
/* Call this to validate a handle and find the EFI object for it */
|
/* Call this to validate a handle and find the EFI object for it */
|
||||||
struct efi_object *efi_search_obj(const efi_handle_t handle);
|
struct efi_object *efi_search_obj(const efi_handle_t handle);
|
||||||
|
/* Start image */
|
||||||
|
efi_status_t EFIAPI efi_start_image(efi_handle_t image_handle,
|
||||||
|
efi_uintn_t *exit_data_size,
|
||||||
|
u16 **exit_data);
|
||||||
/* Find a protocol on a handle */
|
/* Find a protocol on a handle */
|
||||||
efi_status_t efi_search_protocol(const efi_handle_t handle,
|
efi_status_t efi_search_protocol(const efi_handle_t handle,
|
||||||
const efi_guid_t *protocol_guid,
|
const efi_guid_t *protocol_guid,
|
||||||
|
|
|
@ -1772,9 +1772,9 @@ error:
|
||||||
*
|
*
|
||||||
* Return: status code
|
* Return: status code
|
||||||
*/
|
*/
|
||||||
static efi_status_t EFIAPI efi_start_image(efi_handle_t image_handle,
|
efi_status_t EFIAPI efi_start_image(efi_handle_t image_handle,
|
||||||
efi_uintn_t *exit_data_size,
|
efi_uintn_t *exit_data_size,
|
||||||
u16 **exit_data)
|
u16 **exit_data)
|
||||||
{
|
{
|
||||||
struct efi_loaded_image_obj *image_obj =
|
struct efi_loaded_image_obj *image_obj =
|
||||||
(struct efi_loaded_image_obj *)image_handle;
|
(struct efi_loaded_image_obj *)image_handle;
|
||||||
|
|
Loading…
Add table
Reference in a new issue