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