sboot.h revision 1.3 1 /* $NetBSD: sboot.h,v 1.3 1998/01/05 07:03:07 perry Exp $ */
2
3 /*
4 *
5 * Copyright (c) 1995 Charles D. Cranor and Seth Widoff
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. All advertising materials mentioning features or use of this software
17 * must display the following acknowledgement:
18 * This product includes software developed by Charles D. Cranor
19 * and Seth Widoff.
20 * 4. The name of the author may not be used to endorse or promote products
21 * derived from this software without specific prior written permission.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
24 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
25 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
26 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
27 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
28 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
32 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35 /*
36 * sboot.h: stuff for MVME147's serial line boot
37 */
38
39 typedef unsigned short u_short;
40 typedef unsigned long u_long;
41 typedef unsigned char u_char;
42 typedef unsigned int u_int;
43 typedef u_long size_t;
44 typedef char *caddr_t;
45 extern caddr_t end;
46
47 #define NULL ((char *)0)
48
49 void bcopy(const void *, void *, size_t); /* libc_sa */
50 void *memset(void *, int, size_t); /* libc_sa */
51 void printf(const char *, ...); /* libc_sa */
52
53 /* console */
54 void puts(char *);
55 void putchar(char);
56 char cngetc();
57 char *ngets(char *, int);
58
59 /* sboot */
60 void callrom();
61 void do_cmd(char *, char *);
62
63 /* le */
64 #define LANCE_ADDR 0xfffe0778
65 #define ERAM_ADDR 0xfffe0774
66 #define LANCE_REG_ADDR 0xfffe1800
67 void le_end(void);
68 void le_init(void);
69 int le_get(u_char *, size_t, u_long);
70 int le_put(u_char *, size_t);
71
72 /* etherfun */
73 #define READ 0
74 #define ACKN 1
75 void do_rev_arp();
76 int get_rev_arp();
77 int rev_arp();
78 void do_send_tftp( int );
79 int do_get_file();
80 void tftp_file(char *, u_long);
81
82 /* clock */
83 u_long time(void);
84
85 /* checksum */
86 u_long oc_cksum (void *, u_long, u_long);
87
88 #define CONS_ZS_ADDR (0xfffe3002)
89 #define CLOCK_ADDR (0xfffe07f8)
90 #define LOAD_ADDR 0x8000
91
92 unsigned char myea[6]; /* my ether addr */
93 unsigned char myip[4];
94 unsigned char servip[4];
95 unsigned char servea[6];
96 u_short myport;
97 u_short servport;
98 unsigned char reboot;
99