. ANSIfy
. Fix a missing return . replace %x by %p to print pointers in OFW_DEBUG printf's
This commit is contained in:
parent
110312e089
commit
e9cabc8553
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: Locore.c,v 1.8 2002/10/25 18:19:43 briggs Exp $ */
|
||||
/* $NetBSD: Locore.c,v 1.9 2003/06/26 20:43:48 aymeric Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
|
||||
@ -31,16 +31,15 @@
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "openfirm.h"
|
||||
|
||||
#include <lib/libsa/stand.h>
|
||||
|
||||
#include <machine/cpu.h>
|
||||
|
||||
#include "openfirm.h"
|
||||
|
||||
static int (*openfirmware_entry) __P((void *));
|
||||
static int openfirmware __P((void *));
|
||||
|
||||
static void startup __P((void *, int, int (*)(void *), char *, int));
|
||||
static void setup __P((void));
|
||||
|
||||
static int stack[8192/4 + 4];
|
||||
@ -67,24 +66,22 @@ _start:
|
||||
");
|
||||
|
||||
static int
|
||||
openfirmware(arg)
|
||||
void *arg;
|
||||
openfirmware(void *arg)
|
||||
{
|
||||
int r;
|
||||
|
||||
asm volatile ("sync; isync");
|
||||
openfirmware_entry(arg);
|
||||
r = openfirmware_entry(arg);
|
||||
asm volatile ("sync; isync");
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
static void
|
||||
startup(vpd, res, openfirm, arg, argl)
|
||||
void *vpd;
|
||||
int res;
|
||||
int (*openfirm)(void *);
|
||||
char *arg;
|
||||
int argl;
|
||||
startup(void *vpd, int res, int (*openfirm)(void *), char *arg, int argl)
|
||||
{
|
||||
extern char etext[], _end[], _edata[];
|
||||
extern char _end[], _edata[];
|
||||
extern int main();
|
||||
|
||||
memset(_edata, 0, (_end - _edata));
|
||||
openfirmware_entry = openfirm;
|
||||
@ -94,7 +91,7 @@ startup(vpd, res, openfirm, arg, argl)
|
||||
}
|
||||
|
||||
__dead void
|
||||
OF_exit()
|
||||
OF_exit(void)
|
||||
{
|
||||
static struct {
|
||||
char *name;
|
||||
@ -111,8 +108,7 @@ OF_exit()
|
||||
}
|
||||
|
||||
__dead void
|
||||
OF_boot(bootspec)
|
||||
char *bootspec;
|
||||
OF_boot(char *bootspec)
|
||||
{
|
||||
static struct {
|
||||
char *name;
|
||||
@ -131,8 +127,7 @@ OF_boot(bootspec)
|
||||
}
|
||||
|
||||
int
|
||||
OF_finddevice(name)
|
||||
char *name;
|
||||
OF_finddevice(char *name)
|
||||
{
|
||||
static struct {
|
||||
char *name;
|
||||
@ -153,8 +148,7 @@ OF_finddevice(name)
|
||||
}
|
||||
|
||||
int
|
||||
OF_instance_to_package(ihandle)
|
||||
int ihandle;
|
||||
OF_instance_to_package(int ihandle)
|
||||
{
|
||||
static struct {
|
||||
char *name;
|
||||
@ -175,11 +169,7 @@ OF_instance_to_package(ihandle)
|
||||
}
|
||||
|
||||
int
|
||||
OF_getprop(handle, prop, buf, buflen)
|
||||
int handle;
|
||||
char *prop;
|
||||
void *buf;
|
||||
int buflen;
|
||||
OF_getprop(int handle, char *prop, void *buf, int buflen)
|
||||
{
|
||||
static struct {
|
||||
char *name;
|
||||
@ -207,11 +197,7 @@ OF_getprop(handle, prop, buf, buflen)
|
||||
|
||||
#ifdef __notyet__ /* Has a bug on FirePower */
|
||||
int
|
||||
OF_setprop(handle, prop, buf, len)
|
||||
int handle;
|
||||
char *prop;
|
||||
void *buf;
|
||||
int len;
|
||||
OF_setprop(int handle, char *prop, void *buf, int len)
|
||||
{
|
||||
static struct {
|
||||
char *name;
|
||||
@ -239,8 +225,7 @@ OF_setprop(handle, prop, buf, len)
|
||||
#endif
|
||||
|
||||
int
|
||||
OF_open(dname)
|
||||
char *dname;
|
||||
OF_open(char *dname)
|
||||
{
|
||||
static struct {
|
||||
char *name;
|
||||
@ -272,8 +257,7 @@ OF_open(dname)
|
||||
}
|
||||
|
||||
void
|
||||
OF_close(handle)
|
||||
int handle;
|
||||
OF_close(int handle)
|
||||
{
|
||||
static struct {
|
||||
char *name;
|
||||
@ -294,10 +278,7 @@ OF_close(handle)
|
||||
}
|
||||
|
||||
int
|
||||
OF_write(handle, addr, len)
|
||||
int handle;
|
||||
void *addr;
|
||||
int len;
|
||||
OF_write(int handle, void *addr, int len)
|
||||
{
|
||||
static struct {
|
||||
char *name;
|
||||
@ -315,7 +296,7 @@ OF_write(handle, addr, len)
|
||||
|
||||
#ifdef OFW_DEBUG
|
||||
if (len != 1)
|
||||
printf("OF_write(%d, %x, %x) -> ", handle, addr, len);
|
||||
printf("OF_write(%d, %p, %x) -> ", handle, addr, len);
|
||||
#endif
|
||||
args.ihandle = handle;
|
||||
args.addr = addr;
|
||||
@ -334,10 +315,7 @@ OF_write(handle, addr, len)
|
||||
}
|
||||
|
||||
int
|
||||
OF_read(handle, addr, len)
|
||||
int handle;
|
||||
void *addr;
|
||||
int len;
|
||||
OF_read(int handle, void *addr, int len)
|
||||
{
|
||||
static struct {
|
||||
char *name;
|
||||
@ -355,7 +333,7 @@ OF_read(handle, addr, len)
|
||||
|
||||
#ifdef OFW_DEBUG
|
||||
if (len != 1)
|
||||
printf("OF_read(%d, %x, %x) -> ", handle, addr, len);
|
||||
printf("OF_read(%d, %p, %x) -> ", handle, addr, len);
|
||||
#endif
|
||||
args.ihandle = handle;
|
||||
args.addr = addr;
|
||||
@ -374,9 +352,7 @@ OF_read(handle, addr, len)
|
||||
}
|
||||
|
||||
int
|
||||
OF_seek(handle, pos)
|
||||
int handle;
|
||||
u_quad_t pos;
|
||||
OF_seek(int handle, u_quad_t pos)
|
||||
{
|
||||
static struct {
|
||||
char *name;
|
||||
@ -411,10 +387,7 @@ OF_seek(handle, pos)
|
||||
}
|
||||
|
||||
void *
|
||||
OF_claim(virt, size, align)
|
||||
void *virt;
|
||||
u_int size;
|
||||
u_int align;
|
||||
OF_claim(void *virt, u_int size, u_int align)
|
||||
{
|
||||
static struct {
|
||||
char *name;
|
||||
@ -431,7 +404,7 @@ OF_claim(virt, size, align)
|
||||
};
|
||||
|
||||
#ifdef OFW_DEBUG
|
||||
printf("OF_claim(%x, %x, %x) -> ", virt, size, align);
|
||||
printf("OF_claim(%p, %x, %x) -> ", virt, size, align);
|
||||
#endif
|
||||
args.virt = virt;
|
||||
args.size = size;
|
||||
@ -443,15 +416,13 @@ OF_claim(virt, size, align)
|
||||
return (void *)-1;
|
||||
}
|
||||
#ifdef OFW_DEBUG
|
||||
printf("%x\n", args.baseaddr);
|
||||
printf("%p\n", args.baseaddr);
|
||||
#endif
|
||||
return args.baseaddr;
|
||||
}
|
||||
|
||||
void
|
||||
OF_release(virt, size)
|
||||
void *virt;
|
||||
u_int size;
|
||||
OF_release(void *virt, u_int size)
|
||||
{
|
||||
static struct {
|
||||
char *name;
|
||||
@ -466,7 +437,7 @@ OF_release(virt, size)
|
||||
};
|
||||
|
||||
#ifdef OFW_DEBUG
|
||||
printf("OF_release(%x, %x)\n", virt, size);
|
||||
printf("OF_release(%p, %x)\n", virt, size);
|
||||
#endif
|
||||
args.virt = virt;
|
||||
args.size = size;
|
||||
@ -474,7 +445,7 @@ OF_release(virt, size)
|
||||
}
|
||||
|
||||
int
|
||||
OF_milliseconds()
|
||||
OF_milliseconds(void)
|
||||
{
|
||||
static struct {
|
||||
char *name;
|
||||
@ -493,12 +464,7 @@ OF_milliseconds()
|
||||
|
||||
#ifdef __notyet__
|
||||
void
|
||||
OF_chain(virt, size, entry, arg, len)
|
||||
void *virt;
|
||||
u_int size;
|
||||
void (*entry)();
|
||||
void *arg;
|
||||
u_int len;
|
||||
OF_chain(void *virt, u_int size, void (*entry)(), void *arg, u_int len)
|
||||
{
|
||||
static struct {
|
||||
char *name;
|
||||
@ -524,12 +490,7 @@ OF_chain(virt, size, entry, arg, len)
|
||||
}
|
||||
#else
|
||||
void
|
||||
OF_chain(virt, size, entry, arg, len)
|
||||
void *virt;
|
||||
u_int size;
|
||||
void (*entry)();
|
||||
void *arg;
|
||||
u_int len;
|
||||
OF_chain(void *virt, u_int size, void (*entry)(), void *arg, u_int len)
|
||||
{
|
||||
/*
|
||||
* This is a REALLY dirty hack till the firmware gets this going
|
||||
@ -545,7 +506,7 @@ static int stdin;
|
||||
static int stdout;
|
||||
|
||||
static void
|
||||
setup()
|
||||
setup(void)
|
||||
{
|
||||
int chosen;
|
||||
|
||||
@ -559,8 +520,7 @@ setup()
|
||||
}
|
||||
|
||||
void
|
||||
putchar(c)
|
||||
int c;
|
||||
putchar(int c)
|
||||
{
|
||||
char ch = c;
|
||||
|
||||
@ -570,7 +530,7 @@ putchar(c)
|
||||
}
|
||||
|
||||
int
|
||||
getchar()
|
||||
getchar(void)
|
||||
{
|
||||
unsigned char ch = '\0';
|
||||
int l;
|
||||
|
Loading…
Reference in New Issue
Block a user