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