Home | History | Annotate | Line # | Download | only in include
autoconf.h revision 1.8
      1  1.8  thorpej /* $NetBSD: autoconf.h,v 1.8 1997/07/25 00:03:47 thorpej Exp $ */
      2  1.1      cgd 
      3  1.1      cgd /*
      4  1.4      cgd  * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
      5  1.1      cgd  * All rights reserved.
      6  1.1      cgd  *
      7  1.1      cgd  * Author: Chris G. Demetriou
      8  1.1      cgd  *
      9  1.1      cgd  * Permission to use, copy, modify and distribute this software and
     10  1.1      cgd  * its documentation is hereby granted, provided that both the copyright
     11  1.1      cgd  * notice and this permission notice appear in all copies of the
     12  1.1      cgd  * software, derivative works or modified versions, and any portions
     13  1.1      cgd  * thereof, and that both notices appear in supporting documentation.
     14  1.1      cgd  *
     15  1.1      cgd  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
     16  1.1      cgd  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
     17  1.1      cgd  * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
     18  1.1      cgd  *
     19  1.1      cgd  * Carnegie Mellon requests users of this software to return to
     20  1.1      cgd  *
     21  1.1      cgd  *  Software Distribution Coordinator  or  Software.Distribution (at) CS.CMU.EDU
     22  1.1      cgd  *  School of Computer Science
     23  1.1      cgd  *  Carnegie Mellon University
     24  1.1      cgd  *  Pittsburgh PA 15213-3890
     25  1.1      cgd  *
     26  1.1      cgd  * any improvements or extensions that they make and grant Carnegie the
     27  1.1      cgd  * rights to redistribute these changes.
     28  1.1      cgd  */
     29  1.1      cgd 
     30  1.1      cgd /*
     31  1.1      cgd  * Machine-dependent structures of autoconfiguration
     32  1.1      cgd  */
     33  1.1      cgd 
     34  1.1      cgd struct confargs;
     35  1.1      cgd 
     36  1.1      cgd typedef int (*intr_handler_t) __P((void *));
     37  1.1      cgd 
     38  1.1      cgd struct abus {
     39  1.1      cgd 	struct	device *ab_dv;		/* back-pointer to device */
     40  1.1      cgd 	int	ab_type;		/* bus type (see below) */
     41  1.1      cgd 	void	(*ab_intr_establish)	/* bus's set-handler function */
     42  1.1      cgd 		    __P((struct confargs *, intr_handler_t, void *));
     43  1.1      cgd 	void	(*ab_intr_disestablish)	/* bus's unset-handler function */
     44  1.1      cgd 		    __P((struct confargs *));
     45  1.1      cgd 	caddr_t	(*ab_cvtaddr)		/* convert slot/offset to address */
     46  1.1      cgd 		    __P((struct confargs *));
     47  1.1      cgd 	int	(*ab_matchname)		/* see if name matches driver */
     48  1.1      cgd 		    __P((struct confargs *, char *));
     49  1.1      cgd };
     50  1.1      cgd 
     51  1.1      cgd #define	BUS_MAIN	1		/* mainbus */
     52  1.1      cgd #define	BUS_TC		2		/* TurboChannel */
     53  1.1      cgd #define	BUS_ASIC	3		/* IOCTL ASIC; under TurboChannel */
     54  1.1      cgd #define	BUS_TCDS	4		/* TCDS ASIC; under TurboChannel */
     55  1.1      cgd 
     56  1.1      cgd #define	BUS_INTR_ESTABLISH(ca, handler, val)				\
     57  1.1      cgd 	    (*(ca)->ca_bus->ab_intr_establish)((ca), (handler), (val))
     58  1.1      cgd #define	BUS_INTR_DISESTABLISH(ca)					\
     59  1.1      cgd 	    (*(ca)->ca_bus->ab_intr_establish)(ca)
     60  1.1      cgd #define	BUS_CVTADDR(ca)							\
     61  1.1      cgd 	    (*(ca)->ca_bus->ab_cvtaddr)(ca)
     62  1.1      cgd #define	BUS_MATCHNAME(ca, name)						\
     63  1.1      cgd 	    (*(ca)->ca_bus->ab_matchname)((ca), (name))
     64  1.1      cgd 
     65  1.1      cgd struct confargs {
     66  1.1      cgd 	char	*ca_name;		/* Device name. */
     67  1.1      cgd 	int	ca_slot;		/* Device slot. */
     68  1.1      cgd 	int	ca_offset;		/* Offset into slot. */
     69  1.1      cgd 	struct	abus *ca_bus;		/* bus device resides on. */
     70  1.1      cgd };
     71  1.1      cgd 
     72  1.3      cgd struct bootdev_data {
     73  1.3      cgd 	char	*protocol;
     74  1.3      cgd 	int	bus;
     75  1.3      cgd 	int	slot;
     76  1.3      cgd 	int	channel;
     77  1.3      cgd 	char	*remote_address;
     78  1.3      cgd 	int	unit;
     79  1.3      cgd 	int	boot_dev_type;
     80  1.3      cgd 	char	*ctrl_dev_type;
     81  1.3      cgd };
     82  1.3      cgd 
     83  1.8  thorpej /*
     84  1.8  thorpej  * The boot program passes a pointer to a bootinfo to the kernel
     85  1.8  thorpej  * using the following convention:
     86  1.8  thorpej  *
     87  1.8  thorpej  *	a0 contains first free page frame number
     88  1.8  thorpej  *	a1 contains page number of current level 1 page table
     89  1.8  thorpej  *	if a2 contains BOOTINFO_MAGIC
     90  1.8  thorpej  *		a3 contains address of bootinfo
     91  1.8  thorpej  */
     92  1.8  thorpej 
     93  1.8  thorpej #define	BOOTINFO_MAGIC		0xdeadbeeffeedface
     94  1.8  thorpej 
     95  1.8  thorpej struct bootinfo_v1 {
     96  1.8  thorpej 	u_long	ssym;		/* start of kernel symbol table */
     97  1.8  thorpej 	u_long	esym;		/* end of kernel symbol table */
     98  1.8  thorpej 	char	boot_flags[64];	/* boot flags */
     99  1.8  thorpej 	char	booted_kernel[64]; /* name of booted kernel */
    100  1.8  thorpej };
    101  1.8  thorpej 
    102  1.8  thorpej struct bootinfo {
    103  1.8  thorpej 	u_int	version;		/* version number */
    104  1.8  thorpej 	union {
    105  1.8  thorpej 		struct bootinfo_v1 v1;	/* version 1 boot info */
    106  1.8  thorpej 		char pad[256];		/* reserve space for future use */
    107  1.8  thorpej 	} un;
    108  1.8  thorpej };
    109  1.2      cgd 
    110  1.2      cgd #ifdef EVCNT_COUNTERS
    111  1.2      cgd extern struct evcnt clock_intr_evcnt;
    112  1.2      cgd #endif
    113  1.3      cgd 
    114  1.3      cgd extern struct device *booted_device;
    115  1.3      cgd extern int booted_partition;
    116  1.3      cgd extern struct bootdev_data *bootdev_data;
    117