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