]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - lib_i386/bootm.c
rename include/zlib.h to include/u-boot/zlib.h
[people/ms/u-boot.git] / lib_i386 / bootm.c
index 452eef73bdaf91106b52eef7603e6662996d3e60..f96d7bd6daa329fb9fe8f9d663306f60ba3d97e9 100644 (file)
 #include <common.h>
 #include <command.h>
 #include <image.h>
-#include <zlib.h>
+#include <u-boot/zlib.h>
 #include <asm/byteorder.h>
 #include <asm/zimage.h>
 
 /*cmd_boot.c*/
-extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
-
-void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
-               bootm_headers_t *images)
+int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
 {
        void            *base_ptr;
        ulong           os_data, os_len;
-       ulong           initrd_start, initrd_end;
        image_header_t  *hdr;
-       int             ret;
+
 #if defined(CONFIG_FIT)
        const void      *data;
        size_t          len;
 #endif
 
-       ret = boot_get_ramdisk (argc, argv, images, IH_ARCH_I386,
-                       &initrd_start, &initrd_end);
-       if (ret)
-               goto error;
+       if ((flag != 0) && (flag != BOOTM_STATE_OS_GO))
+               return 1;
 
        if (images->legacy_hdr_valid) {
                hdr = images->legacy_hdr_os;
@@ -76,7 +70,7 @@ void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
        }
 
        base_ptr = load_zimage ((void*)os_data, os_len,
-                       initrd_start, initrd_end - initrd_start, 0);
+                       images->rd_start, images->rd_end - images->rd_start, 0);
 
        if (NULL == base_ptr) {
                printf ("## Kernel loading failed ...\n");
@@ -94,9 +88,7 @@ void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
 
        boot_zimage(base_ptr);
        /* does not return */
-       return;
 
 error:
-       do_reset (cmdtp, flag, argc, argv);
-       return;
+       return 1;
 }