summaryrefslogtreecommitdiff
path: root/arch/powerpc/boot/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/boot/main.c')
-rw-r--r--arch/powerpc/boot/main.c66
1 files changed, 0 insertions, 66 deletions
diff --git a/arch/powerpc/boot/main.c b/arch/powerpc/boot/main.c
index 03c0ccaecf29..30390621203d 100644
--- a/arch/powerpc/boot/main.c
+++ b/arch/powerpc/boot/main.c
@@ -36,76 +36,10 @@ struct addr_range {
unsigned long size;
};
-struct elf_info {
- unsigned long loadsize;
- unsigned long memsize;
- unsigned long elfoffset;
-};
-
typedef void (*kernel_entry_t)(unsigned long, unsigned long, void *);
#undef DEBUG
-static int parse_elf64(void *hdr, struct elf_info *info)
-{
- Elf64_Ehdr *elf64 = hdr;
- Elf64_Phdr *elf64ph;
- unsigned int i;
-
- if (!(elf64->e_ident[EI_MAG0] == ELFMAG0 &&
- elf64->e_ident[EI_MAG1] == ELFMAG1 &&
- elf64->e_ident[EI_MAG2] == ELFMAG2 &&
- elf64->e_ident[EI_MAG3] == ELFMAG3 &&
- elf64->e_ident[EI_CLASS] == ELFCLASS64 &&
- elf64->e_ident[EI_DATA] == ELFDATA2MSB &&
- elf64->e_type == ET_EXEC &&
- elf64->e_machine == EM_PPC64))
- return 0;
-
- 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)
- break;
- if (i >= (unsigned int)elf64->e_phnum)
- return 0;
-
- info->loadsize = (unsigned long)elf64ph->p_filesz;
- info->memsize = (unsigned long)elf64ph->p_memsz;
- info->elfoffset = (unsigned long)elf64ph->p_offset;
-
- return 1;
-}
-
-static int parse_elf32(void *hdr, struct elf_info *info)
-{
- Elf32_Ehdr *elf32 = hdr;
- Elf32_Phdr *elf32ph;
- unsigned int i;
-
- if (!(elf32->e_ident[EI_MAG0] == ELFMAG0 &&
- elf32->e_ident[EI_MAG1] == ELFMAG1 &&
- elf32->e_ident[EI_MAG2] == ELFMAG2 &&
- elf32->e_ident[EI_MAG3] == ELFMAG3 &&
- elf32->e_ident[EI_CLASS] == ELFCLASS32 &&
- elf32->e_ident[EI_DATA] == ELFDATA2MSB &&
- elf32->e_type == ET_EXEC &&
- elf32->e_machine == EM_PPC))
- return 0;
-
- elf32ph = (Elf32_Phdr *) ((unsigned long)elf32 + elf32->e_phoff);
- for (i = 0; i < elf32->e_phnum; i++, elf32ph++)
- if (elf32ph->p_type == PT_LOAD)
- break;
- if (i >= elf32->e_phnum)
- return 0;
-
- info->loadsize = elf32ph->p_filesz;
- info->memsize = elf32ph->p_memsz;
- info->elfoffset = elf32ph->p_offset;
- return 1;
-}
-
static struct addr_range prep_kernel(void)
{
char elfheader[256];