pci_machdep.h revision 1.2.4.2 1 1.2.4.2 rmind /* $OpenBSD: pci_machdep.h,v 1.1 2003/09/29 19:23:02 mickey Exp $ */
2 1.2.4.2 rmind
3 1.2.4.2 rmind /*
4 1.2.4.2 rmind * Copyright (c) 2003 Michael Shalayeff
5 1.2.4.2 rmind * All rights reserved.
6 1.2.4.2 rmind *
7 1.2.4.2 rmind * Redistribution and use in source and binary forms, with or without
8 1.2.4.2 rmind * modification, are permitted provided that the following conditions
9 1.2.4.2 rmind * are met:
10 1.2.4.2 rmind * 1. Redistributions of source code must retain the above copyright
11 1.2.4.2 rmind * notice, this list of conditions and the following disclaimer.
12 1.2.4.2 rmind * 2. Redistributions in binary form must reproduce the above copyright
13 1.2.4.2 rmind * notice, this list of conditions and the following disclaimer in the
14 1.2.4.2 rmind * documentation and/or other materials provided with the distribution.
15 1.2.4.2 rmind *
16 1.2.4.2 rmind * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 1.2.4.2 rmind * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 1.2.4.2 rmind * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 1.2.4.2 rmind * IN NO EVENT SHALL THE AUTHOR OR HIS RELATIVES BE LIABLE FOR ANY DIRECT,
20 1.2.4.2 rmind * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 1.2.4.2 rmind * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 1.2.4.2 rmind * SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 1.2.4.2 rmind * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
24 1.2.4.2 rmind * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
25 1.2.4.2 rmind * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
26 1.2.4.2 rmind * THE POSSIBILITY OF SUCH DAMAGE.
27 1.2.4.2 rmind */
28 1.2.4.2 rmind
29 1.2.4.2 rmind #ifndef _MACHINE_PCI_MACHDEP_H_
30 1.2.4.2 rmind #define _MACHINE_PCI_MACHDEP_H_
31 1.2.4.2 rmind
32 1.2.4.2 rmind /*
33 1.2.4.2 rmind * Types provided to machine-independent PCI code
34 1.2.4.2 rmind */
35 1.2.4.2 rmind typedef struct hppa_pci_chipset_tag *pci_chipset_tag_t;
36 1.2.4.2 rmind typedef u_long pcitag_t;
37 1.2.4.2 rmind typedef u_long pci_intr_handle_t;
38 1.2.4.2 rmind
39 1.2.4.2 rmind struct pci_attach_args;
40 1.2.4.2 rmind
41 1.2.4.2 rmind struct hppa_pci_chipset_tag {
42 1.2.4.2 rmind void *_cookie;
43 1.2.4.2 rmind void (*pc_attach_hook)(device_t,
44 1.2.4.2 rmind device_t, struct pcibus_attach_args *);
45 1.2.4.2 rmind int (*pc_bus_maxdevs)(void *, int);
46 1.2.4.2 rmind pcitag_t (*pc_make_tag)(void *, int, int, int);
47 1.2.4.2 rmind void (*pc_decompose_tag)(void *, pcitag_t, int *,
48 1.2.4.2 rmind int *, int *);
49 1.2.4.2 rmind pcireg_t (*pc_conf_read)(void *, pcitag_t, int);
50 1.2.4.2 rmind void (*pc_conf_write)(void *, pcitag_t, int, pcireg_t);
51 1.2.4.2 rmind
52 1.2.4.2 rmind int (*pc_intr_map)(const struct pci_attach_args *,
53 1.2.4.2 rmind pci_intr_handle_t *);
54 1.2.4.2 rmind const char *(*pc_intr_string)(void *, pci_intr_handle_t,
55 1.2.4.2 rmind char *, size_t);
56 1.2.4.2 rmind void *(*pc_intr_establish)(void *, pci_intr_handle_t,
57 1.2.4.2 rmind int, int (*)(void *), void *);
58 1.2.4.2 rmind void (*pc_intr_disestablish)(void *, void *);
59 1.2.4.2 rmind
60 1.2.4.2 rmind void *(*pc_alloc_parent)(device_t,
61 1.2.4.2 rmind struct pci_attach_args *, int);
62 1.2.4.2 rmind };
63 1.2.4.2 rmind
64 1.2.4.2 rmind /*
65 1.2.4.2 rmind * Functions provided to machine-independent PCI code.
66 1.2.4.2 rmind */
67 1.2.4.2 rmind #define pci_attach_hook(p, s, pba) \
68 1.2.4.2 rmind (*(pba)->pba_pc->pc_attach_hook)((p), (s), (pba))
69 1.2.4.2 rmind #define pci_bus_maxdevs(c, b) \
70 1.2.4.2 rmind (*(c)->pc_bus_maxdevs)((c)->_cookie, (b))
71 1.2.4.2 rmind #define pci_make_tag(c, b, d, f) \
72 1.2.4.2 rmind (*(c)->pc_make_tag)((c)->_cookie, (b), (d), (f))
73 1.2.4.2 rmind #define pci_decompose_tag(c, t, bp, dp, fp) \
74 1.2.4.2 rmind (*(c)->pc_decompose_tag)((c)->_cookie, (t), (bp), (dp), (fp))
75 1.2.4.2 rmind #define pci_conf_read(c, t, r) \
76 1.2.4.2 rmind (*(c)->pc_conf_read)((c)->_cookie, (t), (r))
77 1.2.4.2 rmind #define pci_conf_write(c, t, r, v) \
78 1.2.4.2 rmind (*(c)->pc_conf_write)((c)->_cookie, (t), (r), (v))
79 1.2.4.2 rmind #define pci_intr_map(p, ihp) \
80 1.2.4.2 rmind (*(p)->pa_pc->pc_intr_map)((p), (ihp))
81 1.2.4.2 rmind #define pci_intr_line(ih) (ih)
82 1.2.4.2 rmind #define pci_intr_string(c, ih, buf, len) \
83 1.2.4.2 rmind (*(c)->pc_intr_string)((c)->_cookie, (ih), (buf), (len))
84 1.2.4.2 rmind #define pci_intr_establish(c, ih, l, h, a) \
85 1.2.4.2 rmind (*(c)->pc_intr_establish)((c)->_cookie, (ih), (l), (h), (a))
86 1.2.4.2 rmind #define pci_intr_disestablish(c, iv) \
87 1.2.4.2 rmind (*(c)->pc_intr_disestablish)((c)->_cookie, (iv))
88 1.2.4.2 rmind
89 1.2.4.2 rmind #define pciide_machdep_compat_intr_establish(a, b, c, d, e) (NULL)
90 1.2.4.2 rmind #define pciide_machdep_compat_intr_disestablish(a, b) ((void)(a), (void)(b))
91 1.2.4.2 rmind
92 1.2.4.2 rmind #define pci_intr_evcnt(a, b) (NULL)
93 1.2.4.2 rmind
94 1.2.4.2 rmind #endif /* _MACHINE_PCI_MACHDEP_H_ */
95