Home | History | Annotate | Line # | Download | only in include
autoconf.h revision 1.8.2.2
      1  1.8.2.2     skrll /*	$NetBSD: autoconf.h,v 1.8.2.2 2005/11/10 13:55:09 skrll Exp $	*/
      2      1.6      soda /*	$OpenBSD: autoconf.h,v 1.2 1997/03/12 19:16:54 pefo Exp $	*/
      3      1.6      soda /*	NetBSD: autoconf.h,v 1.1 1995/02/13 23:07:31 cgd Exp 	*/
      4      1.1  jonathan 
      5      1.1  jonathan /*
      6      1.1  jonathan  * Copyright (c) 1994, 1995 Carnegie-Mellon University.
      7      1.1  jonathan  * All rights reserved.
      8      1.1  jonathan  *
      9      1.1  jonathan  * Author: Chris G. Demetriou
     10      1.1  jonathan  *
     11      1.1  jonathan  * Permission to use, copy, modify and distribute this software and
     12      1.1  jonathan  * its documentation is hereby granted, provided that both the copyright
     13      1.1  jonathan  * notice and this permission notice appear in all copies of the
     14      1.1  jonathan  * software, derivative works or modified versions, and any portions
     15      1.1  jonathan  * thereof, and that both notices appear in supporting documentation.
     16      1.1  jonathan  *
     17      1.1  jonathan  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
     18      1.1  jonathan  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
     19      1.1  jonathan  * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
     20      1.1  jonathan  *
     21      1.1  jonathan  * Carnegie Mellon requests users of this software to return to
     22      1.1  jonathan  *
     23      1.1  jonathan  *  Software Distribution Coordinator  or  Software.Distribution (at) CS.CMU.EDU
     24      1.1  jonathan  *  School of Computer Science
     25      1.1  jonathan  *  Carnegie Mellon University
     26      1.1  jonathan  *  Pittsburgh PA 15213-3890
     27      1.1  jonathan  *
     28      1.1  jonathan  * any improvements or extensions that they make and grant Carnegie the
     29      1.1  jonathan  * rights to redistribute these changes.
     30      1.1  jonathan  */
     31      1.1  jonathan 
     32      1.1  jonathan /*
     33      1.8    simonb  * Machine-dependent structures for autoconfiguration
     34      1.1  jonathan  */
     35      1.1  jonathan 
     36      1.6      soda #ifndef _ARC_AUTOCONF_H_
     37      1.6      soda #define _ARC_AUTOCONF_H_
     38      1.6      soda 
     39      1.1  jonathan struct confargs;
     40      1.1  jonathan 
     41  1.8.2.1     skrll typedef int (*intr_handler_t)(void *);
     42      1.1  jonathan 
     43      1.1  jonathan struct abus {
     44      1.1  jonathan 	struct	device *ab_dv;		/* back-pointer to device */
     45      1.1  jonathan 	int	ab_type;		/* bus type (see below) */
     46      1.1  jonathan 	void	(*ab_intr_establish)	/* bus's set-handler function */
     47  1.8.2.1     skrll 		   (struct confargs *, intr_handler_t, void *);
     48      1.1  jonathan 	void	(*ab_intr_disestablish)	/* bus's unset-handler function */
     49  1.8.2.1     skrll 		   (struct confargs *);
     50      1.1  jonathan 	caddr_t	(*ab_cvtaddr)		/* convert slot/offset to address */
     51  1.8.2.1     skrll 		   (struct confargs *);
     52      1.1  jonathan 	int	(*ab_matchname)		/* see if name matches driver */
     53  1.8.2.1     skrll 		   (struct confargs *, char *);
     54      1.1  jonathan };
     55      1.1  jonathan 
     56      1.1  jonathan #define	BUS_MAIN	1		/* mainbus */
     57      1.1  jonathan #define	BUS_PICA	2		/* PICA Bus */
     58      1.6      soda #define	BUS_ISABR	3		/* ISA Bridge Bus */
     59      1.1  jonathan 
     60      1.1  jonathan #define	BUS_INTR_ESTABLISH(ca, handler, val)				\
     61      1.1  jonathan 	    (*(ca)->ca_bus->ab_intr_establish)((ca), (handler), (val))
     62      1.1  jonathan #define	BUS_INTR_DISESTABLISH(ca)					\
     63      1.1  jonathan 	    (*(ca)->ca_bus->ab_intr_establish)(ca)
     64      1.1  jonathan #define	BUS_CVTADDR(ca)							\
     65      1.1  jonathan 	    (*(ca)->ca_bus->ab_cvtaddr)(ca)
     66      1.1  jonathan #define	BUS_MATCHNAME(ca, name)						\
     67      1.1  jonathan 	    (*(ca)->ca_bus->ab_matchname)((ca), (name))
     68      1.1  jonathan 
     69      1.1  jonathan struct confargs {
     70  1.8.2.2     skrll 	const char *ca_name;		/* Device name. */
     71      1.1  jonathan 	int	ca_slot;		/* Device slot. */
     72      1.1  jonathan 	int	ca_offset;		/* Offset into slot. */
     73      1.1  jonathan 	struct	abus *ca_bus;		/* bus device resides on. */
     74      1.1  jonathan };
     75      1.1  jonathan 
     76  1.8.2.2     skrll void	makebootdev(const char *cp);
     77      1.2  jonathan 
     78      1.7      soda /* serial console related variables */
     79      1.7      soda extern int com_freq;
     80      1.7      soda extern int com_console;
     81      1.7      soda extern int com_console_address;
     82      1.7      soda extern int com_console_speed;
     83      1.7      soda extern int com_console_mode;
     84      1.6      soda #endif /* _ARC_AUTOCONF_H_ */
     85