diff options
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/mvme68k/stand/sboot/Makefile | 4 | ||||
-rw-r--r-- | sys/arch/mvme68k/stand/sboot/clock.c | 11 | ||||
-rw-r--r-- | sys/arch/mvme68k/stand/sboot/etherfun.c | 13 | ||||
-rw-r--r-- | sys/arch/mvme68k/stand/sboot/if_le.c | 44 | ||||
-rw-r--r-- | sys/arch/mvme68k/stand/sboot/sboot.c | 55 | ||||
-rw-r--r-- | sys/arch/mvme68k/stand/sboot/srec.c | 39 |
6 files changed, 69 insertions, 97 deletions
diff --git a/sys/arch/mvme68k/stand/sboot/Makefile b/sys/arch/mvme68k/stand/sboot/Makefile index 9a1c7532bf2..674b04540cd 100644 --- a/sys/arch/mvme68k/stand/sboot/Makefile +++ b/sys/arch/mvme68k/stand/sboot/Makefile @@ -1,8 +1,8 @@ -# $OpenBSD: Makefile,v 1.7 1997/10/20 00:33:49 deraadt Exp $ +# $OpenBSD: Makefile,v 1.8 2003/08/19 10:22:30 deraadt Exp $ S= ${.CURDIR}/../../../.. INCL?= -I${.CURDIR} -I${.CURDIR}/../libsa -I${S}/lib/libsa -I${S} -COPTS?= ${DEFS} ${INCL} +COPTS+= ${DEFS} ${INCL} .include "${S}/arch/mvme68k/stand/libbug/Makefile.inc" .include "${S}/arch/mvme68k/stand/libsa/Makefile.inc" diff --git a/sys/arch/mvme68k/stand/sboot/clock.c b/sys/arch/mvme68k/stand/sboot/clock.c index 9e9b71602d3..779c80843a1 100644 --- a/sys/arch/mvme68k/stand/sboot/clock.c +++ b/sys/arch/mvme68k/stand/sboot/clock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: clock.c,v 1.6 2003/06/02 23:27:51 millert Exp $ */ +/* $OpenBSD: clock.c,v 1.7 2003/08/19 10:22:30 deraadt Exp $ */ /* * Copyright (c) 1992, 1993 @@ -70,9 +70,8 @@ static struct clockreg *clockreg = (struct clockreg *) CLOCK_ADDR; const short dayyr[12] = {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; @@ -101,8 +100,8 @@ chiptotime(sec, min, hour, day, mon, year) /* * Set up the system's time, given a `reasonable' time value. */ -u_long -ttime() +u_long +ttime(void) { register struct clockreg *cl = clockreg; int sec, min, hour, day, mon, year; diff --git a/sys/arch/mvme68k/stand/sboot/etherfun.c b/sys/arch/mvme68k/stand/sboot/etherfun.c index 968748678f9..276ca1768e6 100644 --- a/sys/arch/mvme68k/stand/sboot/etherfun.c +++ b/sys/arch/mvme68k/stand/sboot/etherfun.c @@ -1,4 +1,4 @@ -/* $OpenBSD: etherfun.c,v 1.5 2001/09/20 17:02:30 mpech Exp $ */ +/* $OpenBSD: etherfun.c,v 1.6 2003/08/19 10:22:30 deraadt Exp $ */ /* * @@ -40,7 +40,7 @@ /* Construct and send a rev arp packet */ void -do_rev_arp() +do_rev_arp(void) { int i; @@ -65,7 +65,7 @@ do_rev_arp() /* Receive and disassemble the rev_arp reply */ int -get_rev_arp() +get_rev_arp(void) { le_get(buf, sizeof(buf), 6); if (eh->ether_type == ETYPE_RARP && rarp->ar_op == OPCODE_REPLY) { @@ -79,7 +79,7 @@ get_rev_arp() /* Try to get a reply to a rev arp request */ int -rev_arp() +rev_arp(void) { int tries = 0; while (tries < 5) { @@ -97,8 +97,7 @@ rev_arp() * acknowledgement */ void -do_send_tftp(mesgtype) - int mesgtype; +do_send_tftp(int mesgtype) { u_long res, iptmp, lcv; char *tot; @@ -154,7 +153,7 @@ do_send_tftp(mesgtype) /* Attempt to tftp a file and read it into memory */ int -do_get_file() +do_get_file(void) { int fail = 0, oldlen; char *loadat = (char *) LOAD_ADDR; diff --git a/sys/arch/mvme68k/stand/sboot/if_le.c b/sys/arch/mvme68k/stand/sboot/if_le.c index 925cdfcd716..690cff92715 100644 --- a/sys/arch/mvme68k/stand/sboot/if_le.c +++ b/sys/arch/mvme68k/stand/sboot/if_le.c @@ -1,8 +1,8 @@ -/* $OpenBSD: if_le.c,v 1.6 2003/06/04 16:36:14 deraadt Exp $ */ +/* $OpenBSD: if_le.c,v 1.7 2003/08/19 10:22:30 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: @@ -66,10 +66,8 @@ struct { int next_tmd; } le_softc; -void -le_error(str, ler1) - char *str; - struct lereg1 *ler1; +static void +le_error(char *str, struct lereg1 *ler1) { /* ler1->ler1_rap = LE_CSRO done in caller */ if (ler1->ler1_rdp & LE_C0_BABL) { @@ -88,9 +86,8 @@ le_error(str, ler1) } } -void -le_reset(myea) - u_char *myea; +static void +le_reset(u_char *myea) { struct lereg1 *ler1 = le_softc.sc_r1; struct lereg2 *ler2 = le_softc.sc_r2; @@ -110,7 +107,6 @@ le_reset(myea) ler2->ler2_padr[4] = myea[5]; ler2->ler2_padr[5] = myea[4]; - ler2->ler2_ladrf0 = 0; ler2->ler2_ladrf1 = 0; @@ -165,10 +161,8 @@ le_reset(myea) ler1->ler1_rdp = LE_C0_STRT; } -int -le_poll(pkt, len) - void *pkt; - int len; +static int +le_poll(void *pkt, int len) { struct lereg1 *ler1 = le_softc.sc_r1; struct lereg2 *ler2 = le_softc.sc_r2; @@ -218,10 +212,8 @@ cleanup: return length; } -int -le_put(pkt, len) - u_char *pkt; - size_t len; +int +le_put(u_char *pkt, size_t len) { struct lereg1 *ler1 = le_softc.sc_r1; struct lereg2 *ler2 = le_softc.sc_r2; @@ -278,11 +270,8 @@ le_put(pkt, len) return len; } -int -le_get(pkt, len, timeout) - u_char *pkt; - size_t len; - u_long timeout; +int +le_get(u_char *pkt, size_t len, u_long timeout) { int cc; int now, then; @@ -313,13 +302,14 @@ le_get(pkt, len, timeout) return cc; } -void -le_init() +void +le_init(void) { caddr_t addr; int *ea = (int *) LANCE_ADDR; u_long *eram = (u_long *) ERAM_ADDR; u_long e = *ea; + if ((e & 0x2fffff00) == 0x2fffff00) { printf("ERROR: ethernet address not set! Use LSAD.\n"); callrom(); @@ -341,8 +331,8 @@ le_init() le_reset(myea); } -void -le_end() +void +le_end(void) { struct lereg1 *ler1 = le_softc.sc_r1; diff --git a/sys/arch/mvme68k/stand/sboot/sboot.c b/sys/arch/mvme68k/stand/sboot/sboot.c index eb844086b9f..81608674c16 100644 --- a/sys/arch/mvme68k/stand/sboot/sboot.c +++ b/sys/arch/mvme68k/stand/sboot/sboot.c @@ -1,8 +1,8 @@ -/* $OpenBSD: sboot.c,v 1.8 2003/06/04 16:36:14 deraadt Exp $ */ +/* $OpenBSD: sboot.c,v 1.9 2003/08/19 10:22:30 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: @@ -58,8 +58,8 @@ #include <sys/types.h> #include "sboot.h" -void -main() +int +main(int argc, char *argv[]) { char buf[128], *ebuf; @@ -76,8 +76,8 @@ main() /* * exit to rom */ -void -callrom() +void +callrom(void) { asm("trap #15; .word 0x0063"); } @@ -85,9 +85,8 @@ callrom() /* * do_cmd: do a command */ -void -do_cmd(buf, ebuf) - char *buf, *ebuf; +void +do_cmd(char *buf, char *ebuf) { switch (*buf) { case '\0': @@ -156,24 +155,26 @@ do_cmd(buf, ebuf) } } -/* - * ngets: get string from console +/* + * ngets: get string from console */ - -char *ngets ( char * str, int size ) +char * +ngets(char * str, int size) { - int i = 0; - while ( (i < size - 1) && (str[i] = getchar()) != '\r') { - if ( str[i] == '\b' || str[i] == 0x7F ) { - if ( i == 0) continue; - i--; - printf("\b \b"); - continue; - } - putchar(str[i]); - i++; - } - printf("\n"); - str[i] = '\0'; - return(&str[i]); + int i = 0; + + while ((i < size - 1) && (str[i] = getchar()) != '\r') { + if (str[i] == '\b' || str[i] == 0x7F) { + if (i == 0) + continue; + i--; + printf("\b \b"); + continue; + } + putchar(str[i]); + i++; + } + printf("\n"); + str[i] = '\0'; + return(&str[i]); } diff --git a/sys/arch/mvme68k/stand/sboot/srec.c b/sys/arch/mvme68k/stand/sboot/srec.c index 2919febe660..ec088ecb16b 100644 --- a/sys/arch/mvme68k/stand/sboot/srec.c +++ b/sys/arch/mvme68k/stand/sboot/srec.c @@ -1,8 +1,8 @@ -/* $OpenBSD: srec.c,v 1.4 2001/04/30 00:06:26 miod Exp $ */ +/* $OpenBSD: srec.c,v 1.5 2003/08/19 10:22:30 deraadt Exp $ */ /* * Public domain, believed to be by Mike Price. - * + * * convert binary file to Srecord format */ #include <stdio.h> @@ -17,15 +17,10 @@ int checksum(); int mask; int size; -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { - char buf[32]; - int cc; - int base; - int addr; - char *name; + char buf[32], *name; + int cc, base, addr; if (argc != 4) { fprintf(stderr, "usage: %s {size} {hex_addr} {name}\n", argv[0]); @@ -83,12 +78,10 @@ main(argc, argv) } int -get32(buf) - char buf[]; +get32(char buf[]) { char *cp = buf; - int i; - int c; + int i, c; for (i = 0; i < 32; ++i) { if ((c = getchar()) != EOF) @@ -100,11 +93,7 @@ get32(buf) } void -put32(len, addr, buf, size, mask) - int len; - int addr; - char buf[]; - int size, mask; +put32(int len, int addr, char buf[], int size, int mask) { char *cp = buf; int i; @@ -121,26 +110,20 @@ put32(len, addr, buf, size, mask) } void -sput(s) - char *s; +sput(char *s) { while (*s != '\0') put(*s++); } void -put(c) - int c; +put(int c) { printf("%02X", c & 0xff); } int -checksum(addr, buf, len, size) - int addr; - char buf[]; - int len; - int size; +checksum(int addr, char buf[], int len, int size) { char *cp = buf; int sum = 0xff - 1 - size - (len & 0xff); |