xxboot.h revision 1.3 1 /* $NetBSD: xxboot.h,v 1.3 2020/08/14 03:34:22 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 void RAW_READ(void *, uint32_t, size_t);
32 extern int badbaddr(volatile void *);
33 extern unsigned int BOOT_INFO; /* result of IOCS(__BOOTINF) */
34 extern unsigned int ID; /* target SCSI ID */
35 extern struct {
36 struct fdfmt{
37 uint8_t N; /* sector length 0: 128, ..., 3: 1K */
38 uint8_t C; /* cylinder # */
39 uint8_t H; /* head # */
40 uint8_t R; /* sector # */
41 } minsec, maxsec;
42 } FDSECMINMAX; /* FD format type of the first track */
43
44 /* xx.c */
45 extern int xxopen(struct open_file *, ...);
46 extern int xxclose(struct open_file *);
47 extern int xxstrategy(void *, int, daddr_t, size_t, void *, size_t *);
48
49 /* vers.c */
50 extern const char bootprog_name[];
51 extern const char bootprog_rev[];
52