mirror of
https://gitlab.com/qemu-project/openbios.git
synced 2024-02-13 08:34:06 +08:00
Move a.out loader into the new C load implementation (also fix up the header includes in load.c).
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@801 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
committed by
Mark Cave-Ayland
parent
db474e634c
commit
43fe2ac4e8
@@ -68,7 +68,7 @@ is_aout(struct exec *ehdr)
|
||||
}
|
||||
|
||||
int
|
||||
aout_load(struct sys_info *info, const char *filename)
|
||||
aout_load(struct sys_info *info, ihandle_t dev)
|
||||
{
|
||||
int retval = -1;
|
||||
struct exec ehdr;
|
||||
@@ -80,7 +80,7 @@ aout_load(struct sys_info *info, const char *filename)
|
||||
/* Mark the saved-program-state as invalid */
|
||||
feval("0 state-valid !");
|
||||
|
||||
fd = open_io(filename);
|
||||
fd = open_ih(dev);
|
||||
if (!fd)
|
||||
goto out;
|
||||
|
||||
@@ -113,8 +113,8 @@ aout_load(struct sys_info *info, const char *filename)
|
||||
if (size < 7680)
|
||||
size = 7680;
|
||||
|
||||
|
||||
start = 0x4000; // N_TXTADDR(ehdr);
|
||||
fword("load-base");
|
||||
start = POP(); // N_TXTADDR(ehdr);
|
||||
|
||||
if (!check_mem_ranges(info, start, size))
|
||||
goto out;
|
||||
|
||||
@@ -17,15 +17,30 @@
|
||||
#include "config.h"
|
||||
#include "kernel/kernel.h"
|
||||
#include "libopenbios/bindings.h"
|
||||
#include "libopenbios/sys_info.h"
|
||||
#include "libopenbios/load.h"
|
||||
|
||||
#ifdef CONFIG_LOADER_AOUT
|
||||
#include "libopenbios/aout_load.h"
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LOADER_FCODE
|
||||
#include "libopenbios/fcode_load.h"
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LOADER_FORTH
|
||||
#include "libopenbios/forth_load.h"
|
||||
#endif
|
||||
|
||||
|
||||
void load(ihandle_t dev)
|
||||
{
|
||||
/* Invoke the loaders on the specified device */
|
||||
|
||||
#ifdef CONFIG_LOADER_AOUT
|
||||
aout_load(&sys_info, dev);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LOADER_FCODE
|
||||
fcode_load(dev);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user