Fix almost all remaining warnings

git-svn-id: svn://coreboot.org/openbios/openbios-devel@294 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
Blue Swirl
2008-12-20 17:15:47 +00:00
parent 2324d53cb4
commit 7e21fc929d
23 changed files with 101 additions and 53 deletions

View File

@@ -155,7 +155,7 @@ free( void *ptr )
if( !ptr )
return;
d = (alloc_desc_t*)(ptr - sizeof(alloc_desc_t));
d = (alloc_desc_t*)((char *)ptr - sizeof(alloc_desc_t));
d->next = ofmem.mfree;
/* insert in the (sorted) freelist */
@@ -168,7 +168,7 @@ free( void *ptr )
void *
realloc( void *ptr, size_t size )
{
alloc_desc_t *d = (alloc_desc_t*)(ptr - sizeof(alloc_desc_t));
alloc_desc_t *d = (alloc_desc_t*)((char *)ptr - sizeof(alloc_desc_t));
char *p;
if( !ptr )

View File

@@ -26,10 +26,10 @@
#include "ofmem.h"
static void
transfer_control_to_elf( ulong entry )
transfer_control_to_elf( ulong elf_entry )
{
extern void call_elf( ulong entry );
printk("Starting ELF image at 0x%08lX\n", entry);
printk("Starting ELF image at 0x%08lX\n", elf_entry);
call_elf( 0x400000 );
//call_elf( entry );
@@ -37,7 +37,7 @@ transfer_control_to_elf( ulong entry )
}
static int
load_elf_rom( ulong *entry, int fd )
load_elf_rom( ulong *elf_entry, int fd )
{
int i, lszz_offs, elf_offs;
char buf[128], *addr;
@@ -55,7 +55,7 @@ load_elf_rom( ulong *entry, int fd )
if( !(phdr=elf_readhdrs(fd, elf_offs, &ehdr)) )
fatal_error("elf_readhdrs failed\n");
*entry = ehdr.e_entry;
*elf_entry = ehdr.e_entry;
/* load segments. Compressed ROM-image assumed to be located immediately
* after the last segment */
@@ -83,7 +83,8 @@ load_elf_rom( ulong *entry, int fd )
#if 0
/* patch CODE segment */
if( *entry >= phdr[i].p_vaddr && *entry < phdr[i].p_vaddr + s ) {
if( *elf_entry >= phdr[i].p_vaddr &&
*elf_entry < phdr[i].p_vaddr + s ) {
patch_newworld_rom( (char*)phdr[i].p_vaddr, s );
newworld_timer_hack( (char*)phdr[i].p_vaddr, s );
}
@@ -115,18 +116,18 @@ qemu_startup( void )
{
const char *paths[] = { "hd:0,\\zImage.chrp", NULL };
const char *args[] = { "root=/dev/hda2 console=ttyS0,115200", NULL };
ulong entry;
ulong elf_entry;
int i, fd;
for( i=0; paths[i]; i++ ) {
if( (fd=open_io(paths[i])) == -1 )
continue;
(void) load_elf_rom( &entry, fd );
(void) load_elf_rom( &elf_entry, fd );
close_io( fd );
encode_bootpath( paths[i], args[i] );
update_nvram();
transfer_control_to_elf( entry );
transfer_control_to_elf( elf_entry );
/* won't come here */
}
printk("*** Boot failure! No secondary bootloader specified ***\n");

View File

@@ -20,6 +20,7 @@
#include "openbios/config.h"
#include "openbios/bindings.h"
#include "openbios/drivers.h"
#include "libc/string.h"
#include "qemu/qemu.h"
#include "ofmem.h"
@@ -155,7 +156,7 @@ ciface_quiesce( ulong args[], ulong ret[] )
static void
ciface_milliseconds( ulong args[], ulong ret[] )
{
extern unsigned long get_timer_freq();
extern unsigned long get_timer_freq(void);
static ulong mticks=0, usecs=0;
ulong t;

View File

@@ -97,7 +97,7 @@ printk( const char *fmt, ... )
static char *nvram;
void macio_nvram_init(char *path, uint32_t addr)
void macio_nvram_init(const char *path, uint32_t addr)
{
phandle_t chosen, aliases;
phandle_t dnode;

View File

@@ -19,8 +19,6 @@
extern int vfd_draw_str( const char *str );
extern void vfd_close( void );
extern int console_draw_str( const char *str );
/* console.c */
int serial_init(void);