xref: /netbsd-src/sys/arch/x68k/stand/xxboot/xxboot.h (revision 7e73c3a86c7acd948a7e0f539969e328d81b0229)
1 /*	$NetBSD: xxboot.h,v 1.4 2020/08/16 06:43:43 isaki Exp $	*/
2 
3 /*
4  * Copyright (C) 2020 Tetsuya Isaki. All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  * 1. Redistributions of source code must retain the above copyright
10  *    notice, this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  *    notice, this list of conditions and the following disclaimer in the
13  *    documentation and/or other materials provided with the distribution.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
20  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
22  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
23  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25  * SUCH DAMAGE.
26  */
27 
28 #define BINF_ISFD(pbinf)	(*((uint8_t *)(pbinf) + 1) == 0)
29 
30 /* boot.S */
31 extern int raw_read(uint32_t, uint32_t, void *);
32 extern int badbaddr(volatile void *);
33 extern void BOOT_ERROR(const char *) __dead;
34 extern uint32_t BOOT_INFO;	/* result of IOCS(__BOOTINF) */
35 extern uint32_t SCSI_ID;	/* target SCSI ID */
36 extern uint32_t SCSI_PARTTOP;	/* top sector # of this partition */
37 extern uint32_t SCSI_BLKLEN;	/* sector length index */
38 extern struct {
39 	uint32_t total_blocks;
40 	uint32_t blocksize;
41 } SCSI_CAP;
42 extern struct {
43 	struct fdfmt{
44 		uint8_t	N;	/* sector length 1:256, 2:512, 3:1024 */
45 		uint8_t	C;	/* cylinder # */
46 		uint8_t	H;	/* head # */
47 		uint8_t	R;	/* sector # */
48 	} minsec, maxsec;
49 } FDSEC;			/* FD format type of the first track */
50 
51 /* bootmain.c */
52 extern void print_hex(u_int, int);
53 
54 /* consio1.c */
55 extern int getchar(void);
56 extern void putchar(int);
57 
58 /* xx.c */
59 extern int xxopen(struct open_file *, ...);
60 extern int xxclose(struct open_file *);
61 extern int xxstrategy(void *, int, daddr_t, size_t, void *, size_t *);
62 
63 /* xxboot.ldscript */
64 extern uint32_t startregs[16];
65 
66 /* vers.c */
67 extern const char bootprog_name[];
68 extern const char bootprog_rev[];
69