Home | History | Annotate | Line # | Download | only in boot
samachdep.h revision 1.6
      1 /*	$NetBSD: samachdep.h,v 1.6 2013/01/16 15:46:20 tsutsui Exp $	*/
      2 
      3 /*
      4  * Copyright (c) 1982, 1990, 1993
      5  *	The Regents of the University of California.  All rights reserved.
      6  *
      7  * Redistribution and use in source and binary forms, with or without
      8  * modification, are permitted provided that the following conditions
      9  * are met:
     10  * 1. Redistributions of source code must retain the above copyright
     11  *    notice, this list of conditions and the following disclaimer.
     12  * 2. Redistributions in binary form must reproduce the above copyright
     13  *    notice, this list of conditions and the following disclaimer in the
     14  *    documentation and/or other materials provided with the distribution.
     15  * 3. Neither the name of the University nor the names of its contributors
     16  *    may be used to endorse or promote products derived from this software
     17  *    without specific prior written permission.
     18  *
     19  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     20  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     21  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     22  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     23  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     24  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     25  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     26  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     27  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     28  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     29  * SUCH DAMAGE.
     30  *
     31  *	@(#)samachdep.h	8.1 (Berkeley) 6/10/93
     32  */
     33 
     34 #include <sys/param.h>
     35 #include <m68k/frame.h>
     36 #include <lib/libsa/stand.h>
     37 
     38 #define	NSCSI		2
     39 #define NSD		8
     40 #define DK_NDRIVE	8
     41 
     42 #define MHZ_8		1
     43 #define MHZ_16		2
     44 #define MHZ_25		3
     45 #define MHZ_33		4
     46 #define MHZ_50		6
     47 
     48 #define MAXDEVNAME	16
     49 
     50 struct consdev;
     51 struct frame;
     52 typedef struct label_t {
     53 	int val[15];
     54 } label_t;
     55 
     56 /* autoconf.c */
     57 extern int cpuspeed;
     58 void configure(void);
     59 void find_devs(void);
     60 
     61 /* bmc.c */
     62 void bmcintr(void);
     63 void bmccnprobe(struct consdev *);
     64 void bmccninit(struct consdev *);
     65 int  bmccngetc(dev_t);
     66 void bmccnputc(dev_t, int);
     67 
     68 /* bmd.c */
     69 void bmdinit(void);
     70 int bmdputc(int);
     71 void bmdadjust(short, short);
     72 void bmdclear(void);
     73 
     74 /* boot.c */
     75 extern int howto;
     76 extern char default_file[];
     77 int how_to_boot(int, char **);
     78 int boot(int, char **);
     79 int bootnetbsd(char *);
     80 
     81 /* clock.c */
     82 /* not yet */
     83 
     84 /* cons.c */
     85 void cninit(void);
     86 int cngetc(void);
     87 void cnputc(int);
     88 
     89 /* devopen.c */
     90 extern	u_int opendev;
     91 int atoi(char *);
     92 
     93 /* disklabel.c */
     94 extern u_char lbl_buff[];
     95 int disklabel(int, char **);
     96 
     97 /* exec.c */
     98 void exec_hp300(char *, u_long, int);
     99 
    100 /* font.c */
    101 extern u_short bmdfont[][20];
    102 
    103 /* fsdump.c */
    104 int fsdump(int, char **);
    105 int fsrestore(int, char **);
    106 
    107 /* getline.c */
    108 int getline(char *, char *);
    109 
    110 /* if_le.c */
    111 int leinit(void *);
    112 
    113 /* init_main.c */
    114 extern int nplane;
    115 extern int machtype;
    116 
    117 /* kbd.c */
    118 int kbd_decode(u_char);
    119 
    120 /* lance.c */
    121 void *lance_attach(int, void *, void *, uint8_t *);
    122 void *lance_cookie(int);
    123 uint8_t *lance_eaddr(void *);
    124 bool lance_init(void *);
    125 int lance_get(void *, void *, size_t);
    126 bool lance_put(void *, void *, size_t);
    127 bool lance_end(void *);
    128 int lance_intr(void);
    129 
    130 /* locore.S */
    131 extern	u_int bootdev;
    132 extern int dipsw1, dipsw2;
    133 extern int cputype;
    134 int setjmp(label_t *);
    135 int splhigh(void);
    136 void splx(int);
    137 int getsfc(void);
    138 int getdfc(void);
    139 int spl0(void);
    140 int spl1(void);
    141 int spl2(void);
    142 int spl3(void);
    143 int spl4(void);
    144 int spl5(void);
    145 int spl6(void);
    146 
    147 /* ls.c */
    148 int cmd_ls(int, char **);
    149 
    150 /* machdep.c */
    151 void straytrap(int);
    152 int badaddr(volatile void *);
    153 void regdump(int *, int);
    154 char *hexstr(int, int);
    155 
    156 /* prf.c */
    157 #if 0
    158 int tgetchar(void);
    159 #endif
    160 
    161 /* parse.c */
    162 int check_args(int, char **);
    163 int exit_program(int, char **);
    164 int parse(int, char **);
    165 int getargs(char *, char **, int);
    166 
    167 /* romcons.c */
    168 void romcnprobe(struct consdev *);
    169 void romcninit(struct consdev *);
    170 int  romcngetc(dev_t);
    171 void romcnputc(dev_t, int);
    172 
    173 /* sc.c */
    174 struct scsi_fmt_cdb;
    175 int scsi_immed_command(int, int, int, struct scsi_fmt_cdb *, u_char *,
    176     unsigned int);
    177 int scsi_request_sense(int, int, int, u_char *, unsigned int);
    178 int scsi_test_unit_rdy(int, int, int);
    179 int scsi_format_unit(int, int, int);
    180 int scintr(void);
    181 
    182 /* scsi.c */
    183 int scsi(int, char **);
    184 int scsi_read_raw(u_int, u_int, u_int, u_char *, u_int);
    185 int scsi_read(u_int, u_char *, u_int);
    186 int scsi_write(u_int, u_char *, u_int);
    187 
    188 /* screen.c */
    189 int screen(int, char **);
    190 
    191 /* scsi.c */
    192 int scsi(int, char **);
    193 
    194 /* sd.c */
    195 int sdstrategy(void *, int, daddr_t, size_t, void *, size_t *);
    196 int sdopen(struct open_file *, ...);
    197 int sdclose(struct open_file *);
    198 
    199 /* sio.c */
    200 void _siointr(void);
    201 void siocnprobe(struct consdev *);
    202 void siocninit(struct consdev *);
    203 int  siocngetc(dev_t);
    204 void siocnputc(dev_t, int);
    205 void sioinit(void);
    206 
    207 /* tape.c */
    208 int tape(int, char **);
    209 
    210 /* trap.c */
    211 void trap(int, unsigned int, unsigned int, struct frame);
    212 
    213 /* ufs_disklabel.c */
    214 char *readdisklabel(int, int, struct disklabel *);
    215 
    216 
    217 #define DELAY(n)							\
    218 do {									\
    219 	register int __N = cpuspeed * (n);				\
    220 	do {								\
    221 		__asm("subql #1, %0" : "=r" (__N) : "0" (__N));		\
    222 	} while (__N > 0);						\
    223 } while (/* CONSTCOND */ 0)
    224 
    225 extern	struct fs_ops file_system_disk[];
    226 extern	int nfsys_disk;
    227 extern	struct fs_ops file_system_nfs[];
    228 
    229 extern	const char bootprog_name[], bootprog_rev[], bootprog_kernrev[];
    230