mirror of
https://gitlab.com/qemu-project/openbios.git
synced 2024-02-13 08:34:06 +08:00
Create a brand new ELF loader based upon arch/*/elfload.c and libopenbios/elfload.c combined together in libopenbios. This means
that each arch no longer needs its own ELF loader implementation. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@710 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
committed by
Mark Cave-Ayland
parent
6dd0574272
commit
1264ad95d2
@@ -1,6 +1,7 @@
|
||||
#ifndef _ASM_IO_H
|
||||
#define _ASM_IO_H
|
||||
|
||||
extern char _start, _end;
|
||||
extern unsigned long virt_offset;
|
||||
|
||||
#define phys_to_virt(phys) ((void *) ((unsigned long) (phys) - virt_offset))
|
||||
|
||||
@@ -23,6 +23,8 @@ typedef unsigned long long ucell;
|
||||
typedef __int128_t dcell;
|
||||
typedef __uint128_t ducell;
|
||||
|
||||
#define FMT_elf "%#x"
|
||||
|
||||
#define bitspercell (sizeof(cell)<<3)
|
||||
#define bitsperdcell (sizeof(dcell)<<3)
|
||||
|
||||
|
||||
@@ -40,6 +40,8 @@ typedef unsigned long long ducell;
|
||||
#define FMT_ucellx "%08x"
|
||||
#define FMT_ucellX "%08X"
|
||||
|
||||
#define FMT_elf "%#x"
|
||||
|
||||
#define bitspercell (sizeof(cell)<<3)
|
||||
#define bitsperdcell (sizeof(dcell)<<3)
|
||||
|
||||
|
||||
@@ -37,6 +37,10 @@ typedef unsigned long long ucell;
|
||||
#define FMT_ucellx "%016llx"
|
||||
#define FMT_ucellX "%016llX"
|
||||
|
||||
#define FMT_sizet "%lx"
|
||||
#define FMT_elf "%#llx"
|
||||
#define FMT_aout_ehdr "%x"
|
||||
|
||||
#ifdef NEED_FAKE_INT128_T
|
||||
typedef struct {
|
||||
uint64_t hi;
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "asm/types.h"
|
||||
|
||||
extern char _start, _end;
|
||||
extern unsigned long virt_offset;
|
||||
|
||||
#define phys_to_virt(phys) ((void *) ((unsigned long) (phys) - virt_offset))
|
||||
|
||||
@@ -29,6 +29,8 @@ typedef uint64_t ducell;
|
||||
#define FMT_ucellx "%08x"
|
||||
#define FMT_ucellX "%08X"
|
||||
|
||||
#define FMT_elf "%#x"
|
||||
|
||||
#define bitspercell (sizeof(cell)<<3)
|
||||
#define bitsperdcell (sizeof(dcell)<<3)
|
||||
|
||||
|
||||
@@ -19,11 +19,12 @@
|
||||
|
||||
#include "arch/common/elf.h"
|
||||
#include "asm/elf.h"
|
||||
#include "libopenbios/sys_info.h"
|
||||
|
||||
extern int is_elf( int fd, int offs );
|
||||
extern int find_elf( int fd );
|
||||
|
||||
extern Elf32_Phdr * elf_readhdrs( int fd, int offs, Elf32_Ehdr *e );
|
||||
extern int elf_load(struct sys_info *info, const char *filename, const char *cmdline, void **boot_notes);
|
||||
extern int is_elf(Elf_ehdr *ehdr);
|
||||
extern int find_elf(Elf_ehdr *ehdr);
|
||||
|
||||
extern Elf_phdr * elf_readhdrs(int offset, Elf_ehdr *ehdr);
|
||||
|
||||
#endif /* _H_ELFLOAD */
|
||||
Reference in New Issue
Block a user