samachdep.h revision 1.11 1 /* $NetBSD: samachdep.h,v 1.11 2014/01/02 20:02:00 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 void configure(void);
58 void find_devs(void);
59
60 /* awaitkey.c */
61 char awaitkey(const char *, int, bool);
62
63 /* bmc.c */
64 void bmccnprobe(struct consdev *);
65 void bmccninit(struct consdev *);
66 int bmccngetc(dev_t);
67 void bmccnputc(dev_t, int);
68
69 /* bmd.c */
70 void bmdinit(void);
71 int bmdputc(int);
72 void bmdadjust(short, short);
73 void bmdclear(void);
74
75 /* boot.c */
76 extern int howto;
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 const uint16_t 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 cpuspeed;
115 extern int hz;
116 extern int nplane;
117 extern int machtype;
118 extern char default_file[];
119
120 /* kbd.c */
121 int kbd_decode(u_char);
122
123 /* lance.c */
124 void *lance_attach(int, void *, void *, uint8_t *);
125 void *lance_cookie(int);
126 uint8_t *lance_eaddr(void *);
127 bool lance_init(void *);
128 int lance_get(void *, void *, size_t);
129 bool lance_put(void *, void *, size_t);
130 bool lance_end(void *);
131 int lance_intr(void);
132
133 /* locore.S */
134 extern u_int bootdev;
135 extern int dipsw1, dipsw2;
136 extern int cputype;
137 extern volatile uint32_t tick;
138 int setjmp(label_t *);
139 int splhigh(void);
140 void splx(int);
141 int getsfc(void);
142 int getdfc(void);
143 int spl0(void);
144 int spl1(void);
145 int spl2(void);
146 int spl3(void);
147 int spl4(void);
148 int spl5(void);
149 int spl6(void);
150
151 /* ls.c */
152 int cmd_ls(int, char **);
153
154 /* machdep.c */
155 void straytrap(int);
156 int badaddr(volatile void *);
157 void regdump(int *, int);
158 char *hexstr(int, int);
159
160 /* prf.c */
161 int tgetchar(void);
162
163 /* parse.c */
164 int check_args(int, char **);
165 int exit_program(int, char **);
166 int parse(int, char **);
167 int getargs(char *, char **, int);
168
169 /* romcons.c */
170 void romcnprobe(struct consdev *);
171 void romcninit(struct consdev *);
172 int romcngetc(dev_t);
173 void romcnputc(dev_t, int);
174
175 /* sc.c */
176 struct scsi_fmt_cdb;
177 int scsi_immed_command(int, int, int, struct scsi_fmt_cdb *, u_char *,
178 unsigned int);
179 int scsi_request_sense(int, int, int, u_char *, unsigned int);
180 int scsi_test_unit_rdy(int, int, int);
181 int scsi_format_unit(int, int, int);
182 int scintr(void);
183
184 /* scsi.c */
185 int scsi(int, char **);
186 int scsi_read_raw(u_int, u_int, u_int, u_char *, u_int);
187 int scsi_read(u_int, u_char *, u_int);
188 int scsi_write(u_int, u_char *, u_int);
189
190 /* screen.c */
191 int screen(int, char **);
192
193 /* scsi.c */
194 int scsi(int, char **);
195
196 /* sd.c */
197 int sdstrategy(void *, int, daddr_t, size_t, void *, size_t *);
198 int sdopen(struct open_file *, ...);
199 int sdclose(struct open_file *);
200
201 /* sio.c */
202 void _siointr(void);
203 void siocnprobe(struct consdev *);
204 void siocninit(struct consdev *);
205 int siocngetc(dev_t);
206 void siocnputc(dev_t, int);
207 void sioinit(void);
208
209 /* tape.c */
210 int tape(int, char **);
211
212 /* trap.c */
213 void trap(int, unsigned int, unsigned int, struct frame);
214
215 /* ufs_disklabel.c */
216 char *readdisklabel(int, int, struct disklabel *);
217
218
219 #define DELAY(n) \
220 do { \
221 register int __N = cpuspeed * (n); \
222 do { \
223 __asm("subql #1, %0" : "=r" (__N) : "0" (__N)); \
224 } while (__N > 0); \
225 } while (/* CONSTCOND */ 0)
226
227 extern struct fs_ops file_system_disk[];
228 extern int nfsys_disk;
229 extern struct fs_ops file_system_nfs[];
230
231 extern const char bootprog_name[], bootprog_rev[], bootprog_kernrev[];
232