autoconf.h revision 1.6 1 1.6 soda /* $NetBSD: autoconf.h,v 1.6 2000/01/23 21:01:55 soda 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.1 jonathan * Machine-dependent structures of 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.1 jonathan typedef int (*intr_handler_t) __P((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.1 jonathan __P((struct confargs *, intr_handler_t, void *));
48 1.1 jonathan void (*ab_intr_disestablish) /* bus's unset-handler function */
49 1.1 jonathan __P((struct confargs *));
50 1.1 jonathan caddr_t (*ab_cvtaddr) /* convert slot/offset to address */
51 1.1 jonathan __P((struct confargs *));
52 1.1 jonathan int (*ab_matchname) /* see if name matches driver */
53 1.1 jonathan __P((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.6 soda #define BUS_ALGOR 4 /* Algorithmics local bus */
60 1.6 soda #define BUS_PCIBR 5 /* Algorithmics PCI bridge */
61 1.1 jonathan
62 1.1 jonathan #define BUS_INTR_ESTABLISH(ca, handler, val) \
63 1.1 jonathan (*(ca)->ca_bus->ab_intr_establish)((ca), (handler), (val))
64 1.1 jonathan #define BUS_INTR_DISESTABLISH(ca) \
65 1.1 jonathan (*(ca)->ca_bus->ab_intr_establish)(ca)
66 1.1 jonathan #define BUS_CVTADDR(ca) \
67 1.1 jonathan (*(ca)->ca_bus->ab_cvtaddr)(ca)
68 1.1 jonathan #define BUS_MATCHNAME(ca, name) \
69 1.1 jonathan (*(ca)->ca_bus->ab_matchname)((ca), (name))
70 1.1 jonathan
71 1.1 jonathan struct confargs {
72 1.1 jonathan char *ca_name; /* Device name. */
73 1.1 jonathan int ca_slot; /* Device slot. */
74 1.1 jonathan int ca_offset; /* Offset into slot. */
75 1.1 jonathan struct abus *ca_bus; /* bus device resides on. */
76 1.1 jonathan };
77 1.1 jonathan
78 1.1 jonathan void set_clockintr __P((void (*)(struct clockframe *)));
79 1.1 jonathan void set_iointr __P((void (*)(void *, int)));
80 1.2 jonathan
81 1.6 soda void initcpu __P((void));
82 1.3 jonathan void makebootdev __P((char *cp));
83 1.6 soda #endif /* _ARC_AUTOCONF_H_ */
84