autoconf.h revision 1.1 1 1.1 jonathan /* $NetBSD: autoconf.h,v 1.1 1995/08/04 00:34:15 jonathan Exp $ */
2 1.1 jonathan
3 1.1 jonathan /*
4 1.1 jonathan * Copyright (c) 1994, 1995 Carnegie-Mellon University.
5 1.1 jonathan * All rights reserved.
6 1.1 jonathan *
7 1.1 jonathan * Author: Chris G. Demetriou
8 1.1 jonathan *
9 1.1 jonathan * Permission to use, copy, modify and distribute this software and
10 1.1 jonathan * its documentation is hereby granted, provided that both the copyright
11 1.1 jonathan * notice and this permission notice appear in all copies of the
12 1.1 jonathan * software, derivative works or modified versions, and any portions
13 1.1 jonathan * thereof, and that both notices appear in supporting documentation.
14 1.1 jonathan *
15 1.1 jonathan * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
16 1.1 jonathan * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
17 1.1 jonathan * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
18 1.1 jonathan *
19 1.1 jonathan * Carnegie Mellon requests users of this software to return to
20 1.1 jonathan *
21 1.1 jonathan * Software Distribution Coordinator or Software.Distribution (at) CS.CMU.EDU
22 1.1 jonathan * School of Computer Science
23 1.1 jonathan * Carnegie Mellon University
24 1.1 jonathan * Pittsburgh PA 15213-3890
25 1.1 jonathan *
26 1.1 jonathan * any improvements or extensions that they make and grant Carnegie the
27 1.1 jonathan * rights to redistribute these changes.
28 1.1 jonathan */
29 1.1 jonathan
30 1.1 jonathan /*
31 1.1 jonathan * Machine-dependent structures of autoconfiguration
32 1.1 jonathan */
33 1.1 jonathan
34 1.1 jonathan struct confargs;
35 1.1 jonathan
36 1.1 jonathan /* Handle device interrupt for given unit of a driver */
37 1.1 jonathan
38 1.1 jonathan typedef int handler_arg_t;
39 1.1 jonathan typedef int (*intr_handler_t) __P((handler_arg_t));
40 1.1 jonathan
41 1.1 jonathan struct abus {
42 1.1 jonathan struct device *ab_dv; /* back-pointer to device */
43 1.1 jonathan int ab_type; /* bus type (see below) */
44 1.1 jonathan void (*ab_intr_establish) /* bus's set-handler function */
45 1.1 jonathan __P((struct confargs *, intr_handler_t, handler_arg_t));
46 1.1 jonathan void (*ab_intr_disestablish) /* bus's unset-handler function */
47 1.1 jonathan __P((struct confargs *));
48 1.1 jonathan caddr_t (*ab_cvtaddr) /* convert slot/offset to address */
49 1.1 jonathan __P((struct confargs *));
50 1.1 jonathan int (*ab_matchname) /* see if name matches driver */
51 1.1 jonathan __P((struct confargs *, char *));
52 1.1 jonathan };
53 1.1 jonathan
54 1.1 jonathan #define BUS_MAIN 1 /* mainbus */
55 1.1 jonathan #define BUS_TC 2 /* TurboChannel */
56 1.1 jonathan #define BUS_ASIC 3 /* IOCTL ASIC; under TurboChannel */
57 1.1 jonathan #define BUS_TCDS 4 /* TCDS ASIC; under TurboChannel */
58 1.1 jonathan
59 1.1 jonathan #define KN02_ASIC_NAME "KN02 " /* very special */
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 (table entry). */
73 1.1 jonathan int ca_slotpri; /* Device interrupt "priority" */
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 #ifndef pmax
79 1.1 jonathan void set_clockintr __P((void (*)(struct clockframe *)));
80 1.1 jonathan #endif
81 1.1 jonathan void set_iointr __P((void (*)(void *, int)));
82 1.1 jonathan int badaddr __P((void *, u_int));
83