summaryrefslogtreecommitdiff
path: root/sys/arch/mvme68k/stand
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2003-08-20 00:26:01 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2003-08-20 00:26:01 +0000
commite7db268bb31fed767ab31e00816ace537ea48ff6 (patch)
tree970197661fe121615263cadbe13563cbf170c678 /sys/arch/mvme68k/stand
parent4055d06426455f14922e0519ecf6eb7c4851abe2 (diff)
ansi and protos for the rest
Diffstat (limited to 'sys/arch/mvme68k/stand')
-rw-r--r--sys/arch/mvme68k/stand/libbug/libbug.h4
-rw-r--r--sys/arch/mvme68k/stand/libsa/bugdev.c36
-rw-r--r--sys/arch/mvme68k/stand/libsa/clock.c15
-rw-r--r--sys/arch/mvme68k/stand/libsa/exec_mvme.c20
-rw-r--r--sys/arch/mvme68k/stand/libsa/libsa.h4
-rw-r--r--sys/arch/mvme68k/stand/netboot/boot.c4
-rw-r--r--sys/arch/mvme68k/stand/netboot/conf.c8
-rw-r--r--sys/arch/mvme68k/stand/netboot/dev_net.c105
-rw-r--r--sys/arch/mvme68k/stand/netboot/dev_net.h9
-rw-r--r--sys/arch/mvme68k/stand/netboot/if_ie.c52
-rw-r--r--sys/arch/mvme68k/stand/netboot/if_le.c4
11 files changed, 111 insertions, 150 deletions
diff --git a/sys/arch/mvme68k/stand/libbug/libbug.h b/sys/arch/mvme68k/stand/libbug/libbug.h
index 59ee95528c3..cf9ea220121 100644
--- a/sys/arch/mvme68k/stand/libbug/libbug.h
+++ b/sys/arch/mvme68k/stand/libbug/libbug.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: libbug.h,v 1.3 2002/03/14 03:15:56 millert Exp $ */
+/* $OpenBSD: libbug.h,v 1.4 2003/08/20 00:25:59 deraadt Exp $ */
/*
* prototypes and such. note that get/put char are in stand.h
@@ -20,4 +20,4 @@ void mvmeprom_rtc_rd(struct mvmeprom_time *);
extern struct mvmeprom_args bugargs;
-void bugexec(void (*)());
+void bugexec(void (*)(void));
diff --git a/sys/arch/mvme68k/stand/libsa/bugdev.c b/sys/arch/mvme68k/stand/libsa/bugdev.c
index 0c0b9ec13db..581a39836f5 100644
--- a/sys/arch/mvme68k/stand/libsa/bugdev.c
+++ b/sys/arch/mvme68k/stand/libsa/bugdev.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bugdev.c,v 1.2 2002/03/14 01:26:38 millert Exp $ */
+/* $OpenBSD: bugdev.c,v 1.3 2003/08/20 00:26:00 deraadt Exp $ */
/*
* Copyright (c) 1993 Paul Kranenburg
@@ -50,10 +50,7 @@ struct bugsc_softc {
} bugsc_softc[1];
int
-devopen(f, fname, file)
- struct open_file *f;
- const char *fname;
- char **file;
+devopen(struct open_file *f, const char *fname, char **file)
{
register struct bugsc_softc *pp = &bugsc_softc[0];
int error, i, dn = 0, pn = 0;
@@ -98,14 +95,10 @@ devopen(f, fname, file)
/* silly block scale factor */
#define BUG_BLOCK_SIZE 256
#define BUG_SCALE (512/BUG_BLOCK_SIZE)
+
int
-bugscstrategy(devdata, func, dblk, size, buf, rsize)
- void *devdata;
- int func;
- daddr_t dblk;
- size_t size;
- void *buf;
- size_t *rsize;
+bugscstrategy(void *devdata, int func, daddr_t dblk, size_t size, void *buf,
+ size_t *rsize)
{
struct mvmeprom_dskio dio;
register struct bugsc_softc *pp = (struct bugsc_softc *)devdata;
@@ -138,8 +131,7 @@ printf("rsize %d status %x\n", *rsize, dio.status);
}
int
-bugscopen(f)
- struct open_file *f;
+bugscopen(struct open_file *f)
{
#ifdef DEBUG
printf("bugscopen:\n");
@@ -156,25 +148,19 @@ bugscopen(f)
}
int
-bugscclose(f)
- struct open_file *f;
+bugscclose(struct open_file *f)
{
return (EIO);
}
int
-bugscioctl(f, cmd, data)
- struct open_file *f;
- u_long cmd;
- void *data;
+bugscioctl(struct open_file *f, u_long cmd, void *data)
{
return (EIO);
}
void
-cputobsdlabel(lp, clp)
- struct disklabel *lp;
- struct cpu_disklabel *clp;
+cputobsdlabel(struct disklabel *lp, struct cpu_disklabel *clp)
{
int i;
@@ -233,6 +219,6 @@ cputobsdlabel(lp, clp)
lp->d_bbsize = clp->bbsize;
lp->d_sbsize = clp->sbsize;
bcopy(clp->vid_4, &(lp->d_partitions[0]),sizeof (struct partition) * 4);
- bcopy(clp->cfg_4, &(lp->d_partitions[4]), sizeof (struct partition)
- * ((MAXPARTITIONS < 16) ? (MAXPARTITIONS - 4) : 12));
+ bcopy(clp->cfg_4, &(lp->d_partitions[4]), sizeof (struct partition) *
+ ((MAXPARTITIONS < 16) ? (MAXPARTITIONS - 4) : 12));
}
diff --git a/sys/arch/mvme68k/stand/libsa/clock.c b/sys/arch/mvme68k/stand/libsa/clock.c
index 4f56fb85372..b0d66b22da9 100644
--- a/sys/arch/mvme68k/stand/libsa/clock.c
+++ b/sys/arch/mvme68k/stand/libsa/clock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: clock.c,v 1.3 1996/05/16 02:30:38 chuck Exp $ */
+/* $OpenBSD: clock.c,v 1.4 2003/08/20 00:26:00 deraadt Exp $ */
#include <sys/types.h>
#include <machine/prom.h>
@@ -23,11 +23,10 @@
* Will Unix still be here then??
*/
const short dayyr[12] =
-{0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334};
+ {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334};
-static u_long
-chiptotime(sec, min, hour, day, mon, year)
- register int sec, min, hour, day, mon, year;
+static u_long
+chiptotime(int sec, int min, int hour, int day, int mon, int year)
{
register int days, yr;
@@ -54,11 +53,11 @@ chiptotime(sec, min, hour, day, mon, year)
}
time_t
-getsecs()
+getsecs(void)
{
struct mvmeprom_time m;
mvmeprom_rtc_rd(&m);
- return (chiptotime(m.sec_BCD, m.min_BCD, m.hour_BCD, m.day_BCD,
- m.month_BCD, m.year_BCD));
+ return (chiptotime(m.sec_BCD, m.min_BCD, m.hour_BCD, m.day_BCD,
+ m.month_BCD, m.year_BCD));
}
diff --git a/sys/arch/mvme68k/stand/libsa/exec_mvme.c b/sys/arch/mvme68k/stand/libsa/exec_mvme.c
index 1718092ecaa..ae6704f0630 100644
--- a/sys/arch/mvme68k/stand/libsa/exec_mvme.c
+++ b/sys/arch/mvme68k/stand/libsa/exec_mvme.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: exec_mvme.c,v 1.5 2003/06/02 23:27:51 millert Exp $ */
+/* $OpenBSD: exec_mvme.c,v 1.6 2003/08/20 00:26:00 deraadt Exp $ */
/* $NetBSD: exec_sun.c,v 1.5 1996/01/29 23:41:06 gwr Exp $ */
/*-
@@ -50,7 +50,7 @@ exec_mvme(file, flag)
register int io;
struct exec x;
int cc, magic;
- void (*entry)();
+ void (*entry)(int, u_int, int, int, int, void *);
register char *cp;
register int *ip;
@@ -73,11 +73,11 @@ exec_mvme(file, flag)
}
/*
- * note: on the mvme ports, the kernel is linked in such a way that
- * its entry point is the first item in .text, and thus a_entry can
+ * note: on the mvme ports, the kernel is linked in such a way that
+ * its entry point is the first item in .text, and thus a_entry can
* be used to determine both the load address and the entry point.
* (also note that we make use of the fact that the kernel will live
- * in a VA == PA range of memory ... otherwise we would take
+ * in a VA == PA range of memory ... otherwise we would take
* loadaddr as a parameter and let the kernel relocate itself!)
*
* note that ZMAGIC files included the a.out header in the text area
@@ -89,7 +89,7 @@ exec_mvme(file, flag)
magic = N_GETMAGIC(x);
if (magic == ZMAGIC)
cp += sizeof(x);
- entry = (void (*)())cp;
+ entry = (void (*)(int, u_int, int, int, int, void *))cp;
/*
* Leave a copy of the exec header before the text.
@@ -103,7 +103,7 @@ exec_mvme(file, flag)
*/
printf("%d", x.a_text);
cc = x.a_text;
- if (magic == ZMAGIC)
+ if (magic == ZMAGIC)
cc = cc - sizeof(x); /* a.out header part of text in zmagic */
if (read(io, cp, cc) != cc)
goto shread;
@@ -157,7 +157,7 @@ exec_mvme(file, flag)
if (read(io, cp, cc) != cc)
goto shread;
cp += x.a_syms;
- ip = (int *)cp; /* points to strtab length */
+ ip = (int *)cp; /* points to strtab length */
cp += sizeof(int);
/* String table. Length word includes itself. */
@@ -174,8 +174,8 @@ exec_mvme(file, flag)
close(io);
printf("Start @ 0x%x ...\n", (int)entry);
- (*entry)(flag, bugargs.ctrl_addr,
- bugargs.ctrl_lun, bugargs.dev_lun, 0, cp);
+ (*entry)(flag, bugargs.ctrl_addr, bugargs.ctrl_lun,
+ bugargs.dev_lun, 0, cp);
printf("exec: kernel returned!\n");
return;
diff --git a/sys/arch/mvme68k/stand/libsa/libsa.h b/sys/arch/mvme68k/stand/libsa/libsa.h
index da15e3a0ac5..3d355a73c1d 100644
--- a/sys/arch/mvme68k/stand/libsa/libsa.h
+++ b/sys/arch/mvme68k/stand/libsa/libsa.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: libsa.h,v 1.5 2002/03/14 01:26:38 millert Exp $ */
+/* $OpenBSD: libsa.h,v 1.6 2003/08/20 00:26:00 deraadt Exp $ */
/*
* libsa prototypes
@@ -7,7 +7,7 @@
#include "libbug.h"
/* bugdev.c */
-int bugscopen(struct open_file *, ...);
+int bugscopen(struct open_file *);
int bugscclose(struct open_file *);
int bugscioctl(struct open_file *, u_long, void *);
int bugscstrategy(void *, int, daddr_t, size_t, void *, size_t *);
diff --git a/sys/arch/mvme68k/stand/netboot/boot.c b/sys/arch/mvme68k/stand/netboot/boot.c
index 64606904a83..db882f8ddb8 100644
--- a/sys/arch/mvme68k/stand/netboot/boot.c
+++ b/sys/arch/mvme68k/stand/netboot/boot.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: boot.c,v 1.9 2003/06/04 04:11:37 deraadt Exp $ */
+/* $OpenBSD: boot.c,v 1.10 2003/08/20 00:26:00 deraadt Exp $ */
/*-
* Copyright (c) 1995 Theo de Raadt
@@ -70,7 +70,7 @@
extern char *version;
char line[80];
-main()
+main(int argc, char *argv[])
{
char *cp, *file;
int ask = 0, howto, ret;
diff --git a/sys/arch/mvme68k/stand/netboot/conf.c b/sys/arch/mvme68k/stand/netboot/conf.c
index 10c7f647710..8c05fb02141 100644
--- a/sys/arch/mvme68k/stand/netboot/conf.c
+++ b/sys/arch/mvme68k/stand/netboot/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.4 1996/04/28 10:49:18 deraadt Exp $ */
+/* $OpenBSD: conf.c,v 1.5 2003/08/20 00:26:00 deraadt Exp $ */
#include <sys/types.h>
#include <netinet/in.h>
@@ -6,7 +6,7 @@
#include <stand.h>
#include <nfs.h>
-#include <dev_net.h>
+#include "dev_net.h"
struct fs_ops file_system[] = {
{ nfs_open, nfs_close, nfs_read, nfs_write, nfs_seek, nfs_stat },
@@ -14,7 +14,9 @@ struct fs_ops file_system[] = {
int nfsys = sizeof(file_system) / sizeof(file_system[0]);
struct devsw devsw[] = {
- { "net", net_strategy, net_open, net_close, net_ioctl },
+ { "net", net_strategy, (int (*)(struct open_file *, ...))net_open,
+ net_close, net_ioctl
+ },
};
int ndevs = sizeof(devsw) / sizeof(devsw[0]);
diff --git a/sys/arch/mvme68k/stand/netboot/dev_net.c b/sys/arch/mvme68k/stand/netboot/dev_net.c
index 38192ff7626..77ce339a9d0 100644
--- a/sys/arch/mvme68k/stand/netboot/dev_net.c
+++ b/sys/arch/mvme68k/stand/netboot/dev_net.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dev_net.c,v 1.7 1999/01/11 05:11:41 millert Exp $ */
+/* $OpenBSD: dev_net.c,v 1.8 2003/08/20 00:26:00 deraadt Exp $ */
/*
* Copyright (c) 1995 Gordon W. Ross
@@ -63,6 +63,7 @@
#include "netif.h"
#include "config.h"
#include "bootparam.h"
+#include "dev_net.h"
extern int nfs_root_node[]; /* XXX - get from nfs_mount() */
@@ -72,57 +73,8 @@ char rootpath[FNAME_SIZE];
int netdev_sock = -1;
static int open_count;
-/*
- * Called by devopen after it sets f->f_dev to our devsw entry.
- * This opens the low-level device and sets f->f_devdata.
- */
-int
-net_open(f, devname)
- struct open_file *f;
- char *devname; /* Device part of file name (or NULL). */
-{
- int error = 0;
-
- /* On first open, do netif open, mount, etc. */
- if (open_count == 0) {
- /* Find network interface. */
- if ((netdev_sock = netif_open(devname)) < 0)
- return (error=ENXIO);
- if ((error = net_mountroot(f, devname)) != 0)
- return (error);
- }
- open_count++;
- f->f_devdata = nfs_root_node;
- return (error);
-}
-
-int
-net_close(f)
- struct open_file *f;
-{
- /* On last close, do netif close, etc. */
- if (open_count > 0)
- if (--open_count == 0)
- netif_close(netdev_sock);
- f->f_devdata = NULL;
-}
-
-int
-net_ioctl()
-{
- return EIO;
-}
-
-int
-net_strategy()
-{
- return EIO;
-}
-
-int
-net_mountroot(f, devname)
- struct open_file *f;
- char *devname; /* Device part of file name (or NULL). */
+static int
+net_mountroot(struct open_file *f, char *devname)
{
int error;
@@ -182,8 +134,7 @@ net_mountroot(f, devname)
* machdep_common_ether: get ethernet address
*/
void
-machdep_common_ether(ether)
- u_char *ether;
+machdep_common_ether(u_char *ether)
{
u_char *ea;
@@ -211,3 +162,49 @@ machdep_common_ether(ether)
ether[5] = ea[5];
}
}
+
+/*
+ * Called by devopen after it sets f->f_dev to our devsw entry.
+ * This opens the low-level device and sets f->f_devdata.
+ */
+int
+net_open(struct open_file *f, char *devname)
+{
+ int error = 0;
+
+ /* On first open, do netif open, mount, etc. */
+ if (open_count == 0) {
+ /* Find network interface. */
+ if ((netdev_sock = netif_open(devname)) < 0)
+ return (error=ENXIO);
+ if ((error = net_mountroot(f, devname)) != 0)
+ return (error);
+ }
+ open_count++;
+ f->f_devdata = nfs_root_node;
+ return (error);
+}
+
+int
+net_close(struct open_file *f)
+{
+ /* On last close, do netif close, etc. */
+ if (open_count > 0)
+ if (--open_count == 0)
+ netif_close(netdev_sock);
+ f->f_devdata = NULL;
+}
+
+int
+net_ioctl(struct open_file *f, u_long cmd, void *data)
+{
+ return EIO;
+}
+
+int
+net_strategy(void *devdata, int rw, daddr_t blk, size_t size, void *buf,
+ size_t *rsize)
+{
+ return EIO;
+}
+
diff --git a/sys/arch/mvme68k/stand/netboot/dev_net.h b/sys/arch/mvme68k/stand/netboot/dev_net.h
index 0607427320c..3fac461175a 100644
--- a/sys/arch/mvme68k/stand/netboot/dev_net.h
+++ b/sys/arch/mvme68k/stand/netboot/dev_net.h
@@ -1,7 +1,8 @@
-/* $OpenBSD: dev_net.h,v 1.3 2002/03/14 01:26:38 millert Exp $ */
+/* $OpenBSD: dev_net.h,v 1.4 2003/08/20 00:26:00 deraadt Exp $ */
-int net_open(struct open_file *, ...);
+int net_open(struct open_file *, char *);
int net_close(struct open_file *);
-int net_ioctl();
-int net_strategy();
+int net_ioctl(struct open_file *, u_long, void *);
+int net_strategy(void *, int, daddr_t, size_t, void *, size_t *);
+void machdep_common_ether(u_char *);
diff --git a/sys/arch/mvme68k/stand/netboot/if_ie.c b/sys/arch/mvme68k/stand/netboot/if_ie.c
index 7ef6e22c0c1..baa7f08ef6c 100644
--- a/sys/arch/mvme68k/stand/netboot/if_ie.c
+++ b/sys/arch/mvme68k/stand/netboot/if_ie.c
@@ -1,8 +1,8 @@
-/* $OpenBSD: if_ie.c,v 1.11 2003/06/04 16:36:14 deraadt Exp $ */
+/* $OpenBSD: if_ie.c,v 1.12 2003/08/20 00:26:00 deraadt Exp $ */
/*
* Copyright (c) 1995 Theo de Raadt
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -99,9 +99,7 @@ struct {
} ie_softc;
int
-ie_match(nif, machdep_hint)
- struct netif *nif;
- void *machdep_hint;
+ie_match(struct netif *nif, void *machdep_hint)
{
char *name;
int i, val = 0;
@@ -125,9 +123,7 @@ ie_match(nif, machdep_hint)
}
int
-ie_probe(nif, machdep_hint)
- struct netif *nif;
- void *machdep_hint;
+ie_probe(struct netif *nif, void *machdep_hint)
{
/* the set unit is the current unit */
@@ -140,17 +136,13 @@ ie_probe(nif, machdep_hint)
}
void
-ie_error(nif, str, ier)
- struct netif *nif;
- char *str;
- volatile struct iereg *ier;
+ie_error(struct netif *nif, char *str, volatile struct iereg *ier)
{
panic("ie%d: unknown error", nif->nif_unit);
}
-ieack(ier, iem)
- volatile struct iereg *ier;
- struct iemem *iem;
+static void
+ieack(volatile struct iereg *ier, struct iemem *iem)
{
/* ack the `interrupt' */
iem->im_scb.ie_command = iem->im_scb.ie_status & IE_ST_WHENCE;
@@ -160,9 +152,7 @@ ieack(ier, iem)
}
void
-ie_reset(nif, myea)
- struct netif *nif;
- u_char *myea;
+ie_reset(struct netif *nif, u_char *myea)
{
volatile struct iereg *ier = ie_softc.sc_reg;
struct iemem *iem = ie_softc.sc_mem;
@@ -287,10 +277,7 @@ ie_reset(nif, myea)
}
int
-ie_poll(desc, pkt, len)
- struct iodesc *desc;
- void *pkt;
- int len;
+ie_poll(struct iodesc *desc, void *pkt, int len)
{
volatile struct iereg *ier = ie_softc.sc_reg;
struct iemem *iem = ie_softc.sc_mem;
@@ -355,10 +342,7 @@ ie_poll(desc, pkt, len)
}
int
-ie_put(desc, pkt, len)
- struct iodesc *desc;
- void *pkt;
- size_t len;
+ie_put(struct iodesc *desc, void *pkt, size_t len)
{
volatile struct iereg *ier = ie_softc.sc_reg;
struct iemem *iem = ie_softc.sc_mem;
@@ -412,11 +396,7 @@ ie_put(desc, pkt, len)
}
int
-ie_get(desc, pkt, len, timeout)
- struct iodesc *desc;
- void *pkt;
- size_t len;
- time_t timeout;
+ie_get(struct iodesc *desc, void *pkt, size_t len, time_t timeout)
{
time_t t;
int cc;
@@ -432,9 +412,7 @@ ie_get(desc, pkt, len, timeout)
* init ie device. return 0 on failure, 1 if ok.
*/
void
-ie_init(desc, machdep_hint)
- struct iodesc *desc;
- void *machdep_hint;
+ie_init(struct iodesc *desc, void *machdep_hint)
{
struct netif *nif = desc->io_netif;
@@ -452,8 +430,7 @@ ie_init(desc, machdep_hint)
}
void
-ie_stop(nif)
- struct netif *nif;
+ie_stop(struct netif *nif)
{
volatile struct iereg *ier = ie_softc.sc_reg;
struct iemem *iem = ie_softc.sc_mem;
@@ -485,8 +462,7 @@ ie_stop(nif)
}
void
-ie_end(nif)
- struct netif *nif;
+ie_end(struct netif *nif)
{
if (ie_debug)
printf("ie%d: ie_end called\n", nif->nif_unit);
diff --git a/sys/arch/mvme68k/stand/netboot/if_le.c b/sys/arch/mvme68k/stand/netboot/if_le.c
index 2d740751bf3..53944a16d31 100644
--- a/sys/arch/mvme68k/stand/netboot/if_le.c
+++ b/sys/arch/mvme68k/stand/netboot/if_le.c
@@ -1,8 +1,8 @@
-/* $OpenBSD: if_le.c,v 1.9 2003/06/04 16:36:14 deraadt Exp $ */
+/* $OpenBSD: if_le.c,v 1.10 2003/08/20 00:26:00 deraadt Exp $ */
/*
* Copyright (c) 1995 Theo de Raadt
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met: