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