diff options
author | Joel Sing <jsing@cvs.openbsd.org> | 2009-08-17 14:23:10 +0000 |
---|---|---|
committer | Joel Sing <jsing@cvs.openbsd.org> | 2009-08-17 14:23:10 +0000 |
commit | 41a769e460c62f193a71ca69b370bae198b6bfc5 (patch) | |
tree | b58acd52b85ee3112d536dd8e01b9cef71659b5e /sys/arch/sparc64 | |
parent | 7a7cf2f85f175623c4ce6a2faf7136be662c659c (diff) |
Use ANSI function declarations. No binary change.
ok deraadt@
Diffstat (limited to 'sys/arch/sparc64')
-rw-r--r-- | sys/arch/sparc64/stand/ofwboot/Locore.c | 102 | ||||
-rw-r--r-- | sys/arch/sparc64/stand/ofwboot/alloc.c | 11 | ||||
-rw-r--r-- | sys/arch/sparc64/stand/ofwboot/boot.c | 19 | ||||
-rw-r--r-- | sys/arch/sparc64/stand/ofwboot/net.c | 14 | ||||
-rw-r--r-- | sys/arch/sparc64/stand/ofwboot/netif_of.c | 24 | ||||
-rw-r--r-- | sys/arch/sparc64/stand/ofwboot/ofdev.c | 38 |
6 files changed, 58 insertions, 150 deletions
diff --git a/sys/arch/sparc64/stand/ofwboot/Locore.c b/sys/arch/sparc64/stand/ofwboot/Locore.c index 53d39a44e88..50cdee5059c 100644 --- a/sys/arch/sparc64/stand/ofwboot/Locore.c +++ b/sys/arch/sparc64/stand/ofwboot/Locore.c @@ -1,4 +1,4 @@ -/* $OpenBSD: Locore.c,v 1.8 2008/07/05 23:03:04 kettenis Exp $ */ +/* $OpenBSD: Locore.c,v 1.9 2009/08/17 14:23:09 jsing Exp $ */ /* $NetBSD: Locore.c,v 1.1 2000/08/20 14:58:36 mrg Exp $ */ /* @@ -54,12 +54,7 @@ asm (".text; .globl _entry; _entry: .long _start,0,0"); #endif __dead void -_start(vpd, res, openfirm, arg, argl) - void *vpd; - int res; - int (*openfirm)(void *); - char *arg; - int argl; +_start(void *vpd, int res, int (*openfirm)(void *), char *arg, int argl) { extern char etext[]; @@ -74,7 +69,7 @@ _start(vpd, res, openfirm, arg, argl) #endif __dead void -_rtt() +_rtt(void) { struct { cell_t name; @@ -90,7 +85,7 @@ _rtt() } void -OF_enter() +OF_enter(void) { struct { cell_t name; @@ -105,8 +100,7 @@ OF_enter() } int -OF_finddevice(name) - char *name; +OF_finddevice(char *name) { struct { cell_t name; @@ -126,8 +120,7 @@ OF_finddevice(name) } int -OF_instance_to_package(ihandle) - int ihandle; +OF_instance_to_package(int ihandle) { struct { cell_t name; @@ -147,11 +140,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) { struct { cell_t name; @@ -178,11 +167,7 @@ OF_getprop(handle, prop, buf, buflen) #ifdef __notyet__ /* Has a bug on FirePower */ int -OF_setprop(handle, prop, buf, len) - u_int handle; - char *prop; - void *buf; - int len; +OF_setprop(u_int handle, char *prop, void *buf, int len) { struct { cell_t name; @@ -209,8 +194,7 @@ OF_setprop(handle, prop, buf, len) #endif int -OF_open(dname) - char *dname; +OF_open(char *dname) { struct { cell_t name; @@ -231,8 +215,7 @@ OF_open(dname) } void -OF_close(handle) - int handle; +OF_close(int handle) { struct { cell_t name; @@ -249,10 +232,7 @@ OF_close(handle) } int -OF_write(handle, addr, len) - int handle; - void *addr; - int len; +OF_write(int handle, void *addr, int len) { struct { cell_t name; @@ -276,10 +256,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) { struct { cell_t name; @@ -304,9 +281,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) { struct { cell_t name; @@ -331,9 +306,7 @@ OF_seek(handle, pos) } void -OF_release(virt, size) - void *virt; - u_int size; +OF_release(void *virt, u_int size) { struct { cell_t name; @@ -352,7 +325,7 @@ OF_release(virt, size) } int -OF_milliseconds() +OF_milliseconds(void) { struct { cell_t name; @@ -369,12 +342,7 @@ OF_milliseconds() } 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) { extern int64_t romp; #ifdef __notyet @@ -418,7 +386,7 @@ static u_int mmuh = -1; static u_int memh = -1; void -setup() +setup(void) { u_int chosen; @@ -441,9 +409,7 @@ setup() * Only works while the prom is actively mapping us. */ static vaddr_t -OF_claim_virt(vaddr, len) -vaddr_t vaddr; -int len; +OF_claim_virt(vaddr_t vaddr, int len) { struct { cell_t name; @@ -483,9 +449,7 @@ int len; * Only works while the prom is actively mapping us. */ static vaddr_t -OF_alloc_virt(len, align) -int len; -int align; +OF_alloc_virt(int len, int align) { int retaddr=-1; struct { @@ -525,9 +489,7 @@ int align; * Only works while the prom is actively mapping us. */ static int -OF_free_virt(vaddr, len) -vaddr_t vaddr; -int len; +OF_free_virt(vaddr_t vaddr, int len) { struct { cell_t name; @@ -562,11 +524,7 @@ int len; * Only works while the prom is actively mapping us. */ static vaddr_t -OF_map_phys(paddr, size, vaddr, mode) -paddr_t paddr; -off_t size; -vaddr_t vaddr; -int mode; +OF_map_phys(paddr_t paddr, off_t size, vaddr_t vaddr, int mode) { struct { cell_t name; @@ -614,9 +572,7 @@ int mode; * Only works while the prom is actively mapping us. */ static paddr_t -OF_alloc_phys(len, align) -int len; -int align; +OF_alloc_phys(int len, int align) { struct { cell_t name; @@ -656,9 +612,7 @@ int align; * Only works while the prom is actively mapping us. */ static int -OF_free_phys(phys, len) -paddr_t phys; -int len; +OF_free_phys(paddr_t phys, int len) { struct { cell_t name; @@ -694,10 +648,7 @@ int len; */ void * -OF_claim(virt, size, align) - void *virt; - u_int size; - u_int align; +OF_claim(void *virt, u_int size, u_int align) { #define SUNVMOF #ifndef SUNVMOF @@ -765,8 +716,7 @@ OF_claim(virt, size, align) void -putchar(c) - int c; +putchar(int c) { char ch = c; @@ -776,7 +726,7 @@ putchar(c) } int -getchar() +getchar(void) { unsigned char ch = '\0'; int l; diff --git a/sys/arch/sparc64/stand/ofwboot/alloc.c b/sys/arch/sparc64/stand/ofwboot/alloc.c index 84852829d83..be69b061944 100644 --- a/sys/arch/sparc64/stand/ofwboot/alloc.c +++ b/sys/arch/sparc64/stand/ofwboot/alloc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: alloc.c,v 1.4 2007/05/28 22:17:21 pyr Exp $ */ +/* $OpenBSD: alloc.c,v 1.5 2009/08/17 14:23:09 jsing Exp $ */ /* $NetBSD: alloc.c,v 1.1 2000/08/20 14:58:37 mrg Exp $ */ /* @@ -92,8 +92,7 @@ LIST_HEAD(, ml) allocatedlist = LIST_HEAD_INITIALIZER(allocatedlist); #define OVERHEAD ALIGN(sizeof (struct ml)) /* shorthand */ void * -alloc(size) - unsigned size; +alloc(unsigned size) { struct ml *f, *bestf; unsigned bestsize = 0xffffffff; /* greater than any real size */ @@ -172,9 +171,7 @@ alloc(size) } void -free(ptr, size) - void *ptr; - unsigned size; /* only for consistenct check */ +free(void *ptr, unsigned size) { register struct ml *a = (struct ml *)((char *)ptr - OVERHEAD); @@ -193,7 +190,7 @@ free(ptr, size) } void -freeall() +freeall(void) { #ifdef __notyet__ /* Firmware bug ?! */ struct ml *m; diff --git a/sys/arch/sparc64/stand/ofwboot/boot.c b/sys/arch/sparc64/stand/ofwboot/boot.c index 7a4a61dea66..3e96a9bcdef 100644 --- a/sys/arch/sparc64/stand/ofwboot/boot.c +++ b/sys/arch/sparc64/stand/ofwboot/boot.c @@ -1,4 +1,4 @@ -/* $OpenBSD: boot.c,v 1.14 2007/05/29 00:03:13 deraadt Exp $ */ +/* $OpenBSD: boot.c,v 1.15 2009/08/17 14:23:09 jsing Exp $ */ /* $NetBSD: boot.c,v 1.3 2001/05/31 08:55:19 mrg Exp $ */ /* * Copyright (c) 1997, 1999 Eduardo E. Horvath. All rights reserved. @@ -82,8 +82,7 @@ int elf64_exec(int, Elf64_Ehdr *, u_int64_t *, void **, void **); #if 0 static void -prom2boot(dev) - char *dev; +prom2boot(char *dev) { char *cp, *lp = 0; int handle; @@ -107,9 +106,7 @@ prom2boot(dev) */ static int -parseargs(str, howtop) - char *str; - int *howtop; +parseargs(char *str, int *howtop) { char *cp; int i; @@ -153,11 +150,7 @@ parseargs(str, howtop) static void -chain(pentry, args, ssym, esym) - u_int64_t pentry; - char *args; - void *ssym; - void *esym; +chain(u_int64_t pentry, char *args, void *ssym, void *esym) { extern char end[]; void (*entry)(); @@ -210,9 +203,7 @@ chain(pentry, args, ssym, esym) } int -loadfile(fd, args) - int fd; - char *args; +loadfile(int fd, char *args) { union { #ifdef SPARC_BOOT_ELF diff --git a/sys/arch/sparc64/stand/ofwboot/net.c b/sys/arch/sparc64/stand/ofwboot/net.c index ff4beed14db..e23f6954717 100644 --- a/sys/arch/sparc64/stand/ofwboot/net.c +++ b/sys/arch/sparc64/stand/ofwboot/net.c @@ -1,4 +1,4 @@ -/* $OpenBSD: net.c,v 1.3 2002/03/14 01:26:46 millert Exp $ */ +/* $OpenBSD: net.c,v 1.4 2009/08/17 14:23:09 jsing Exp $ */ /* $NetBSD: net.c,v 1.1 2000/08/20 14:58:38 mrg Exp $ */ /* @@ -76,8 +76,7 @@ static int open_count; * This opens the low-level device and sets f->f_devdata. */ int -net_open(op) - struct of_dev *op; +net_open(struct of_dev *op) { int error = 0; @@ -103,8 +102,7 @@ bad: } int -net_close(op) - struct of_dev *op; +net_close(struct of_dev *op) { /* * On last close, do netif close, etc. @@ -117,7 +115,7 @@ net_close(op) } int -net_mountroot_bootparams() +net_mountroot_bootparams(void) { /* Get our IP address. (rarp.c) */ if (rarp_getipaddress(netdev_sock) == -1) @@ -140,7 +138,7 @@ net_mountroot_bootparams() } int -net_mountroot_bootp() +net_mountroot_bootp(void) { bootp(netdev_sock); @@ -162,7 +160,7 @@ net_mountroot_bootp() } int -net_mountroot() +net_mountroot(void) { int error; diff --git a/sys/arch/sparc64/stand/ofwboot/netif_of.c b/sys/arch/sparc64/stand/ofwboot/netif_of.c index c98ad0f4293..513a9d34aed 100644 --- a/sys/arch/sparc64/stand/ofwboot/netif_of.c +++ b/sys/arch/sparc64/stand/ofwboot/netif_of.c @@ -1,4 +1,4 @@ -/* $OpenBSD: netif_of.c,v 1.4 2001/08/22 10:44:02 art Exp $ */ +/* $OpenBSD: netif_of.c,v 1.5 2009/08/17 14:23:09 jsing Exp $ */ /* $NetBSD: netif_of.c,v 1.1 2000/08/20 14:58:39 mrg Exp $ */ /* @@ -61,8 +61,7 @@ static struct netif netif_of; struct iodesc sockets[SOPEN_MAX]; struct iodesc * -socktodesc(sock) - int sock; +socktodesc(int sock) { if (sock != 0) return NULL; @@ -70,8 +69,7 @@ socktodesc(sock) } int -netif_open(machdep_hint) - void *machdep_hint; +netif_open(void *machdep_hint) { struct of_dev *op = machdep_hint; struct iodesc *io; @@ -106,8 +104,7 @@ netif_open(machdep_hint) } int -netif_close(fd) - int fd; +netif_close(int fd) { struct iodesc *io; struct netif *ni; @@ -140,10 +137,7 @@ netif_close(fd) * Return the length sent (or -1 on error). */ ssize_t -netif_put(desc, pkt, len) - struct iodesc *desc; - void *pkt; - size_t len; +netif_put(struct iodesc *desc, void *pkt, size_t len) { struct of_dev *op; ssize_t rv; @@ -186,11 +180,7 @@ netif_put(desc, pkt, len) * Return the total length received (or -1 on error). */ ssize_t -netif_get(desc, pkt, maxlen, timo) - struct iodesc *desc; - void *pkt; - size_t maxlen; - time_t timo; +netif_get(struct iodesc *desc, void *pkt, size_t maxlen, time_t timo) { struct of_dev *op; int tick0, tmo_ms; @@ -235,7 +225,7 @@ netif_get(desc, pkt, maxlen, timo) * Shouldn't really be here, but is used solely for networking, so... */ time_t -getsecs() +getsecs(void) { return OF_milliseconds() / 1000; } diff --git a/sys/arch/sparc64/stand/ofwboot/ofdev.c b/sys/arch/sparc64/stand/ofwboot/ofdev.c index c5d10ad8de8..e3ab41451a5 100644 --- a/sys/arch/sparc64/stand/ofwboot/ofdev.c +++ b/sys/arch/sparc64/stand/ofwboot/ofdev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ofdev.c,v 1.10 2009/05/21 23:45:48 krw Exp $ */ +/* $OpenBSD: ofdev.c,v 1.11 2009/08/17 14:23:09 jsing Exp $ */ /* $NetBSD: ofdev.c,v 1.1 2000/08/20 14:58:41 mrg Exp $ */ /* @@ -60,9 +60,7 @@ extern char bootdev[]; */ static char * -filename(str, ppart) - char *str; - char *ppart; +filename(char *str, char *ppart) { char *cp, *lp; char savec; @@ -116,13 +114,8 @@ filename(str, ppart) } static int -strategy(devdata, rw, blk, size, buf, rsize) - void *devdata; - int rw; - daddr_t blk; - size_t size; - void *buf; - size_t *rsize; +strategy(void *devdata, int rw, daddr_t blk, size_t size, void *buf, + size_t *rsize) { struct of_dev *dev = devdata; u_quad_t pos; @@ -162,8 +155,7 @@ strategy(devdata, rw, blk, size, buf, rsize) } static int -devclose(of) - struct open_file *of; +devclose(struct open_file *of) { struct of_dev *op = of->f_devdata; @@ -211,8 +203,7 @@ static struct of_dev ofdev = { char opened_name[256]; static u_long -get_long(p) - const void *p; +get_long(const void *p) { const unsigned char *cp = p; @@ -245,9 +236,7 @@ sun_fstypes[8] = { * The BSD label is cleared out before this is called. */ static char * -disklabel_sun_to_bsd(cp, lp) - char *cp; - struct disklabel *lp; +disklabel_sun_to_bsd(char *cp, struct disklabel *lp) { struct sun_disklabel *sl; struct partition *npp; @@ -326,12 +315,8 @@ disklabel_sun_to_bsd(cp, lp) * Find a valid disklabel. */ static char * -search_label(devp, off, buf, lp, off0) - struct of_dev *devp; - u_long off; - char *buf; - struct disklabel *lp; - u_long off0; +search_label(struct of_dev *devp, u_long off, char *buf, struct disklabel *lp, + u_long off0) { size_t read; struct mbr_partition *p; @@ -377,10 +362,7 @@ search_label(devp, off, buf, lp, off0) } int -devopen(of, name, file) - struct open_file *of; - const char *name; - char **file; +devopen(struct open_file *of, const char *name, char **file) { char *cp; char partition; |