Home | History | Annotate | Line # | Download | only in boot
samachdep.h revision 1.9.6.5
      1  1.9.6.2       tls /*	$NetBSD: samachdep.h,v 1.9.6.5 2017/12/03 11:36:23 jdolecek Exp $	*/
      2  1.9.6.2       tls 
      3  1.9.6.2       tls /*
      4  1.9.6.2       tls  * Copyright (c) 1982, 1990, 1993
      5  1.9.6.2       tls  *	The Regents of the University of California.  All rights reserved.
      6  1.9.6.2       tls  *
      7  1.9.6.2       tls  * Redistribution and use in source and binary forms, with or without
      8  1.9.6.2       tls  * modification, are permitted provided that the following conditions
      9  1.9.6.2       tls  * are met:
     10  1.9.6.2       tls  * 1. Redistributions of source code must retain the above copyright
     11  1.9.6.2       tls  *    notice, this list of conditions and the following disclaimer.
     12  1.9.6.2       tls  * 2. Redistributions in binary form must reproduce the above copyright
     13  1.9.6.2       tls  *    notice, this list of conditions and the following disclaimer in the
     14  1.9.6.2       tls  *    documentation and/or other materials provided with the distribution.
     15  1.9.6.2       tls  * 3. Neither the name of the University nor the names of its contributors
     16  1.9.6.2       tls  *    may be used to endorse or promote products derived from this software
     17  1.9.6.2       tls  *    without specific prior written permission.
     18  1.9.6.2       tls  *
     19  1.9.6.2       tls  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     20  1.9.6.2       tls  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     21  1.9.6.2       tls  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     22  1.9.6.2       tls  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     23  1.9.6.2       tls  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     24  1.9.6.2       tls  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     25  1.9.6.2       tls  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     26  1.9.6.2       tls  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     27  1.9.6.2       tls  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     28  1.9.6.2       tls  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     29  1.9.6.2       tls  * SUCH DAMAGE.
     30  1.9.6.2       tls  *
     31  1.9.6.2       tls  *	@(#)samachdep.h	8.1 (Berkeley) 6/10/93
     32  1.9.6.2       tls  */
     33  1.9.6.2       tls 
     34  1.9.6.2       tls #include <sys/param.h>
     35  1.9.6.2       tls #include <m68k/frame.h>
     36  1.9.6.2       tls #include <lib/libsa/stand.h>
     37  1.9.6.2       tls 
     38  1.9.6.2       tls #define	NSCSI		2
     39  1.9.6.2       tls 
     40  1.9.6.2       tls #define MHZ_8		1
     41  1.9.6.2       tls #define MHZ_16		2
     42  1.9.6.2       tls #define MHZ_25		3
     43  1.9.6.2       tls #define MHZ_33		4
     44  1.9.6.2       tls #define MHZ_50		6
     45  1.9.6.2       tls 
     46  1.9.6.2       tls struct consdev;
     47  1.9.6.2       tls struct frame;
     48  1.9.6.2       tls typedef struct label_t {
     49  1.9.6.2       tls 	int val[15];
     50  1.9.6.2       tls } label_t;
     51  1.9.6.2       tls 
     52  1.9.6.2       tls /* autoconf.c */
     53  1.9.6.2       tls void find_devs(void);
     54  1.9.6.4       tls extern const int dev2adpt[];
     55  1.9.6.2       tls 
     56  1.9.6.2       tls /* awaitkey.c */
     57  1.9.6.2       tls char awaitkey(const char *, int, bool);
     58  1.9.6.2       tls 
     59  1.9.6.2       tls /* bmc.c */
     60  1.9.6.2       tls void bmccnprobe(struct consdev *);
     61  1.9.6.2       tls void bmccninit(struct consdev *);
     62  1.9.6.2       tls int  bmccngetc(dev_t);
     63  1.9.6.2       tls void bmccnputc(dev_t, int);
     64  1.9.6.2       tls 
     65  1.9.6.2       tls /* bmd.c */
     66  1.9.6.2       tls void bmdinit(void);
     67  1.9.6.2       tls int bmdputc(int);
     68  1.9.6.5  jdolecek void bmdadjust(int16_t, int16_t);
     69  1.9.6.2       tls void bmdclear(void);
     70  1.9.6.2       tls 
     71  1.9.6.2       tls /* boot.c */
     72  1.9.6.2       tls int boot(int, char **);
     73  1.9.6.4       tls int bootnetbsd(char *, int);
     74  1.9.6.2       tls 
     75  1.9.6.2       tls /* cons.c */
     76  1.9.6.2       tls void cninit(void);
     77  1.9.6.2       tls int cngetc(void);
     78  1.9.6.2       tls void cnputc(int);
     79  1.9.6.2       tls 
     80  1.9.6.2       tls /* devopen.c */
     81  1.9.6.4       tls int make_device(const char *, int *, int *, int *, char **);
     82  1.9.6.2       tls 
     83  1.9.6.2       tls /* disklabel.c */
     84  1.9.6.5  jdolecek extern uint8_t lbl_buff[];
     85  1.9.6.2       tls int disklabel(int, char **);
     86  1.9.6.2       tls 
     87  1.9.6.2       tls /* font.c */
     88  1.9.6.4       tls extern const uint16_t bmdfont[][20];
     89  1.9.6.2       tls 
     90  1.9.6.2       tls /* fsdump.c */
     91  1.9.6.2       tls int fsdump(int, char **);
     92  1.9.6.2       tls int fsrestore(int, char **);
     93  1.9.6.2       tls 
     94  1.9.6.2       tls /* getline.c */
     95  1.9.6.4       tls int getline(const char *, char *);
     96  1.9.6.2       tls 
     97  1.9.6.2       tls /* if_le.c */
     98  1.9.6.4       tls int leinit(int, void *);
     99  1.9.6.2       tls 
    100  1.9.6.2       tls /* init_main.c */
    101  1.9.6.2       tls extern int cpuspeed;
    102  1.9.6.2       tls extern int hz;
    103  1.9.6.2       tls extern int nplane;
    104  1.9.6.2       tls extern int machtype;
    105  1.9.6.3       tls extern char default_file[];
    106  1.9.6.4       tls extern const char *default_bootdev;
    107  1.9.6.4       tls extern int default_unit;
    108  1.9.6.2       tls 
    109  1.9.6.2       tls /* kbd.c */
    110  1.9.6.5  jdolecek int kbd_decode(uint8_t);
    111  1.9.6.2       tls 
    112  1.9.6.2       tls /* lance.c */
    113  1.9.6.2       tls void *lance_attach(int, void *, void *, uint8_t *);
    114  1.9.6.2       tls void *lance_cookie(int);
    115  1.9.6.2       tls uint8_t *lance_eaddr(void *);
    116  1.9.6.2       tls bool lance_init(void *);
    117  1.9.6.2       tls int lance_get(void *, void *, size_t);
    118  1.9.6.2       tls bool lance_put(void *, void *, size_t);
    119  1.9.6.2       tls bool lance_end(void *);
    120  1.9.6.2       tls int lance_intr(void);
    121  1.9.6.2       tls 
    122  1.9.6.2       tls /* locore.S */
    123  1.9.6.2       tls extern int dipsw1, dipsw2;
    124  1.9.6.2       tls extern int cputype;
    125  1.9.6.2       tls extern volatile uint32_t tick;
    126  1.9.6.2       tls int setjmp(label_t *);
    127  1.9.6.2       tls int splhigh(void);
    128  1.9.6.2       tls void splx(int);
    129  1.9.6.2       tls int getsfc(void);
    130  1.9.6.2       tls int getdfc(void);
    131  1.9.6.2       tls int spl0(void);
    132  1.9.6.2       tls int spl1(void);
    133  1.9.6.2       tls int spl2(void);
    134  1.9.6.2       tls int spl3(void);
    135  1.9.6.2       tls int spl4(void);
    136  1.9.6.2       tls int spl5(void);
    137  1.9.6.2       tls int spl6(void);
    138  1.9.6.2       tls 
    139  1.9.6.2       tls /* ls.c */
    140  1.9.6.2       tls int cmd_ls(int, char **);
    141  1.9.6.2       tls 
    142  1.9.6.2       tls /* machdep.c */
    143  1.9.6.2       tls void straytrap(int);
    144  1.9.6.2       tls int badaddr(volatile void *);
    145  1.9.6.2       tls void regdump(int *, int);
    146  1.9.6.2       tls char *hexstr(int, int);
    147  1.9.6.2       tls 
    148  1.9.6.2       tls /* prf.c */
    149  1.9.6.2       tls int tgetchar(void);
    150  1.9.6.2       tls 
    151  1.9.6.2       tls /* parse.c */
    152  1.9.6.2       tls int check_args(int, char **);
    153  1.9.6.2       tls int exit_program(int, char **);
    154  1.9.6.2       tls int parse(int, char **);
    155  1.9.6.2       tls int getargs(char *, char **, int);
    156  1.9.6.2       tls 
    157  1.9.6.2       tls /* romcons.c */
    158  1.9.6.2       tls void romcnprobe(struct consdev *);
    159  1.9.6.2       tls void romcninit(struct consdev *);
    160  1.9.6.2       tls int  romcngetc(dev_t);
    161  1.9.6.2       tls void romcnputc(dev_t, int);
    162  1.9.6.2       tls 
    163  1.9.6.2       tls /* sc.c */
    164  1.9.6.4       tls int scinit(int, void *);
    165  1.9.6.4       tls struct scsi_inquiry;
    166  1.9.6.4       tls bool scident(uint, uint, uint, struct scsi_inquiry *, uint32_t *);
    167  1.9.6.4       tls struct scsi_generic_cdb;
    168  1.9.6.5  jdolecek int scsi_immed_command(int, int, int, struct scsi_generic_cdb *, uint8_t *,
    169  1.9.6.2       tls     unsigned int);
    170  1.9.6.5  jdolecek int scsi_request_sense(int, int, int, uint8_t *, unsigned int);
    171  1.9.6.2       tls int scsi_test_unit_rdy(int, int, int);
    172  1.9.6.2       tls int scsi_format_unit(int, int, int);
    173  1.9.6.2       tls int scintr(void);
    174  1.9.6.2       tls 
    175  1.9.6.2       tls /* scsi.c */
    176  1.9.6.2       tls int scsi(int, char **);
    177  1.9.6.5  jdolecek int scsi_read_raw(u_int, u_int, u_int, uint8_t *, u_int);
    178  1.9.6.5  jdolecek int scsi_read(u_int, uint8_t *, u_int);
    179  1.9.6.5  jdolecek int scsi_write(u_int, uint8_t *, u_int);
    180  1.9.6.2       tls 
    181  1.9.6.2       tls /* screen.c */
    182  1.9.6.2       tls int screen(int, char **);
    183  1.9.6.2       tls 
    184  1.9.6.2       tls /* scsi.c */
    185  1.9.6.2       tls int scsi(int, char **);
    186  1.9.6.2       tls 
    187  1.9.6.2       tls /* sd.c */
    188  1.9.6.2       tls int sdstrategy(void *, int, daddr_t, size_t, void *, size_t *);
    189  1.9.6.2       tls int sdopen(struct open_file *, ...);
    190  1.9.6.2       tls int sdclose(struct open_file *);
    191  1.9.6.2       tls 
    192  1.9.6.2       tls /* sio.c */
    193  1.9.6.2       tls void _siointr(void);
    194  1.9.6.2       tls void siocnprobe(struct consdev *);
    195  1.9.6.2       tls void siocninit(struct consdev *);
    196  1.9.6.2       tls int  siocngetc(dev_t);
    197  1.9.6.2       tls void siocnputc(dev_t, int);
    198  1.9.6.2       tls void sioinit(void);
    199  1.9.6.2       tls 
    200  1.9.6.2       tls /* tape.c */
    201  1.9.6.2       tls int tape(int, char **);
    202  1.9.6.2       tls 
    203  1.9.6.2       tls /* trap.c */
    204  1.9.6.2       tls void trap(int, unsigned int, unsigned int, struct frame);
    205  1.9.6.2       tls 
    206  1.9.6.2       tls /* ufs_disklabel.c */
    207  1.9.6.2       tls char *readdisklabel(int, int, struct disklabel *);
    208  1.9.6.2       tls 
    209  1.9.6.2       tls 
    210  1.9.6.4       tls /* use following device unit number strategy to make parser easier */
    211  1.9.6.4       tls #define	UNIT(ctlr, target)	((ctlr) * 10 + (target))
    212  1.9.6.4       tls #define	CTLR(unit)		((unit) / 10)
    213  1.9.6.4       tls #define	TARGET(unit)		((unit) % 10)
    214  1.9.6.4       tls 
    215  1.9.6.2       tls #define DELAY(n)							\
    216  1.9.6.2       tls do {									\
    217  1.9.6.2       tls 	register int __N = cpuspeed * (n);				\
    218  1.9.6.2       tls 	do {								\
    219  1.9.6.2       tls 		__asm("subql #1, %0" : "=r" (__N) : "0" (__N));		\
    220  1.9.6.2       tls 	} while (__N > 0);						\
    221  1.9.6.2       tls } while (/* CONSTCOND */ 0)
    222  1.9.6.2       tls 
    223  1.9.6.2       tls extern	struct fs_ops file_system_disk[];
    224  1.9.6.2       tls extern	int nfsys_disk;
    225  1.9.6.2       tls extern	struct fs_ops file_system_nfs[];
    226  1.9.6.2       tls 
    227  1.9.6.2       tls extern	const char bootprog_name[], bootprog_rev[], bootprog_kernrev[];
    228