pci_machdep.h revision 1.1.4.2 1 1.1.4.2 minoura /* $NetBSD: pci_machdep.h,v 1.1.4.2 2000/06/22 16:59:14 minoura Exp $ */
2 1.1.4.2 minoura /* NetBSD: pci_machdep.h,v 1.3 1999/03/19 03:40:46 cgd Exp */
3 1.1.4.2 minoura
4 1.1.4.2 minoura /*
5 1.1.4.2 minoura * Copyright (c) 1996 Carnegie-Mellon University.
6 1.1.4.2 minoura * All rights reserved.
7 1.1.4.2 minoura *
8 1.1.4.2 minoura * Author: Chris G. Demetriou
9 1.1.4.2 minoura *
10 1.1.4.2 minoura * Permission to use, copy, modify and distribute this software and
11 1.1.4.2 minoura * its documentation is hereby granted, provided that both the copyright
12 1.1.4.2 minoura * notice and this permission notice appear in all copies of the
13 1.1.4.2 minoura * software, derivative works or modified versions, and any portions
14 1.1.4.2 minoura * thereof, and that both notices appear in supporting documentation.
15 1.1.4.2 minoura *
16 1.1.4.2 minoura * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
17 1.1.4.2 minoura * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
18 1.1.4.2 minoura * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
19 1.1.4.2 minoura *
20 1.1.4.2 minoura * Carnegie Mellon requests users of this software to return to
21 1.1.4.2 minoura *
22 1.1.4.2 minoura * Software Distribution Coordinator or Software.Distribution (at) CS.CMU.EDU
23 1.1.4.2 minoura * School of Computer Science
24 1.1.4.2 minoura * Carnegie Mellon University
25 1.1.4.2 minoura * Pittsburgh PA 15213-3890
26 1.1.4.2 minoura *
27 1.1.4.2 minoura * any improvements or extensions that they make and grant Carnegie the
28 1.1.4.2 minoura * rights to redistribute these changes.
29 1.1.4.2 minoura */
30 1.1.4.2 minoura
31 1.1.4.2 minoura /*
32 1.1.4.2 minoura * Machine-specific definitions for PCI autoconfiguration.
33 1.1.4.2 minoura */
34 1.1.4.2 minoura
35 1.1.4.2 minoura /*
36 1.1.4.2 minoura * Types provided to machine-independent PCI code
37 1.1.4.2 minoura */
38 1.1.4.2 minoura typedef struct arc_pci_chipset *pci_chipset_tag_t;
39 1.1.4.2 minoura typedef u_long pcitag_t;
40 1.1.4.2 minoura typedef u_long pci_intr_handle_t;
41 1.1.4.2 minoura
42 1.1.4.2 minoura /*
43 1.1.4.2 minoura * arc-specific PCI structure and type definitions.
44 1.1.4.2 minoura * NOT TO BE USED DIRECTLY BY MACHINE INDEPENDENT CODE.
45 1.1.4.2 minoura */
46 1.1.4.2 minoura struct arc_pci_chipset {
47 1.1.4.2 minoura void (*pc_attach_hook) __P((struct device *,
48 1.1.4.2 minoura struct device *, struct pcibus_attach_args *));
49 1.1.4.2 minoura int (*pc_bus_maxdevs) __P((pci_chipset_tag_t, int));
50 1.1.4.2 minoura pcitag_t (*pc_make_tag) __P((pci_chipset_tag_t, int, int, int));
51 1.1.4.2 minoura pcireg_t (*pc_conf_read) __P((pci_chipset_tag_t, pcitag_t,
52 1.1.4.2 minoura int));
53 1.1.4.2 minoura void (*pc_conf_write) __P((pci_chipset_tag_t, pcitag_t, int,
54 1.1.4.2 minoura pcireg_t));
55 1.1.4.2 minoura int (*pc_intr_map) __P((pci_chipset_tag_t, pcitag_t, int,
56 1.1.4.2 minoura int, pci_intr_handle_t *));
57 1.1.4.2 minoura const char *(*pc_intr_string) __P((pci_chipset_tag_t,
58 1.1.4.2 minoura pci_intr_handle_t));
59 1.1.4.2 minoura void *(*pc_intr_establish) __P((pci_chipset_tag_t,
60 1.1.4.2 minoura pci_intr_handle_t, int, int (*)(void *), void *));
61 1.1.4.2 minoura void (*pc_intr_disestablish) __P((pci_chipset_tag_t,
62 1.1.4.2 minoura void *));
63 1.1.4.2 minoura };
64 1.1.4.2 minoura
65 1.1.4.2 minoura /*
66 1.1.4.2 minoura * Functions provided to machine-independent PCI code.
67 1.1.4.2 minoura */
68 1.1.4.2 minoura #define pci_attach_hook(p, s, pba) \
69 1.1.4.2 minoura (*(pba)->pba_pc->pc_attach_hook)((p), (s), (pba))
70 1.1.4.2 minoura #define pci_bus_maxdevs(c, b) \
71 1.1.4.2 minoura (*(c)->pc_bus_maxdevs)((c), (b))
72 1.1.4.2 minoura #define pci_make_tag(c, b, d, f) \
73 1.1.4.2 minoura (*(c)->pc_make_tag)((c), (b), (d), (f))
74 1.1.4.2 minoura #define pci_conf_read(c, t, r) \
75 1.1.4.2 minoura (*(c)->pc_conf_read)((c), (t), (r))
76 1.1.4.2 minoura #define pci_conf_write(c, t, r, v) \
77 1.1.4.2 minoura (*(c)->pc_conf_write)((c), (t), (r), (v))
78 1.1.4.2 minoura #define pci_intr_map(c, it, ip, il, ihp) \
79 1.1.4.2 minoura (*(c)->pc_intr_map)((c), (it), (ip), (il), (ihp))
80 1.1.4.2 minoura #define pci_intr_string(c, ih) \
81 1.1.4.2 minoura (*(c)->pc_intr_string)((c), (ih))
82 1.1.4.2 minoura #define pci_intr_establish(c, ih, l, h, a) \
83 1.1.4.2 minoura (*(c)->pc_intr_establish)((c), (ih), (l), (h), (a))
84 1.1.4.2 minoura #define pci_intr_disestablish(c, iv) \
85 1.1.4.2 minoura (*(c)->pc_intr_disestablish)((c), (iv))
86