linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / arch / powerpc / boot / main.c
index 6040bc8..55ec598 100644 (file)
@@ -8,9 +8,6 @@
  * as published by the Free Software Foundation; either version
  * 2 of the License, or (at your option) any later version.
  */
-
-#define __KERNGLUE__
-
 #include <stdarg.h>
 #include <stddef.h>
 #include "elf.h"
@@ -36,14 +33,6 @@ extern char _vmlinux_end[];
 extern char _initrd_start[];
 extern char _initrd_end[];
 
-/* A buffer that may be edited by tools operating on a zImage binary so as to
- * edit the command line passed to vmlinux (by setting /chosen/bootargs).
- * The buffer is put in it's own section so that tools may locate it easier.
- */
-static char builtin_cmdline[512]
-       __attribute__((section("__builtin_cmdline")));
-
-
 struct addr_range {
        unsigned long addr;
        unsigned long size;
@@ -163,7 +152,7 @@ static int is_elf64(void *hdr)
        elf64ph = (Elf64_Phdr *)((unsigned long)elf64 +
                                 (unsigned long)elf64->e_phoff);
        for (i = 0; i < (unsigned int)elf64->e_phnum; i++, elf64ph++)
-               if (elf64ph->p_type == PT_LOAD)
+               if (elf64ph->p_type == PT_LOAD && elf64ph->p_offset != 0)
                        break;
        if (i >= (unsigned int)elf64->e_phnum)
                return 0;
@@ -204,7 +193,7 @@ static int is_elf32(void *hdr)
        elf32 = (Elf32_Ehdr *)elfheader;
        elf32ph = (Elf32_Phdr *) ((unsigned long)elf32 + elf32->e_phoff);
        for (i = 0; i < elf32->e_phnum; i++, elf32ph++)
-               if (elf32ph->p_type == PT_LOAD)
+               if (elf32ph->p_type == PT_LOAD && elf32ph->p_offset != 0)
                        break;
        if (i >= elf32->e_phnum)
                return 0;
@@ -215,23 +204,6 @@ static int is_elf32(void *hdr)
        return 1;
 }
 
-void export_cmdline(void* chosen_handle)
-{
-        int len;
-        char cmdline[2] = { 0, 0 };
-
-       if (builtin_cmdline[0] == 0)
-               return;
-
-        len = getprop(chosen_handle, "bootargs", cmdline, sizeof(cmdline));
-        if (len > 0 && cmdline[0] != 0)
-               return;
-
-       setprop(chosen_handle, "bootargs", builtin_cmdline,
-               strlen(builtin_cmdline) + 1);
-}
-
-
 void start(unsigned long a1, unsigned long a2, void *promptr, void *sp)
 {
        int len;
@@ -317,8 +289,6 @@ void start(unsigned long a1, unsigned long a2, void *promptr, void *sp)
                memmove((void *)vmlinux.addr,(void *)vmlinuz.addr,vmlinuz.size);
        }
 
-       export_cmdline(chosen_handle);
-
        /* Skip over the ELF header */
 #ifdef DEBUG
        printf("... skipping 0x%lx bytes of ELF header\n\r",