mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-05-05 12:46:14 +02:00
x86: Rename state to bmi
Use the common name for the struct, in preparation for passing it around between functions. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
75e85df796
commit
00cfb598e7
@ -42,7 +42,7 @@ enum {
|
||||
ZBOOT_STATE_COUNT = 5,
|
||||
};
|
||||
|
||||
extern struct bootm_info state;
|
||||
extern struct bootm_info bmi;
|
||||
|
||||
/**
|
||||
* zboot_load() - Load a zimage
|
||||
|
||||
@ -56,7 +56,7 @@ DECLARE_GLOBAL_DATA_PTR;
|
||||
#define COMMAND_LINE_SIZE 2048
|
||||
|
||||
/* Current state of the boot */
|
||||
struct bootm_info state;
|
||||
struct bootm_info bmi;
|
||||
|
||||
static void build_command_line(char *command_line, int auto_boot)
|
||||
{
|
||||
@ -371,8 +371,8 @@ int zboot_load(void)
|
||||
struct boot_params *base_ptr;
|
||||
int ret;
|
||||
|
||||
if (state.base_ptr) {
|
||||
struct boot_params *from = (struct boot_params *)state.base_ptr;
|
||||
if (bmi.base_ptr) {
|
||||
struct boot_params *from = (struct boot_params *)bmi.base_ptr;
|
||||
|
||||
base_ptr = (struct boot_params *)DEFAULT_SETUP_BASE;
|
||||
log_debug("Building boot_params at 0x%8.8lx\n",
|
||||
@ -380,18 +380,18 @@ int zboot_load(void)
|
||||
memset(base_ptr, '\0', sizeof(*base_ptr));
|
||||
base_ptr->hdr = from->hdr;
|
||||
} else {
|
||||
base_ptr = load_zimage((void *)state.bzimage_addr, state.bzimage_size,
|
||||
&state.load_address);
|
||||
base_ptr = load_zimage((void *)bmi.bzimage_addr, bmi.bzimage_size,
|
||||
&bmi.load_address);
|
||||
if (!base_ptr) {
|
||||
puts("## Kernel loading failed ...\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
state.base_ptr = base_ptr;
|
||||
bmi.base_ptr = base_ptr;
|
||||
|
||||
ret = env_set_hex("zbootbase", map_to_sysmem(state.base_ptr));
|
||||
ret = env_set_hex("zbootbase", map_to_sysmem(bmi.base_ptr));
|
||||
if (!ret)
|
||||
ret = env_set_hex("zbootaddr", state.load_address);
|
||||
ret = env_set_hex("zbootaddr", bmi.load_address);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@ -400,12 +400,12 @@ int zboot_load(void)
|
||||
|
||||
int zboot_setup(void)
|
||||
{
|
||||
struct boot_params *base_ptr = state.base_ptr;
|
||||
struct boot_params *base_ptr = bmi.base_ptr;
|
||||
int ret;
|
||||
|
||||
ret = setup_zimage(base_ptr, (char *)base_ptr + COMMAND_LINE_OFFSET,
|
||||
0, state.initrd_addr, state.initrd_size,
|
||||
(ulong)state.cmdline);
|
||||
0, bmi.initrd_addr, bmi.initrd_size,
|
||||
(ulong)bmi.cmdline);
|
||||
if (ret)
|
||||
return -EINVAL;
|
||||
|
||||
@ -414,7 +414,7 @@ int zboot_setup(void)
|
||||
|
||||
int zboot_go(void)
|
||||
{
|
||||
struct boot_params *params = state.base_ptr;
|
||||
struct boot_params *params = bmi.base_ptr;
|
||||
struct setup_header *hdr = ¶ms->hdr;
|
||||
bool image_64bit;
|
||||
ulong entry;
|
||||
@ -422,7 +422,7 @@ int zboot_go(void)
|
||||
|
||||
disable_interrupts();
|
||||
|
||||
entry = state.load_address;
|
||||
entry = bmi.load_address;
|
||||
image_64bit = false;
|
||||
if (IS_ENABLED(CONFIG_X86_RUN_64BIT) &&
|
||||
(hdr->xloadflags & XLF_KERNEL_64)) {
|
||||
@ -430,7 +430,7 @@ int zboot_go(void)
|
||||
}
|
||||
|
||||
/* we assume that the kernel is in place */
|
||||
ret = boot_linux_kernel((ulong)state.base_ptr, entry, image_64bit);
|
||||
ret = boot_linux_kernel((ulong)bmi.base_ptr, entry, image_64bit);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@ -596,7 +596,7 @@ void zimage_dump(struct boot_params *base_ptr, bool show_cmdline)
|
||||
print_num("Start sys seg", hdr->start_sys_seg);
|
||||
print_num("Kernel version", hdr->kernel_version);
|
||||
version = zimage_get_kernel_version(base_ptr,
|
||||
(void *)state.bzimage_addr);
|
||||
(void *)bmi.bzimage_addr);
|
||||
if (version)
|
||||
printf(" @%p: %s\n", version, version);
|
||||
print_num("Type of loader", hdr->type_of_loader);
|
||||
@ -642,22 +642,22 @@ void zimage_dump(struct boot_params *base_ptr, bool show_cmdline)
|
||||
void zboot_start(ulong bzimage_addr, ulong bzimage_size, ulong initrd_addr,
|
||||
ulong initrd_size, ulong base_addr, const char *cmdline)
|
||||
{
|
||||
bootm_init(&state);
|
||||
bootm_init(&bmi);
|
||||
|
||||
state.bzimage_size = bzimage_size;
|
||||
state.initrd_addr = initrd_addr;
|
||||
state.initrd_size = initrd_size;
|
||||
bmi.bzimage_size = bzimage_size;
|
||||
bmi.initrd_addr = initrd_addr;
|
||||
bmi.initrd_size = initrd_size;
|
||||
if (base_addr) {
|
||||
state.base_ptr = map_sysmem(base_addr, 0);
|
||||
state.load_address = bzimage_addr;
|
||||
bmi.base_ptr = map_sysmem(base_addr, 0);
|
||||
bmi.load_address = bzimage_addr;
|
||||
} else {
|
||||
state.bzimage_addr = bzimage_addr;
|
||||
bmi.bzimage_addr = bzimage_addr;
|
||||
}
|
||||
state.cmdline = cmdline;
|
||||
bmi.cmdline = cmdline;
|
||||
}
|
||||
|
||||
void zboot_info(void)
|
||||
{
|
||||
printf("Kernel loaded at %08lx, setup_base=%p\n",
|
||||
state.load_address, state.base_ptr);
|
||||
bmi.load_address, bmi.base_ptr);
|
||||
}
|
||||
|
||||
@ -57,7 +57,7 @@ static int do_zboot_load(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||
static int do_zboot_setup(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||
char *const argv[])
|
||||
{
|
||||
if (!state.base_ptr) {
|
||||
if (!bmi.base_ptr) {
|
||||
printf("base is not set: use 'zboot load' first\n");
|
||||
return CMD_RET_FAILURE;
|
||||
}
|
||||
@ -97,7 +97,7 @@ static int do_zboot_go(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||
static int do_zboot_dump(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||
char *const argv[])
|
||||
{
|
||||
struct boot_params *base_ptr = state.base_ptr;
|
||||
struct boot_params *base_ptr = bmi.base_ptr;
|
||||
|
||||
if (argc > 1)
|
||||
base_ptr = (void *)hextoul(argv[1], NULL);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user