mirror of
https://gitlab.com/qemu-project/openbios.git
synced 2024-02-13 08:34:06 +08:00
Move the Fcode loader from arch/*/fcodeload.c to libopenbios/fcode_load.c.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@714 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
committed by
Mark Cave-Ayland
parent
08ee7445f1
commit
0933f8c540
@@ -10,6 +10,7 @@
|
||||
#include "libopenbios/sys_info.h"
|
||||
#include "libopenbios/elf_load.h"
|
||||
#include "libopenbios/aout_load.h"
|
||||
#include "libopenbios/fcode_load.h"
|
||||
#include "boot.h"
|
||||
|
||||
struct sys_info sys_info;
|
||||
|
||||
@@ -9,9 +9,6 @@
|
||||
// linux_load.c
|
||||
int linux_load(struct sys_info *info, const char *file, const char *cmdline);
|
||||
|
||||
// fcodeload.c
|
||||
int fcode_load(const char *filename);
|
||||
|
||||
// context.c
|
||||
extern struct context * volatile __context;
|
||||
uint64_t start_elf(uint64_t entry_point, uint64_t param);
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
<object source="switch.S"/>
|
||||
<object source="linux_load.c"/>
|
||||
<object source="sys_info.c"/>
|
||||
<object source="fcodeload.c"/>
|
||||
<object source="ofmem_sparc64.c"/>
|
||||
<object source="entry.S"/>
|
||||
<object source="vectors.S"/>
|
||||
|
||||
22
include/libopenbios/fcode_load.h
Normal file
22
include/libopenbios/fcode_load.h
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Creation Date: <2010/03/22 18:00:00 mcayland>
|
||||
* Time-stamp: <2010/03/22 18:00:00 mcayland>
|
||||
*
|
||||
* <fcode_load.h>
|
||||
*
|
||||
* Fcode loader
|
||||
*
|
||||
* Copyright (C) 2010 Mark Cave-Ayland (mark.cave-ayland@siriusit.co.uk)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _H_FCODELOAD
|
||||
#define _H_FCODELOAD
|
||||
|
||||
extern int fcode_load(const char *filename);
|
||||
|
||||
#endif /* _H_FCODELOAD */
|
||||
@@ -17,6 +17,7 @@
|
||||
<object source="elf_load.c" condition="AMD64"/>
|
||||
<object source="font_8x8.c" condition="FONT_8X8"/>
|
||||
<object source="font_8x16.c" condition="FONT_8X16"/>
|
||||
<object source="fcode_load.c" condition="SPARC64"/>
|
||||
<object source="forth_load.c" condition="X86"/>
|
||||
<object source="ipchecksum.c"/>
|
||||
<object source="linuxbios_info.c" condition="LINUXBIOS"/>
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
#include "config.h"
|
||||
#include "kernel/kernel.h"
|
||||
#include "libopenbios/bindings.h"
|
||||
#include "libopenbios/fcode_load.h"
|
||||
#include "libopenbios/sys_info.h"
|
||||
#include "libc/diskio.h"
|
||||
#include "boot.h"
|
||||
#define printf printk
|
||||
#define debug printk
|
||||
|
||||
@@ -59,7 +59,7 @@ int fcode_load(const char *filename)
|
||||
|
||||
seek_io(fd, offset + sizeof(fcode_header));
|
||||
|
||||
if ((unsigned long)read_io(fd, (void *)start, size) != size) {
|
||||
if ((size_t)read_io(fd, (void *)start, size) != size) {
|
||||
printf("Can't read file (size 0x%lx)\n", size);
|
||||
goto out;
|
||||
}
|
||||
@@ -76,8 +76,6 @@ int fcode_load(const char *filename)
|
||||
|
||||
feval("-1 state-valid !");
|
||||
|
||||
retval = 0;
|
||||
|
||||
out:
|
||||
close_io(fd);
|
||||
return retval;
|
||||
Reference in New Issue
Block a user