samachdep.h revision 1.13 1 /* $NetBSD: samachdep.h,v 1.13 2014/01/03 06:37:13 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 struct consdev;
49 struct frame;
50 typedef struct label_t {
51 int val[15];
52 } label_t;
53
54 /* autoconf.c */
55 void configure(void);
56 void find_devs(void);
57
58 /* awaitkey.c */
59 char awaitkey(const char *, int, bool);
60
61 /* bmc.c */
62 void bmccnprobe(struct consdev *);
63 void bmccninit(struct consdev *);
64 int bmccngetc(dev_t);
65 void bmccnputc(dev_t, int);
66
67 /* bmd.c */
68 void bmdinit(void);
69 int bmdputc(int);
70 void bmdadjust(short, short);
71 void bmdclear(void);
72
73 /* boot.c */
74 extern int howto;
75 int how_to_boot(int, char **);
76 int boot(int, char **);
77 int bootnetbsd(char *);
78
79 /* clock.c */
80 /* not yet */
81
82 /* cons.c */
83 void cninit(void);
84 int cngetc(void);
85 void cnputc(int);
86
87 /* devopen.c */
88 extern u_int opendev;
89 int atoi(char *);
90
91 /* disklabel.c */
92 extern u_char lbl_buff[];
93 int disklabel(int, char **);
94
95 /* exec.c */
96 void exec_hp300(char *, u_long, int);
97
98 /* font.c */
99 extern const uint16_t bmdfont[][20];
100
101 /* fsdump.c */
102 int fsdump(int, char **);
103 int fsrestore(int, char **);
104
105 /* getline.c */
106 int getline(const char *, char *);
107
108 /* if_le.c */
109 int leinit(void *);
110
111 /* init_main.c */
112 extern int cpuspeed;
113 extern int hz;
114 extern int nplane;
115 extern int machtype;
116 extern char default_file[];
117
118 /* kbd.c */
119 int kbd_decode(u_char);
120
121 /* lance.c */
122 void *lance_attach(int, void *, void *, uint8_t *);
123 void *lance_cookie(int);
124 uint8_t *lance_eaddr(void *);
125 bool lance_init(void *);
126 int lance_get(void *, void *, size_t);
127 bool lance_put(void *, void *, size_t);
128 bool lance_end(void *);
129 int lance_intr(void);
130
131 /* locore.S */
132 extern u_int bootdev;
133 extern int dipsw1, dipsw2;
134 extern int cputype;
135 extern volatile uint32_t tick;
136 int setjmp(label_t *);
137 int splhigh(void);
138 void splx(int);
139 int getsfc(void);
140 int getdfc(void);
141 int spl0(void);
142 int spl1(void);
143 int spl2(void);
144 int spl3(void);
145 int spl4(void);
146 int spl5(void);
147 int spl6(void);
148
149 /* ls.c */
150 int cmd_ls(int, char **);
151
152 /* machdep.c */
153 void straytrap(int);
154 int badaddr(volatile void *);
155 void regdump(int *, int);
156 char *hexstr(int, int);
157
158 /* prf.c */
159 int tgetchar(void);
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