samachdep.h revision 1.14 1 /* $NetBSD: samachdep.h,v 1.14 2014/01/03 07:17:19 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 /* disklabel.c */
88 extern u_char lbl_buff[];
89 int disklabel(int, char **);
90
91 /* exec.c */
92 void exec_hp300(char *, u_long, int);
93
94 /* font.c */
95 extern const uint16_t bmdfont[][20];
96
97 /* fsdump.c */
98 int fsdump(int, char **);
99 int fsrestore(int, char **);
100
101 /* getline.c */
102 int getline(const char *, char *);
103
104 /* if_le.c */
105 int leinit(void *);
106
107 /* init_main.c */
108 extern int cpuspeed;
109 extern int hz;
110 extern int nplane;
111 extern int machtype;
112 extern char default_file[];
113
114 /* kbd.c */
115 int kbd_decode(u_char);
116
117 /* lance.c */
118 void *lance_attach(int, void *, void *, uint8_t *);
119 void *lance_cookie(int);
120 uint8_t *lance_eaddr(void *);
121 bool lance_init(void *);
122 int lance_get(void *, void *, size_t);
123 bool lance_put(void *, void *, size_t);
124 bool lance_end(void *);
125 int lance_intr(void);
126
127 /* locore.S */
128 extern u_int bootdev;
129 extern int dipsw1, dipsw2;
130 extern int cputype;
131 extern volatile uint32_t tick;
132 int setjmp(label_t *);
133 int splhigh(void);
134 void splx(int);
135 int getsfc(void);
136 int getdfc(void);
137 int spl0(void);
138 int spl1(void);
139 int spl2(void);
140 int spl3(void);
141 int spl4(void);
142 int spl5(void);
143 int spl6(void);
144
145 /* ls.c */
146 int cmd_ls(int, char **);
147
148 /* machdep.c */
149 void straytrap(int);
150 int badaddr(volatile void *);
151 void regdump(int *, int);
152 char *hexstr(int, int);
153
154 /* prf.c */
155 int tgetchar(void);
156
157 /* parse.c */
158 int check_args(int, char **);
159 int exit_program(int, char **);
160 int parse(int, char **);
161 int getargs(char *, char **, int);
162
163 /* romcons.c */
164 void romcnprobe(struct consdev *);
165 void romcninit(struct consdev *);
166 int romcngetc(dev_t);
167 void romcnputc(dev_t, int);
168
169 /* sc.c */
170 struct scsi_generic_cdb;
171 int scsi_immed_command(int, int, int, struct scsi_generic_cdb *, u_char *,
172 unsigned int);
173 int scsi_request_sense(int, int, int, u_char *, unsigned int);
174 int scsi_test_unit_rdy(int, int, int);
175 int scsi_format_unit(int, int, int);
176 int scintr(void);
177
178 /* scsi.c */
179 int scsi(int, char **);
180 int scsi_read_raw(u_int, u_int, u_int, u_char *, u_int);
181 int scsi_read(u_int, u_char *, u_int);
182 int scsi_write(u_int, u_char *, u_int);
183
184 /* screen.c */
185 int screen(int, char **);
186
187 /* scsi.c */
188 int scsi(int, char **);
189
190 /* sd.c */
191 int sdstrategy(void *, int, daddr_t, size_t, void *, size_t *);
192 int sdopen(struct open_file *, ...);
193 int sdclose(struct open_file *);
194
195 /* sio.c */
196 void _siointr(void);
197 void siocnprobe(struct consdev *);
198 void siocninit(struct consdev *);
199 int siocngetc(dev_t);
200 void siocnputc(dev_t, int);
201 void sioinit(void);
202
203 /* tape.c */
204 int tape(int, char **);
205
206 /* trap.c */
207 void trap(int, unsigned int, unsigned int, struct frame);
208
209 /* ufs_disklabel.c */
210 char *readdisklabel(int, int, struct disklabel *);
211
212
213 #define DELAY(n) \
214 do { \
215 register int __N = cpuspeed * (n); \
216 do { \
217 __asm("subql #1, %0" : "=r" (__N) : "0" (__N)); \
218 } while (__N > 0); \
219 } while (/* CONSTCOND */ 0)
220
221 extern struct fs_ops file_system_disk[];
222 extern int nfsys_disk;
223 extern struct fs_ops file_system_nfs[];
224
225 extern const char bootprog_name[], bootprog_rev[], bootprog_kernrev[];
226