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