. ANSIfy a bit more

. use the boot_entry_t type for the entry point

Makes ofwboot compile with -Wmissing-prototypes -Wstrict-prototypes, as
suggested by Chuck Silvers in a private e-mail.
This commit is contained in:
aymeric 2003-07-14 09:46:06 +00:00
parent 3f02ac18b7
commit 2b846f3e47
3 changed files with 31 additions and 29 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: Locore.c,v 1.9 2003/06/26 20:43:48 aymeric Exp $ */
/* $NetBSD: Locore.c,v 1.10 2003/07/14 09:46:06 aymeric Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -37,10 +37,10 @@
#include <machine/cpu.h>
static int (*openfirmware_entry) __P((void *));
static int openfirmware __P((void *));
static int (*openfirmware_entry)(void *);
static int openfirmware(void *);
static void setup __P((void));
static void setup(void);
static int stack[8192/4 + 4];
@ -81,7 +81,6 @@ static void
startup(void *vpd, int res, int (*openfirm)(void *), char *arg, int argl)
{
extern char _end[], _edata[];
extern int main();
memset(_edata, 0, (_end - _edata));
openfirmware_entry = openfirm;
@ -490,7 +489,7 @@ OF_chain(void *virt, u_int size, void (*entry)(), void *arg, u_int len)
}
#else
void
OF_chain(void *virt, u_int size, void (*entry)(), void *arg, u_int len)
OF_chain(void *virt, u_int size, boot_entry_t entry, void *arg, u_int len)
{
/*
* This is a REALLY dirty hack till the firmware gets this going

View File

@ -1,4 +1,4 @@
/* $NetBSD: boot.c,v 1.13 2003/06/26 20:44:51 aymeric Exp $ */
/* $NetBSD: boot.c,v 1.14 2003/07/14 09:46:07 aymeric Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -93,6 +93,7 @@
#include <machine/cpu.h>
#include "alloc.h"
#include "boot.h"
#include "ofdev.h"
#include "openfirm.h"
@ -152,7 +153,7 @@ parseargs(char *str, int *howtop)
}
static void
chain(void entry(), char *args, void *ssym, void *esym)
chain(boot_entry_t entry, char *args, void *ssym, void *esym)
{
extern char end[], *cp;
u_int l, magic = 0x19730224;
@ -176,7 +177,7 @@ chain(void entry(), char *args, void *ssym, void *esym)
l += sizeof(esym);
DPRINTF("args + l -> %p\n", args + l);
OF_chain((void *)RELOC, end - (char *)RELOC, entry, args, l);
OF_chain((void *) RELOC, end - (char *)RELOC, entry, args, l);
panic("chain");
}
@ -275,8 +276,8 @@ main(void)
esym = (void *)marks[MARK_END];
printf(" start=0x%x\n", entry);
__syncicache((void *)entry, (u_int)ssym - (u_int)entry);
chain((void *)entry, bootline, ssym, esym);
__syncicache((void *) entry, (u_int) ssym - (u_int) entry);
chain((boot_entry_t) entry, bootline, ssym, esym);
OF_exit();
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: openfirm.h,v 1.3 2002/09/18 01:45:04 chs Exp $ */
/* $NetBSD: openfirm.h,v 1.4 2003/07/14 09:46:07 aymeric Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -37,21 +37,23 @@
#include <sys/cdefs.h>
#include <sys/types.h>
__dead void OF_exit __P((void)) __attribute__((noreturn));
__dead void OF_boot __P((char *)) __attribute__((noreturn));
int OF_finddevice __P((char *name));
int OF_instance_to_package __P((int ihandle));
int OF_getprop __P((int handle, char *prop, void *buf, int buflen));
#ifdef __notyet__
int OF_setprop __P((int handle, char *prop, void *buf, int len));
#endif
int OF_open __P((char *dname));
void OF_close __P((int handle));
int OF_write __P((int handle, void *addr, int len));
int OF_read __P((int handle, void *addr, int len));
int OF_seek __P((int handle, u_quad_t pos));
void *OF_claim __P((void *virt, u_int size, u_int align));
void OF_release __P((void *virt, u_int size));
int OF_milliseconds __P((void));
void OF_chain __P((void *addr, u_int size, void (*entry)(), void *parm, u_int parmlen));
#include "boot.h"
__dead void OF_exit(void) __attribute__((noreturn));
__dead void OF_boot(char *) __attribute__((noreturn));
int OF_finddevice(char *);
int OF_instance_to_package(int);
int OF_getprop(int, char *, void *, int);
#ifdef __notyet__
int OF_setprop(int, char *, void *, int);
#endif
int OF_open(char *);
void OF_close(int);
int OF_write(int, void *, int);
int OF_read(int, void *, int);
int OF_seek(int, u_quad_t);
void *OF_alloc_mem(u_int);
void *OF_claim(void *, u_int, u_int);
void OF_release(void *, u_int);
int OF_milliseconds(void);
void OF_chain(void *, u_int, boot_entry_t, void *, u_int);