mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-08-11 09:47:00 +02:00
bootm: Tidy up boot_selected_os()
Use struct bootm_info with this function, to avoiding needing to create a new one. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
parent
b5d397f489
commit
725ddf1f24
@ -1092,8 +1092,7 @@ int bootm_run_states(struct bootm_info *bmi, int states)
|
|||||||
if (!ret && (states & BOOTM_STATE_OS_FAKE_GO)) {
|
if (!ret && (states & BOOTM_STATE_OS_FAKE_GO)) {
|
||||||
char *cmd_list = env_get("fakegocmd");
|
char *cmd_list = env_get("fakegocmd");
|
||||||
|
|
||||||
ret = boot_selected_os(bmi->argc, bmi->argv,
|
ret = boot_selected_os(BOOTM_STATE_OS_FAKE_GO, bmi, boot_fn);
|
||||||
BOOTM_STATE_OS_FAKE_GO, images, boot_fn);
|
|
||||||
if (!ret && cmd_list)
|
if (!ret && cmd_list)
|
||||||
ret = run_command_list(cmd_list, -1, 0);
|
ret = run_command_list(cmd_list, -1, 0);
|
||||||
}
|
}
|
||||||
@ -1107,8 +1106,7 @@ int bootm_run_states(struct bootm_info *bmi, int states)
|
|||||||
|
|
||||||
/* Now run the OS! We hope this doesn't return */
|
/* Now run the OS! We hope this doesn't return */
|
||||||
if (!ret && (states & BOOTM_STATE_OS_GO))
|
if (!ret && (states & BOOTM_STATE_OS_GO))
|
||||||
ret = boot_selected_os(bmi->argc, bmi->argv, BOOTM_STATE_OS_GO,
|
ret = boot_selected_os(BOOTM_STATE_OS_GO, bmi, boot_fn);
|
||||||
images, boot_fn);
|
|
||||||
|
|
||||||
/* Deal with any fallout */
|
/* Deal with any fallout */
|
||||||
err:
|
err:
|
||||||
|
@ -566,20 +566,15 @@ __weak void board_preboot_os(void)
|
|||||||
/* please define board specific board_preboot_os() */
|
/* please define board specific board_preboot_os() */
|
||||||
}
|
}
|
||||||
|
|
||||||
int boot_selected_os(int argc, char *const argv[], int state,
|
int boot_selected_os(int state, struct bootm_info *bmi, boot_os_fn *boot_fn)
|
||||||
struct bootm_headers *images, boot_os_fn *boot_fn)
|
|
||||||
{
|
{
|
||||||
struct bootm_info bmi;
|
|
||||||
arch_preboot_os();
|
arch_preboot_os();
|
||||||
board_preboot_os();
|
board_preboot_os();
|
||||||
|
|
||||||
bmi.argc = argc;
|
boot_fn(state, bmi);
|
||||||
bmi.argv = argv;
|
|
||||||
bmi.images = images;
|
|
||||||
boot_fn(state, &bmi);
|
|
||||||
|
|
||||||
/* Stand-alone may return when 'autostart' is 'no' */
|
/* Stand-alone may return when 'autostart' is 'no' */
|
||||||
if (images->os.type == IH_TYPE_STANDALONE ||
|
if (bmi->images->os.type == IH_TYPE_STANDALONE ||
|
||||||
IS_ENABLED(CONFIG_SANDBOX) ||
|
IS_ENABLED(CONFIG_SANDBOX) ||
|
||||||
state == BOOTM_STATE_OS_FAKE_GO) /* We expect to return */
|
state == BOOTM_STATE_OS_FAKE_GO) /* We expect to return */
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -91,8 +91,7 @@ boot_os_fn *bootm_os_get_boot_func(int os);
|
|||||||
int bootm_host_load_images(const void *fit, int cfg_noffset);
|
int bootm_host_load_images(const void *fit, int cfg_noffset);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int boot_selected_os(int argc, char *const argv[], int state,
|
int boot_selected_os(int state, struct bootm_info *bmi, boot_os_fn *boot_fn);
|
||||||
struct bootm_headers *images, boot_os_fn *boot_fn);
|
|
||||||
|
|
||||||
ulong bootm_disable_interrupts(void);
|
ulong bootm_disable_interrupts(void);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user