Home | History | Annotate | Line # | Download | only in boot
samachdep.h revision 1.1
      1 /*	$NetBSD: samachdep.h,v 1.1 2013/01/05 17:44:24 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 /* init_main.c */
    111 extern int nplane;
    112 
    113 /* kbd.c */
    114 int kbd_decode(u_char);
    115 
    116 /* locore.S */
    117 extern	u_int bootdev;
    118 extern int dipsw1, dipsw2;
    119 int setjmp(label_t *);
    120 int splhigh(void);
    121 void splx(int);
    122 int getsfc(void);
    123 int getdfc(void);
    124 int spl0(void);
    125 int spl1(void);
    126 int spl2(void);
    127 int spl3(void);
    128 int spl4(void);
    129 int spl5(void);
    130 int spl6(void);
    131 
    132 /* machdep.c */
    133 void straytrap(int);
    134 int badaddr(volatile void *);
    135 void regdump(int *, int);
    136 char *hexstr(int, int);
    137 
    138 /* prf.c */
    139 #if 0
    140 int tgetchar(void);
    141 #endif
    142 
    143 /* parse.c */
    144 int check_args(int, char **);
    145 int exit_program(int, char **);
    146 int parse(int, char **);
    147 int getargs(char *, char **, int);
    148 
    149 /* romcons.c */
    150 void romcnprobe(struct consdev *);
    151 void romcninit(struct consdev *);
    152 int  romcngetc(dev_t);
    153 void romcnputc(dev_t, int);
    154 
    155 /* sc.c */
    156 struct scsi_fmt_cdb;
    157 int scsi_immed_command(int, int, int, struct scsi_fmt_cdb *, u_char *,
    158     unsigned int);
    159 int scsi_request_sense(int, int, int, u_char *, unsigned int);
    160 int scsi_test_unit_rdy(int, int, int);
    161 int scsi_format_unit(int, int, int);
    162 int scintr(void);
    163 
    164 /* scsi.c */
    165 int scsi(int, char **);
    166 int scsi_read_raw(u_int, u_int, u_int, u_char *, u_int);
    167 int scsi_read(u_int, u_char *, u_int);
    168 int scsi_write(u_int, u_char *, u_int);
    169 
    170 /* screen.c */
    171 int screen(int, char **);
    172 
    173 /* scsi.c */
    174 int scsi(int, char **);
    175 
    176 /* sd.c */
    177 int sdstrategy(void *, int, daddr_t, size_t, void *, size_t *);
    178 int sdopen(struct open_file *, ...);
    179 int sdclose(struct open_file *);
    180 
    181 /* sio.c */
    182 void _siointr(void);
    183 void siocnprobe(struct consdev *);
    184 void siocninit(struct consdev *);
    185 int  siocngetc(dev_t);
    186 void siocnputc(dev_t, int);
    187 void sioinit(void);
    188 
    189 /* tape.c */
    190 int tape(int, char **);
    191 
    192 /* trap.c */
    193 void trap(int, unsigned int, unsigned int, struct frame);
    194 
    195 /* ufs_disklabel.c */
    196 char *readdisklabel(int dev, int (*)(void *, int, daddr_t, size_t, void *, size_t *), struct disklabel *);
    197 
    198 
    199 #define DELAY(n)							\
    200 do {									\
    201 	register int __N = cpuspeed * (n);				\
    202 	do {								\
    203 		__asm("subql #1, %0" : "=r" (__N) : "0" (__N));		\
    204 	} while (__N > 0);						\
    205 } while (/* CONSTCOND */ 0)
    206 
    207 extern	struct fs_ops file_system_ufs[];
    208 extern	struct fs_ops file_system_nfs[];
    209 
    210 extern	const char bootprog_name[], bootprog_rev[], bootprog_kernrev[];
    211