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 a bit more



details:   https://anonhg.NetBSD.org/src/rev/8af56c3f2c61
branches:  trunk
changeset: 549435:8af56c3f2c61
user:      aymeric <aymeric%NetBSD.org@localhost>
date:      Mon Jul 14 09:46:06 2003 +0000

description:
. 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.

diffstat:

 sys/arch/ofppc/stand/ofwboot/Locore.c   |  11 ++++-----
 sys/arch/ofppc/stand/ofwboot/boot.c     |  11 +++++----
 sys/arch/ofppc/stand/ofwboot/openfirm.h |  36 +++++++++++++++++---------------
 3 files changed, 30 insertions(+), 28 deletions(-)

diffs (135 lines):

diff -r 73fc969e947b -r 8af56c3f2c61 sys/arch/ofppc/stand/ofwboot/Locore.c
--- a/sys/arch/ofppc/stand/ofwboot/Locore.c     Mon Jul 14 09:44:00 2003 +0000
+++ b/sys/arch/ofppc/stand/ofwboot/Locore.c     Mon Jul 14 09:46:06 2003 +0000
@@ -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 @@
 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 @@
 }
 #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
diff -r 73fc969e947b -r 8af56c3f2c61 sys/arch/ofppc/stand/ofwboot/boot.c
--- a/sys/arch/ofppc/stand/ofwboot/boot.c       Mon Jul 14 09:44:00 2003 +0000
+++ b/sys/arch/ofppc/stand/ofwboot/boot.c       Mon Jul 14 09:46:06 2003 +0000
@@ -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 @@
 }
 
 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 @@
        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 @@
        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();
 }
diff -r 73fc969e947b -r 8af56c3f2c61 sys/arch/ofppc/stand/ofwboot/openfirm.h
--- a/sys/arch/ofppc/stand/ofwboot/openfirm.h   Mon Jul 14 09:44:00 2003 +0000
+++ b/sys/arch/ofppc/stand/ofwboot/openfirm.h   Mon Jul 14 09:46:06 2003 +0000
@@ -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));
+#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 __P((int handle, char *prop, void *buf, int len));
+int OF_setprop(int, char *, void *, int);
 #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));
-
+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);



Home | Main Index | Thread Index | Old Index