Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/ofppc/stand/ofwboot . ANSIfy



details:   https://anonhg.NetBSD.org/src/rev/fd3c77b10eb3
branches:  trunk
changeset: 548435:fd3c77b10eb3
user:      aymeric <aymeric%NetBSD.org@localhost>
date:      Thu Jun 26 20:43:48 2003 +0000

description:
. ANSIfy
. Fix a missing return
. replace %x by %p to print pointers in OFW_DEBUG printf's

diffstat:

 sys/arch/ofppc/stand/ofwboot/Locore.c |  110 ++++++++++-----------------------
 1 files changed, 35 insertions(+), 75 deletions(-)

diffs (truncated from 312 to 300 lines):

diff -r 112ddfe8c84f -r fd3c77b10eb3 sys/arch/ofppc/stand/ofwboot/Locore.c
--- a/sys/arch/ofppc/stand/ofwboot/Locore.c     Thu Jun 26 20:42:38 2003 +0000
+++ b/sys/arch/ofppc/stand/ofwboot/Locore.c     Thu Jun 26 20:43:48 2003 +0000
@@ -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 @@
 ");
 
 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 @@
 }
 
 __dead void
-OF_exit()
+OF_exit(void)
 {
        static struct {
                char *name;
@@ -111,8 +108,7 @@
 }
 
 __dead void
-OF_boot(bootspec)
-        char *bootspec;
+OF_boot(char *bootspec)
 {
        static struct {
                char *name;
@@ -131,8 +127,7 @@
 }
 
 int
-OF_finddevice(name)
-       char *name;
+OF_finddevice(char *name)
 {
        static struct {
                char *name;
@@ -153,8 +148,7 @@
 }
 
 int
-OF_instance_to_package(ihandle)
-       int ihandle;
+OF_instance_to_package(int ihandle)
 {
        static struct {
                char *name;
@@ -175,11 +169,7 @@
 }
 
 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 @@
 
 #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 @@
 #endif
 
 int
-OF_open(dname)
-       char *dname;
+OF_open(char *dname)
 {
        static struct {
                char *name;
@@ -272,8 +257,7 @@
 }
 
 void
-OF_close(handle)
-       int handle;
+OF_close(int handle)
 {
        static struct {
                char *name;
@@ -294,10 +278,7 @@
 }
 
 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 @@
 
 #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 @@
 }
 
 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 @@
 
 #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 @@
 }
 
 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 @@
 }
 
 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 @@
        };
 
 #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 @@
                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 @@
        };
        
 #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 @@
 }
 
 int
-OF_milliseconds()
+OF_milliseconds(void)
 {
        static struct {
                char *name;
@@ -493,12 +464,7 @@
 
 #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 @@
 }
 #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 stdout;
 
 static void
-setup()
+setup(void)
 {
        int chosen;
        
@@ -559,8 +520,7 @@
 }
 
 void
-putchar(c)
-       int c;
+putchar(int c)



Home | Main Index | Thread Index | Old Index