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