xref: /openbsd/sys/arch/luna88k/stand/boot/samachdep.h (revision a6445c1d)
1 /*	$OpenBSD: samachdep.h,v 1.3 2013/10/29 21:49:07 miod Exp $	*/
2 /*	$NetBSD: samachdep.h,v 1.10 2013/03/05 15:34:53 tsutsui Exp $	*/
3 
4 /*
5  * Copyright (c) 1982, 1990, 1993
6  *	The Regents of the University of California.  All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  * 1. Redistributions of source code must retain the above copyright
12  *    notice, this list of conditions and the following disclaimer.
13  * 2. Redistributions in binary form must reproduce the above copyright
14  *    notice, this list of conditions and the following disclaimer in the
15  *    documentation and/or other materials provided with the distribution.
16  * 3. Neither the name of the University nor the names of its contributors
17  *    may be used to endorse or promote products derived from this software
18  *    without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30  * SUCH DAMAGE.
31  *
32  *	@(#)samachdep.h	8.1 (Berkeley) 6/10/93
33  */
34 
35 #include <sys/param.h>
36 #include <lib/libsa/stand.h>
37 
38 #define MHZ_25		25
39 #define MHZ_33		33
40 
41 struct consdev;
42 typedef struct label_t {
43 	long val[19];
44 } label_t;
45 
46 /* autoconf.c */
47 void configure(void);
48 void find_devs(void);
49 
50 /* awaitkey.c */
51 char awaitkey(const char *, int, int);
52 
53 /* bcd.c */
54 unsigned int bcdtobin(unsigned int);
55 
56 /* bmc.c */
57 void bmccnprobe(struct consdev *);
58 void bmccninit(struct consdev *);
59 int  bmccngetc(dev_t);
60 void bmccnputc(dev_t, int);
61 
62 /* bmd.c */
63 void bmdinit(void);
64 int bmdputc(int);
65 void bmdadjust(short, short);
66 void bmdclear(void);
67 
68 /* boot.c */
69 extern int howto;
70 int boot(int, char **);
71 int bootunix(char *);
72 
73 extern void (*cpu_boot)(uint32_t, uint32_t);
74 extern uint32_t cpu_bootarg1;
75 extern uint32_t cpu_bootarg2;
76 #define	BOOT_MAGIC	0xf1abde3f
77 
78 /* cons.c */
79 void cninit(void);
80 int cngetc(void);
81 void cnputc(int);
82 
83 /* fault.c */
84 int badaddr(void *, int);
85 
86 /* font.c */
87 extern const u_short bmdfont[][20];
88 
89 /* getline.c */
90 int getline(const char *, char *);
91 
92 /* init_main.c */
93 extern int cpuspeed;
94 extern int nplane;
95 extern int machtype;
96 extern char default_file[];
97 extern char fuse_rom_data[];
98 
99 /* kbd.c */
100 int kbd_decode(u_char);
101 
102 /* lance.c */
103 void *lance_attach(uint, void *, void *, uint8_t *);
104 void *lance_cookie(uint);
105 uint8_t *lance_eaddr(void *);
106 int lance_init(void *);
107 int lance_get(void *, void *, size_t);
108 int lance_put(void *, void *, size_t);
109 int lance_end(void *);
110 
111 /* locore.S */
112 extern u_int bootdev;
113 extern uint16_t dipswitch;
114 extern volatile uint32_t tick;
115 int setjmp(label_t *);
116 void delay(int);
117 
118 /* prf.c */
119 int tgetchar(void);
120 
121 /* parse.c */
122 int exit_program(int, char **);
123 int parse(int, char **);
124 int getargs(char *, char **, int);
125 
126 /* sc.c */
127 struct scsi_softc;
128 int scinit(struct scsi_softc *, uint);
129 struct scsi_generic_cdb;
130 int scsi_immed_command(struct scsi_softc *, int, int, struct scsi_generic_cdb *,
131     u_char *, unsigned int);
132 int scsi_request_sense(struct scsi_softc *, int, int, u_char *, unsigned int);
133 int scsi_test_unit_rdy(struct scsi_softc *, int, int);
134 
135 /* sd.c */
136 int sdstrategy(void *, int, daddr32_t, size_t, void *, size_t *);
137 int sdopen(struct open_file *, ...);
138 int sdclose(struct open_file *);
139 
140 /* sio.c */
141 void _siointr(void);
142 void siocnprobe(struct consdev *);
143 void siocninit(struct consdev *);
144 int  siocngetc(dev_t);
145 void siocnputc(dev_t, int);
146 void sioinit(void);
147 
148 /* ufs_disklabel.c */
149 char *readdisklabel(struct scsi_softc *, uint, struct disklabel *);
150 
151 #define DELAY(n)	delay(n)
152 
153 extern	struct fs_ops file_system_disk[];
154 extern	int nfsys_disk;
155 extern	struct fs_ops file_system_nfs[];
156