diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-04-28 10:49:50 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-04-28 10:49:50 +0000 |
commit | 1588c7e17d5ee58acf691260c479dc30959c9123 (patch) | |
tree | 0a814cfee6ceaeaa5543df6f17452af98f4d9769 /sys/arch/mvme68k/stand/sboot | |
parent | 03b1eabf4deb45733b1212d30d83794e16c8c28c (diff) |
add OpenBSD header
Diffstat (limited to 'sys/arch/mvme68k/stand/sboot')
-rw-r--r-- | sys/arch/mvme68k/stand/sboot/Makefile | 2 | ||||
-rw-r--r-- | sys/arch/mvme68k/stand/sboot/XBUG.S | 2 | ||||
-rw-r--r-- | sys/arch/mvme68k/stand/sboot/XSRT0.S | 2 | ||||
-rw-r--r-- | sys/arch/mvme68k/stand/sboot/clock.c | 2 | ||||
-rw-r--r-- | sys/arch/mvme68k/stand/sboot/clockreg.h | 2 | ||||
-rw-r--r-- | sys/arch/mvme68k/stand/sboot/etherfun.c | 320 | ||||
-rw-r--r-- | sys/arch/mvme68k/stand/sboot/etherfun.h | 84 | ||||
-rw-r--r-- | sys/arch/mvme68k/stand/sboot/if_le.c | 2 | ||||
-rw-r--r-- | sys/arch/mvme68k/stand/sboot/if_lereg.h | 2 | ||||
-rw-r--r-- | sys/arch/mvme68k/stand/sboot/oc_cksum.S | 2 | ||||
-rw-r--r-- | sys/arch/mvme68k/stand/sboot/sboot.c | 2 | ||||
-rw-r--r-- | sys/arch/mvme68k/stand/sboot/sboot.h | 47 | ||||
-rw-r--r-- | sys/arch/mvme68k/stand/sboot/srec.c | 2 |
13 files changed, 243 insertions, 228 deletions
diff --git a/sys/arch/mvme68k/stand/sboot/Makefile b/sys/arch/mvme68k/stand/sboot/Makefile index 990d05aeb7c..3f31cf3d1d3 100644 --- a/sys/arch/mvme68k/stand/sboot/Makefile +++ b/sys/arch/mvme68k/stand/sboot/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.2 1995/11/07 08:51:06 deraadt Exp $ +# $OpenBSD: Makefile,v 1.3 1996/04/28 10:49:31 deraadt Exp $ S= ${.CURDIR}/../../../.. INCL?= -I${.CURDIR} -I${.CURDIR}/../libsa -I${S}/lib/libsa -I${S} diff --git a/sys/arch/mvme68k/stand/sboot/XBUG.S b/sys/arch/mvme68k/stand/sboot/XBUG.S index 288f1427b21..e3016b8ad0c 100644 --- a/sys/arch/mvme68k/stand/sboot/XBUG.S +++ b/sys/arch/mvme68k/stand/sboot/XBUG.S @@ -1,3 +1,5 @@ +/* $OpenBSD: XBUG.S,v 1.3 1996/04/28 10:49:32 deraadt Exp $ */ + /* * Copyright (c) 1995 Theo de Raadt * diff --git a/sys/arch/mvme68k/stand/sboot/XSRT0.S b/sys/arch/mvme68k/stand/sboot/XSRT0.S index 805528203f2..793413eb2ed 100644 --- a/sys/arch/mvme68k/stand/sboot/XSRT0.S +++ b/sys/arch/mvme68k/stand/sboot/XSRT0.S @@ -1,3 +1,5 @@ +/* $OpenBSD: XSRT0.S,v 1.3 1996/04/28 10:49:33 deraadt Exp $ */ + /* * Copyright (c) 1995 Theo de Raadt * diff --git a/sys/arch/mvme68k/stand/sboot/clock.c b/sys/arch/mvme68k/stand/sboot/clock.c index 41598b07c0e..9f2300d53b2 100644 --- a/sys/arch/mvme68k/stand/sboot/clock.c +++ b/sys/arch/mvme68k/stand/sboot/clock.c @@ -1,4 +1,4 @@ -/* $Id: clock.c,v 1.2 1995/11/07 08:51:08 deraadt Exp $ */ +/* $OpenBSD: clock.c,v 1.3 1996/04/28 10:49:34 deraadt Exp $ */ /* * Copyright (c) 1992, 1993 diff --git a/sys/arch/mvme68k/stand/sboot/clockreg.h b/sys/arch/mvme68k/stand/sboot/clockreg.h index e39c1d30d42..cfd00fb2a78 100644 --- a/sys/arch/mvme68k/stand/sboot/clockreg.h +++ b/sys/arch/mvme68k/stand/sboot/clockreg.h @@ -1,4 +1,4 @@ -/* $Id: clockreg.h,v 1.2 1995/11/07 08:51:09 deraadt Exp $ */ +/* $OpenBSD: clockreg.h,v 1.3 1996/04/28 10:49:35 deraadt Exp $ */ /* * Copyright (c) 1992, 1993 diff --git a/sys/arch/mvme68k/stand/sboot/etherfun.c b/sys/arch/mvme68k/stand/sboot/etherfun.c index 7c107b00e8a..37b920a79b8 100644 --- a/sys/arch/mvme68k/stand/sboot/etherfun.c +++ b/sys/arch/mvme68k/stand/sboot/etherfun.c @@ -1,3 +1,5 @@ +/* $OpenBSD: etherfun.c,v 1.2 1996/04/28 10:49:36 deraadt Exp $ */ + /* * * Copyright (c) 1995 Charles D. Cranor and Seth Widoff @@ -31,183 +33,185 @@ */ /* etherfun.c */ +#include <sys/cdefs.h> #include "sboot.h" #include "etherfun.h" /* Construct and send a rev arp packet */ void -do_rev_arp () +do_rev_arp() { - int i; - - for ( i = 0; i < 6; i++ ) { - eh->ether_dhost[i] = 0xff; - } - bcopy(myea, eh->ether_shost, 6); - eh->ether_type = ETYPE_RARP; - - rarp->ar_hrd = 1; /* hardware type is 1 */ - rarp->ar_pro = PTYPE_IP; - rarp->ar_hln = 6; /* length of hardware address is 6 bytes */ - rarp->ar_pln = 4; /* length of ip address is 4 byte */ - rarp->ar_op = OPCODE_RARP; - bcopy(myea, rarp->arp_sha, sizeof(myea)); - bcopy(myea, rarp->arp_tha, sizeof(myea)); - for ( i = 0; i < 4; i++ ) { - rarp->arp_spa[i] = rarp->arp_tpa[i] = 0x00; - } - - le_put(buf, 76); + int i; + + for (i = 0; i < 6; i++) + eh->ether_dhost[i] = 0xff; + + bcopy(myea, eh->ether_shost, 6); + eh->ether_type = ETYPE_RARP; + + rarp->ar_hrd = 1; /* hardware type is 1 */ + rarp->ar_pro = PTYPE_IP; + rarp->ar_hln = 6; /* length of hardware address is 6 bytes */ + rarp->ar_pln = 4; /* length of ip address is 4 byte */ + rarp->ar_op = OPCODE_RARP; + bcopy(myea, rarp->arp_sha, sizeof(myea)); + bcopy(myea, rarp->arp_tha, sizeof(myea)); + for (i = 0; i < 4; i++) + rarp->arp_spa[i] = rarp->arp_tpa[i] = 0x00; + + le_put(buf, 76); } - -/* Recieve and disassemble the rev_arp reply */ +/* Receive and disassemble the rev_arp reply */ int -get_rev_arp () +get_rev_arp() { - le_get(buf, sizeof(buf), 6); - if ( eh->ether_type == ETYPE_RARP && rarp->ar_op == OPCODE_REPLY ) { - bcopy(rarp->arp_tpa, myip, sizeof(rarp->arp_tpa)); - bcopy(rarp->arp_spa, servip, sizeof(rarp->arp_spa)); - bcopy(rarp->arp_sha, servea, sizeof(rarp->arp_sha)); - return 1; - } - return 0; + le_get(buf, sizeof(buf), 6); + if (eh->ether_type == ETYPE_RARP && rarp->ar_op == OPCODE_REPLY) { + bcopy(rarp->arp_tpa, myip, sizeof(rarp->arp_tpa)); + bcopy(rarp->arp_spa, servip, sizeof(rarp->arp_spa)); + bcopy(rarp->arp_sha, servea, sizeof(rarp->arp_sha)); + return (1); + } + return (0); } /* Try to get a reply to a rev arp request */ - -int -rev_arp () -{ - int tries = 0; - while ( tries < 5 ) { - do_rev_arp(); - if ( get_rev_arp() ) { - return 1; - } - tries++; - } - return 0; -} - -/* Send a tftp read request or acknowledgement - mesgtype 0 is a read request, 1 is an aknowledgement */ - -void -do_send_tftp ( int mesgtype ) +int +rev_arp() { - u_long res, iptmp, lcv; - char *tot; - - if ( mesgtype == 0 ) { - tot = tftp_r + (sizeof(MSG)-1); - myport = (u_short)time(); - if (myport < 1000) myport += 1000; - servport = FTP_PORT; /* to start */ - } else { - tot = (char *)tftp_a + 4; - } - - bcopy (servea, eh->ether_dhost, sizeof(servea)); - bcopy (myea, eh->ether_shost, sizeof(myea)); - eh->ether_type = ETYPE_IP; - - iph->ip_v = IP_VERSION; - iph->ip_hl = IP_HLEN; - iph->ip_tos = 0; /* type of service is 0 */ - iph->ip_id = 0; /* id field is 0 */ - iph->ip_off = IP_DF; - iph->ip_ttl = 3; /* time to live is 3 seconds/hops */ - iph->ip_p = IPP_UDP; - bcopy(myip, iph->ip_src, sizeof(myip)); - bcopy(servip, iph->ip_dst, sizeof(servip)); - iph->ip_sum = 0; - iph->ip_len = tot - (char *)iph; - res = oc_cksum(iph, sizeof(struct ip), 0); - iph->ip_sum = 0xffff & ~res; - udph->uh_sport = myport; - udph->uh_dport = servport; - udph->uh_sum = 0; - - if ( mesgtype ) { - tftp_a->op_code = FTPOP_ACKN; - tftp_a->block = (u_short)(mesgtype); - } else { - bcopy (myip, &iptmp, sizeof(iptmp)); - bcopy(MSG, tftp_r, (sizeof(MSG)-1)); - for (lcv = 9; lcv >= 2; lcv--) { - tftp_r[lcv] = "0123456789ABCDEF"[iptmp & 0xF]; - - iptmp = iptmp >> 4; - } - } - - udph->uh_ulen = tot - (char *)udph; - - le_put( buf, tot - buf); + int tries = 0; + while (tries < 5) { + do_rev_arp(); + if (get_rev_arp()) + return (1); + tries++; + } + return (0); } -/* Attempt to tftp a file and read it into memory */ - -int -do_get_file () +/* + * Send a tftp read request or acknowledgement + * mesgtype 0 is a read request, 1 is an + * acknowledgement + */ +void +do_send_tftp(mesgtype) + int mesgtype; { - int fail = 0, oldlen; - char *loadat = (char *)LOAD_ADDR; - last_ack = 0; - - do_send_tftp( READ ); - while (1) { - if ( le_get(buf, sizeof(buf), 5) == 0) { /* timeout occured */ - if ( last_ack ) { - do_send_tftp( last_ack ); - } else { - do_send_tftp( READ ); - } - fail++; - if ( fail > 5 ) { - printf("\n"); - return 1; - } - } else { - printf("%x \r", tftp->info.block*512); - if ((eh->ether_type != ETYPE_IP) || (iph->ip_p != IPP_UDP)) { - fail++; - continue; - } - if (servport == FTP_PORT) servport = udph->uh_sport; - if (tftp->info.op_code == FTPOP_ERR) { - printf("TFTP: Download error %d: %s\n", - tftp->info.block, tftp->data); - return 1; - } - if (tftp->info.block != last_ack + 1) { /* we recieved the wrong block */ - if (tftp->info.block < last_ack +1) { - do_send_tftp(tftp->info.block); /* ackn whatever we recieved */ + u_long res, iptmp, lcv; + char *tot; + + if (mesgtype == 0) { + tot = tftp_r + (sizeof(MSG) - 1); + myport = (u_short) time(); + if (myport < 1000) + myport += 1000; + servport = FTP_PORT; /* to start */ + } else { + tot = (char *) tftp_a + 4; + } + + bcopy(servea, eh->ether_dhost, sizeof(servea)); + bcopy(myea, eh->ether_shost, sizeof(myea)); + eh->ether_type = ETYPE_IP; + + iph->ip_v = IP_VERSION; + iph->ip_hl = IP_HLEN; + iph->ip_tos = 0; /* type of service is 0 */ + iph->ip_id = 0; /* id field is 0 */ + iph->ip_off = IP_DF; + iph->ip_ttl = 3; /* time to live is 3 seconds/hops */ + iph->ip_p = IPP_UDP; + bcopy(myip, iph->ip_src, sizeof(myip)); + bcopy(servip, iph->ip_dst, sizeof(servip)); + iph->ip_sum = 0; + iph->ip_len = tot - (char *) iph; + res = oc_cksum(iph, sizeof(struct ip), 0); + iph->ip_sum = 0xffff & ~res; + udph->uh_sport = myport; + udph->uh_dport = servport; + udph->uh_sum = 0; + + if (mesgtype) { + tftp_a->op_code = FTPOP_ACKN; + tftp_a->block = (u_short) (mesgtype); } else { - do_send_tftp( last_ack ); /* ackn the last confirmed block */ - } - fail++; - } else { /* we got the right block */ - fail = 0; - last_ack++; - oldlen = udph->uh_ulen; - do_send_tftp( last_ack ); - /*printf("bcopy %x %x %d\n", &tftp->data, loadat, oldlen - 12);*/ - bcopy(&tftp->data, loadat, oldlen - 12); - loadat += oldlen - 12; - if (oldlen < (8 + 4 + 512)) { - printf("\n"); - return 0; - } - } - } - } - printf("\n"); - return 0; -} + bcopy(myip, &iptmp, sizeof(iptmp)); + bcopy(MSG, tftp_r, (sizeof(MSG) - 1)); + for (lcv = 9; lcv >= 2; lcv--) { + tftp_r[lcv] = "0123456789ABCDEF"[iptmp & 0xF]; + iptmp = iptmp >> 4; + } + } + udph->uh_ulen = tot - (char *) udph; + le_put(buf, tot - buf); +} +/* Attempt to tftp a file and read it into memory */ +int +do_get_file() +{ + int fail = 0, oldlen; + char *loadat = (char *) LOAD_ADDR; + last_ack = 0; + + do_send_tftp(READ); + while (1) { + if (le_get(buf, sizeof(buf), 5) == 0) { + /* timeout occured */ + if (last_ack) + do_send_tftp(last_ack); + else + do_send_tftp(READ); + + fail++; + if (fail > 5) { + printf("\n"); + return (1); + } + } else { + printf("%x \r", tftp->info.block * 512); + if ((eh->ether_type != ETYPE_IP) || (iph->ip_p != IPP_UDP)) { + fail++; + continue; + } + if (servport == FTP_PORT) + servport = udph->uh_sport; + if (tftp->info.op_code == FTPOP_ERR) { + printf("TFTP: Download error %d: %s\n", + tftp->info.block, tftp->data); + return (1); + } + if (tftp->info.block != last_ack + 1) { + /* we received the wrong block */ + if (tftp->info.block < last_ack + 1) { + /* nack whatever we received */ + do_send_tftp(tftp->info.block); + } else { + /* nack the last confirmed block */ + do_send_tftp(last_ack); + } + fail++; + } else {/* we got the right block */ + fail = 0; + last_ack++; + oldlen = udph->uh_ulen; + do_send_tftp(last_ack); + /* printf("bcopy %x %x %d\n", &tftp->data, + * loadat, oldlen - 12); */ + bcopy(&tftp->data, loadat, oldlen - 12); + loadat += oldlen - 12; + if (oldlen < (8 + 4 + 512)) { + printf("\n"); + return (0); + } + } + } + } + printf("\n"); + return (0); +} diff --git a/sys/arch/mvme68k/stand/sboot/etherfun.h b/sys/arch/mvme68k/stand/sboot/etherfun.h index 2b6a14d69a5..97e3924d552 100644 --- a/sys/arch/mvme68k/stand/sboot/etherfun.h +++ b/sys/arch/mvme68k/stand/sboot/etherfun.h @@ -1,3 +1,5 @@ +/* $OpenBSD: etherfun.h,v 1.2 1996/04/28 10:49:37 deraadt Exp $ */ + /* * * Copyright (c) 1995 Charles D. Cranor and Seth Widoff @@ -42,83 +44,83 @@ #define OPCODE_REPLY 4 /* Optype is REVARP reply */ /* ip header */ -#define IPP_UDP 17 /* IP Protocol is UDP */ -#define IP_VERSION 4 /* IP version number */ -#define IP_HLEN 5 /* IP header length is a fixed 50 bytes */ +#define IPP_UDP 17 /* IP Protocol is UDP */ +#define IP_VERSION 4 /* IP version number */ +#define IP_HLEN 5 /* IP header length is a fixed 50 bytes */ #define N 1536 /* tftp header */ #define FTPOP_ACKN 4 /* Opcode is acknowledge */ #define FTPOP_ERR 5 /* Opcode is Error */ #define FTP_PORT 69 /* Standard TFTP port number */ -#define MSG "\0\1xxxxxxxx.147\0octet\0" /* implicit NULL */ +#define MSG "\0\1xxxxxxxx.mvme68k\0octet\0" /* implicit NULL */ /* data structures */ struct ether_header { - u_char ether_dhost[6]; - u_char ether_shost[6]; - u_short ether_type; + u_char ether_dhost[6]; + u_char ether_shost[6]; + u_short ether_type; }; struct ether_arp { - u_short ar_hrd; /* format of hardware address */ - u_short ar_pro; /* format of protocol address */ - u_char ar_hln; /* length of hardware address */ - u_char ar_pln; /* length of protocol address */ - u_short ar_op; - u_char arp_sha[6]; /* sender hardware address */ - u_char arp_spa[4]; /* sender protocol address */ - u_char arp_tha[6]; /* target hardware address */ - u_char arp_tpa[4]; /* target protocol address */ + u_short ar_hrd; /* format of hardware address */ + u_short ar_pro; /* format of protocol address */ + u_char ar_hln; /* length of hardware address */ + u_char ar_pln; /* length of protocol address */ + u_short ar_op; + u_char arp_sha[6]; /* sender hardware address */ + u_char arp_spa[4]; /* sender protocol address */ + u_char arp_tha[6]; /* target hardware address */ + u_char arp_tpa[4]; /* target protocol address */ }; struct ip { - u_char ip_v:4, /* version */ - ip_hl:4; /* header length */ - u_char ip_tos; /* type of service */ - short ip_len; /* total length */ - u_short ip_id; /* identification */ - short ip_off; /* fragment offset field */ -#define IP_DF 0x4000 /* dont fragment flag */ -#define IP_MF 0x2000 /* more fragments flag */ -#define IP_OFFMASK 0x1fff /* mask for fragmenting bits */ - u_char ip_ttl; /* time to live */ - u_char ip_p; /* protocol */ - u_short ip_sum; /* checksum */ + u_char ip_v:4, /* version */ + ip_hl:4; /* header length */ + u_char ip_tos; /* type of service */ + short ip_len; /* total length */ + u_short ip_id; /* identification */ + short ip_off; /* fragment offset field */ +#define IP_DF 0x4000 /* dont fragment flag */ +#define IP_MF 0x2000 /* more fragments flag */ +#define IP_OFFMASK 0x1fff /* mask for fragmenting bits */ + u_char ip_ttl; /* time to live */ + u_char ip_p; /* protocol */ + u_short ip_sum; /* checksum */ u_char ip_src[4]; - u_char ip_dst[4]; /* source and dest address */ + u_char ip_dst[4]; /* source and dest address */ }; struct udp { - u_short uh_sport; + u_short uh_sport; u_short uh_dport; short uh_ulen; u_short uh_sum; }; struct tftph { - u_short op_code; - u_short block; + u_short op_code; + u_short block; }; struct tftphr { - struct tftph info; - char data[1]; + struct tftph info; + char data[1]; }; /* globals */ int last_ack; char buf[N]; struct ether_header *eh = (struct ether_header *)buf; -struct ether_arp *rarp = - (struct ether_arp *)(buf + sizeof(struct ether_header)); +struct ether_arp *rarp = (struct ether_arp *) + (buf + sizeof(struct ether_header)); struct ip *iph = (struct ip *)(buf + sizeof(struct ether_header)); -struct udp *udph = (struct udp *)(buf + sizeof(struct ether_header) + - sizeof(struct ip)); +struct udp *udph = (struct udp *) + (buf + sizeof(struct ether_header) + sizeof(struct ip)); char *tftp_r = buf + sizeof(struct ether_header) + sizeof(struct ip) + - sizeof(struct udp); + sizeof(struct udp); struct tftph *tftp_a = (struct tftph *)(buf + sizeof(struct ether_header) + - sizeof(struct ip) + sizeof(struct udp)); + sizeof(struct ip) + sizeof(struct udp)); struct tftphr *tftp = (struct tftphr *)(buf + sizeof(struct ether_header) + - sizeof(struct ip) + sizeof(struct udp)); + sizeof(struct ip) + sizeof(struct udp)); diff --git a/sys/arch/mvme68k/stand/sboot/if_le.c b/sys/arch/mvme68k/stand/sboot/if_le.c index ea39732ec4b..c20992ab39c 100644 --- a/sys/arch/mvme68k/stand/sboot/if_le.c +++ b/sys/arch/mvme68k/stand/sboot/if_le.c @@ -1,4 +1,4 @@ -/* $Id: if_le.c,v 1.2 1995/11/07 08:51:10 deraadt Exp $ */ +/* $OpenBSD: if_le.c,v 1.3 1996/04/28 10:49:38 deraadt Exp $ */ /* * Copyright (c) 1995 Theo de Raadt diff --git a/sys/arch/mvme68k/stand/sboot/if_lereg.h b/sys/arch/mvme68k/stand/sboot/if_lereg.h index 3c6f534e1e9..aad70679480 100644 --- a/sys/arch/mvme68k/stand/sboot/if_lereg.h +++ b/sys/arch/mvme68k/stand/sboot/if_lereg.h @@ -1,4 +1,4 @@ -/* $Id: if_lereg.h,v 1.2 1995/11/07 08:51:10 deraadt Exp $ */ +/* $OpenBSD: if_lereg.h,v 1.3 1996/04/28 10:49:41 deraadt Exp $ */ /*- * Copyright (c) 1982, 1992, 1993 diff --git a/sys/arch/mvme68k/stand/sboot/oc_cksum.S b/sys/arch/mvme68k/stand/sboot/oc_cksum.S index b68af69a5a6..328bf77bab9 100644 --- a/sys/arch/mvme68k/stand/sboot/oc_cksum.S +++ b/sys/arch/mvme68k/stand/sboot/oc_cksum.S @@ -1,4 +1,4 @@ -| $Id: oc_cksum.S,v 1.2 1995/11/07 08:51:11 deraadt Exp $ +| $OpenBSD: oc_cksum.S,v 1.3 1996/04/28 10:49:42 deraadt Exp $ | Copyright (c) 1988 Regents of the University of California. | All rights reserved. diff --git a/sys/arch/mvme68k/stand/sboot/sboot.c b/sys/arch/mvme68k/stand/sboot/sboot.c index 5b0f06b1a7e..5553227793e 100644 --- a/sys/arch/mvme68k/stand/sboot/sboot.c +++ b/sys/arch/mvme68k/stand/sboot/sboot.c @@ -1,3 +1,5 @@ +/* $OpenBSD: sboot.c,v 1.4 1996/04/28 10:49:43 deraadt Exp $ */ + /* * Copyright (c) 1995 Theo de Raadt * diff --git a/sys/arch/mvme68k/stand/sboot/sboot.h b/sys/arch/mvme68k/stand/sboot/sboot.h index 01085b17b90..0f79362de45 100644 --- a/sys/arch/mvme68k/stand/sboot/sboot.h +++ b/sys/arch/mvme68k/stand/sboot/sboot.h @@ -1,5 +1,6 @@ +/* $OpenBSD: sboot.h,v 1.2 1996/04/28 10:49:44 deraadt Exp $ */ + /* - * * Copyright (c) 1995 Charles D. Cranor and Seth Widoff * All rights reserved. * @@ -44,48 +45,48 @@ extern caddr_t end; #define NULL ((char *)0) -void bcopy(const void *, void *, size_t); /* libc_sa */ -void *memset(void *, int, size_t); /* libc_sa */ -void printf(const char *, ...); /* libc_sa */ +void bcopy __P((const void *, void *, size_t)); /* libc_sa */ +void *memset __P((void *, int, size_t)); /* libc_sa */ +int printf __P((const char *, ...)); /* libc_sa */ /* console */ -void puts(char *); -void putchar(char); -char cngetc(); -void ngets(char *, int); +void puts __P((char *)); +void putchar __P((char)); +char cngetc __P((void)); +void ngets __P((char *, int)); /* sboot */ -void callrom(); -void do_cmd(char *); +void callrom __P((void)); +void do_cmd __P((char *)); /* le */ #define LANCE_ADDR 0xfffe0778 #define ERAM_ADDR 0xfffe0774 #define LANCE_REG_ADDR 0xfffe1800 -void le_end(void); -void le_init(void); -int le_get(u_char *, size_t, u_long); -int le_put(u_char *, size_t); +void le_end __P((void)); +void le_init __P((void)); +int le_get __P((u_char *, size_t, u_long)); +int le_put __P((u_char *, size_t)); /* etherfun */ #define READ 0 #define ACKN 1 -void do_rev_arp(); -int get_rev_arp(); -int rev_arp(); -void do_send_tftp( int ); -int do_get_file(); -void tftp_file(char *, u_long); +void do_rev_arp __P((void)); +int get_rev_arp __P((void)); +int rev_arp __P((void)); +void do_send_tftp __P((int)); +int do_get_file __P((void)); +void tftp_file __P((char *, u_long)); /* clock */ -u_long time(void); +u_long time __P((void)); /* checksum */ -u_long oc_cksum (void *, u_long, u_long); +u_long oc_cksum __P((void *, u_long, u_long)); #define CONS_ZS_ADDR (0xfffe3002) #define CLOCK_ADDR (0xfffe07f8) -#define LOAD_ADDR 0x8000 +#define LOAD_ADDR 0x7000 unsigned char myea[6]; /* my ether addr */ unsigned char myip[4]; diff --git a/sys/arch/mvme68k/stand/sboot/srec.c b/sys/arch/mvme68k/stand/sboot/srec.c index 164fb4b458c..93ee5e2e53f 100644 --- a/sys/arch/mvme68k/stand/sboot/srec.c +++ b/sys/arch/mvme68k/stand/sboot/srec.c @@ -1,3 +1,5 @@ +/* $OpenBSD: srec.c,v 1.3 1996/04/28 10:49:45 deraadt Exp $ */ + /* * Public domain, believed to be by Mike Price. * |