x86: Move x86 zboot state into struct bootm_info
This structure is supposed to handle any type of booting
programmatically, i.e. without needing a command to be executed. Move
the x86-specific members into it and use it instead of
struct zboot_state. Provide a macro so access is possible without adding
lots of #ifdefs to the code.
This will allow the struct to be used for all four types of booting
(bootm, bootz, booti and zboot).
Call bootm_init() to init the state, to match other boot methods.
Note that some rationalisation could be performed on this. But this
is tricky since addresses are stored as strings in several places. Also
some strings combine multiple arguments into one. So to keep this task
somewhat manageable, we content ourselves with just getting everything
into the same struct
Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/arch/x86/lib/zimage.c b/arch/x86/lib/zimage.c
index 8d79141..1dbebfe 100644
--- a/arch/x86/lib/zimage.c
+++ b/arch/x86/lib/zimage.c
@@ -56,7 +56,7 @@
#define COMMAND_LINE_SIZE 2048
/* Current state of the boot */
-struct zboot_state state;
+struct bootm_info state;
static void build_command_line(char *command_line, int auto_boot)
{
@@ -642,7 +642,7 @@
void zboot_start(ulong bzimage_addr, ulong bzimage_size, ulong initrd_addr,
ulong initrd_size, ulong base_addr, const char *cmdline)
{
- memset(&state, '\0', sizeof(state));
+ bootm_init(&state);
state.bzimage_size = bzimage_size;
state.initrd_addr = initrd_addr;