]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
bootm: move lmb into the bootm_headers_t structure
authorKumar Gala <galak@kernel.crashing.org>
Fri, 15 Aug 2008 13:24:40 +0000 (08:24 -0500)
committerWolfgang Denk <wd@denx.de>
Tue, 26 Aug 2008 21:38:48 +0000 (23:38 +0200)
To allow for persistent state between future bootm subcommands we
need the lmb to exist in a global state.
Moving it into the bootm_headers_t allows us to do that.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
common/cmd_bootm.c
include/image.h
lib_m68k/bootm.c
lib_ppc/bootm.c
lib_sparc/bootm.c

index 022cef8460ada2bed9a1774592b575848937bbe5..dc88e6307b6fc619765b884d81e5f2add2a5d72c 100644 (file)
@@ -168,20 +168,17 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        phys_size_t     mem_size;
        int             ret;
 
-       struct lmb lmb;
-
        memset ((void *)&images, 0, sizeof (images));
        images.verify = getenv_yesno ("verify");
-       images.lmb = &lmb;
 
-       lmb_init(&lmb);
+       lmb_init(&images.lmb);
 
        mem_start = getenv_bootm_low();
        mem_size = getenv_bootm_size();
 
-       lmb_add(&lmb, (phys_addr_t)mem_start, mem_size);
+       lmb_add(&images.lmb, (phys_addr_t)mem_start, mem_size);
 
-       board_lmb_reserve(&lmb);
+       board_lmb_reserve(&images.lmb);
 
        /* get kernel image header, start address and length */
        os_hdr = boot_get_kernel (cmdtp, flag, argc, argv,
@@ -387,7 +384,7 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 
        show_boot_progress (8);
 
-       lmb_reserve(&lmb, load_start, (load_end - load_start));
+       lmb_reserve(&images.lmb, load_start, (load_end - load_start));
 
        switch (os) {
        default:                        /* handled by (original) Linux case */
index 653cbc6ce377853ebbf3aa3cd899fc02814b0ed6..c1acd7b822f636e45ac62d839d9b56e9c78f94f5 100644 (file)
@@ -229,7 +229,9 @@ typedef struct bootm_headers {
        ulong           ft_len;         /* length of flat device tree */
 
        int             verify;         /* getenv("verify")[0] != 'n' */
-       struct lmb      *lmb;           /* for memory mgmt */
+#ifndef USE_HOSTCC
+       struct lmb      lmb;            /* for memory mgmt */
+#endif
 } bootm_headers_t;
 
 /*
index 241721dad769fd2304a604ea332aa6f93f1559d5..1c3b9c92192e75e1a955e552da54d2c08fe2008c 100644 (file)
@@ -58,7 +58,7 @@ void do_bootm_linux(cmd_tbl_t * cmdtp, int flag,
        ulong bootmap_base;
        bd_t  *kbd;
        void  (*kernel) (bd_t *, ulong, ulong, ulong, ulong);
-       struct lmb *lmb = images->lmb;
+       struct lmb *lmb = &images->lmb;
 
        bootmap_base = getenv_bootm_low();
 
index a3e632f12fef175f2c560d1da36c0da592374770..b86169a93babffb6248980fe8ed1dc13d1b2f989 100644 (file)
@@ -73,7 +73,7 @@ do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
                          ulong r7, ulong r8, ulong r9);
        int     ret;
        ulong   of_size = images->ft_len;
-       struct lmb *lmb = images->lmb;
+       struct lmb *lmb = &images->lmb;
 
 #if defined(CONFIG_OF_LIBFDT)
        char    *of_flat_tree = images->ft_addr;
index 71d34baaddf3cac0a5a4849ae12e6530c79e0457..aac05e4b264f65a72c2e5b4a73d2732353b08b5e 100644 (file)
@@ -93,7 +93,7 @@ void do_bootm_linux(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[],
        unsigned int data, len, checksum;
        unsigned int initrd_addr, kernend;
        void (*kernel) (struct linux_romvec *, void *);
-       struct lmb *lmb = images->lmb;
+       struct lmb *lmb = &images->lmb;
        int ret;
 
        if (images->legacy_hdr_valid) {