pci_machdep.h revision 1.8.8.2 1 1.8.8.2 nathanw /* $NetBSD: pci_machdep.h,v 1.8.8.2 2002/06/20 03:38:19 nathanw Exp $ */
2 1.8.8.2 nathanw
3 1.8.8.2 nathanw /*
4 1.8.8.2 nathanw * Copyright (c) 1996 Leo Weppelman. All rights reserved.
5 1.8.8.2 nathanw * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved.
6 1.8.8.2 nathanw * Copyright (c) 1994 Charles M. Hannum. All rights reserved.
7 1.8.8.2 nathanw *
8 1.8.8.2 nathanw * Redistribution and use in source and binary forms, with or without
9 1.8.8.2 nathanw * modification, are permitted provided that the following conditions
10 1.8.8.2 nathanw * are met:
11 1.8.8.2 nathanw * 1. Redistributions of source code must retain the above copyright
12 1.8.8.2 nathanw * notice, this list of conditions and the following disclaimer.
13 1.8.8.2 nathanw * 2. Redistributions in binary form must reproduce the above copyright
14 1.8.8.2 nathanw * notice, this list of conditions and the following disclaimer in the
15 1.8.8.2 nathanw * documentation and/or other materials provided with the distribution.
16 1.8.8.2 nathanw * 3. All advertising materials mentioning features or use of this software
17 1.8.8.2 nathanw * must display the following acknowledgement:
18 1.8.8.2 nathanw * This product includes software developed by Charles M. Hannum.
19 1.8.8.2 nathanw * 4. The name of the author may not be used to endorse or promote products
20 1.8.8.2 nathanw * derived from this software without specific prior written permission.
21 1.8.8.2 nathanw *
22 1.8.8.2 nathanw * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
23 1.8.8.2 nathanw * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
24 1.8.8.2 nathanw * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
25 1.8.8.2 nathanw * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
26 1.8.8.2 nathanw * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
27 1.8.8.2 nathanw * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 1.8.8.2 nathanw * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 1.8.8.2 nathanw * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 1.8.8.2 nathanw * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31 1.8.8.2 nathanw * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 1.8.8.2 nathanw */
33 1.8.8.2 nathanw
34 1.8.8.2 nathanw #ifndef _ATARI_PCI_MACHDEP_H_
35 1.8.8.2 nathanw #define _ATARI_PCI_MACHDEP_H_
36 1.8.8.2 nathanw
37 1.8.8.2 nathanw #include <atari/atari/intr.h>
38 1.8.8.2 nathanw
39 1.8.8.2 nathanw /*
40 1.8.8.2 nathanw * Machine-specific definitions for PCI autoconfiguration.
41 1.8.8.2 nathanw */
42 1.8.8.2 nathanw #define __HAVE_PCIIDE_MACHDEP_COMPAT_INTR_ESTABLISH
43 1.8.8.2 nathanw
44 1.8.8.2 nathanw /*
45 1.8.8.2 nathanw * Forward declarations.
46 1.8.8.2 nathanw */
47 1.8.8.2 nathanw struct pci_attach_args;
48 1.8.8.2 nathanw
49 1.8.8.2 nathanw /*
50 1.8.8.2 nathanw * Types provided to machine-independent PCI code
51 1.8.8.2 nathanw */
52 1.8.8.2 nathanw typedef void *pci_chipset_tag_t;
53 1.8.8.2 nathanw
54 1.8.8.2 nathanw typedef u_long pcitag_t;
55 1.8.8.2 nathanw typedef int pci_intr_handle_t;
56 1.8.8.2 nathanw
57 1.8.8.2 nathanw typedef struct {
58 1.8.8.2 nathanw int ipl; /* ipl requested */
59 1.8.8.2 nathanw int imask; /* bitmask for MFP-register */
60 1.8.8.2 nathanw int (*ifunc)(void *); /* function to call */
61 1.8.8.2 nathanw void *iarg; /* argument for 'ifunc' */
62 1.8.8.2 nathanw struct intrhand *ihand; /* save this for disestablishing */
63 1.8.8.2 nathanw } pci_intr_info_t;
64 1.8.8.2 nathanw
65 1.8.8.2 nathanw /*
66 1.8.8.2 nathanw * Functions provided to machine-independent PCI code.
67 1.8.8.2 nathanw */
68 1.8.8.2 nathanw void pci_attach_hook(struct device *, struct device *,
69 1.8.8.2 nathanw struct pcibus_attach_args *);
70 1.8.8.2 nathanw int pci_bus_maxdevs(pci_chipset_tag_t, int);
71 1.8.8.2 nathanw pcitag_t pci_make_tag(pci_chipset_tag_t, int, int, int);
72 1.8.8.2 nathanw void pci_decompose_tag(pci_chipset_tag_t, pcitag_t, int *, int *,
73 1.8.8.2 nathanw int *);
74 1.8.8.2 nathanw pcireg_t pci_conf_read(pci_chipset_tag_t, pcitag_t, int);
75 1.8.8.2 nathanw void pci_conf_write(pci_chipset_tag_t, pcitag_t, int, pcireg_t);
76 1.8.8.2 nathanw int pci_intr_map(struct pci_attach_args *, pci_intr_handle_t *);
77 1.8.8.2 nathanw const char *pci_intr_string(pci_chipset_tag_t, pci_intr_handle_t);
78 1.8.8.2 nathanw const struct evcnt *pci_intr_evcnt(pci_chipset_tag_t, pci_intr_handle_t);
79 1.8.8.2 nathanw void *pci_intr_establish(pci_chipset_tag_t, pci_intr_handle_t,
80 1.8.8.2 nathanw int, int (*)(void *), void *);
81 1.8.8.2 nathanw void pci_intr_disestablish(pci_chipset_tag_t, void *);
82 1.8.8.2 nathanw
83 1.8.8.2 nathanw #define pci_enumerate_bus(sc, m, p) \
84 1.8.8.2 nathanw pci_enumerate_bus_generic((sc), (m), (p))
85 1.8.8.2 nathanw
86 1.8.8.2 nathanw #endif /* _ATARI_PCI_MACHDEP_H_ */
87