Home | History | Annotate | Line # | Download | only in include
pci_machdep.h revision 1.1.94.1
      1  1.1.94.1  jruoho /*	$NetBSD: pci_machdep.h,v 1.1.94.1 2011/06/06 09:05:55 jruoho Exp $	*/
      2       1.1     uwe 
      3       1.1     uwe /*
      4       1.1     uwe  * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
      5       1.1     uwe  * Copyright (c) 1994 Charles M. Hannum.  All rights reserved.
      6       1.1     uwe  *
      7       1.1     uwe  * Redistribution and use in source and binary forms, with or without
      8       1.1     uwe  * modification, are permitted provided that the following conditions
      9       1.1     uwe  * are met:
     10       1.1     uwe  * 1. Redistributions of source code must retain the above copyright
     11       1.1     uwe  *    notice, this list of conditions and the following disclaimer.
     12       1.1     uwe  * 2. Redistributions in binary form must reproduce the above copyright
     13       1.1     uwe  *    notice, this list of conditions and the following disclaimer in the
     14       1.1     uwe  *    documentation and/or other materials provided with the distribution.
     15       1.1     uwe  * 3. All advertising materials mentioning features or use of this software
     16       1.1     uwe  *    must display the following acknowledgement:
     17       1.1     uwe  *	This product includes software developed by Charles M. Hannum.
     18       1.1     uwe  * 4. The name of the author may not be used to endorse or promote products
     19       1.1     uwe  *    derived from this software without specific prior written permission.
     20       1.1     uwe  *
     21       1.1     uwe  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     22       1.1     uwe  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     23       1.1     uwe  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     24       1.1     uwe  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     25       1.1     uwe  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     26       1.1     uwe  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     27       1.1     uwe  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     28       1.1     uwe  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     29       1.1     uwe  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     30       1.1     uwe  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     31       1.1     uwe  */
     32       1.1     uwe 
     33       1.1     uwe #ifndef _LANDISK_PCI_MACHDEP_H
     34       1.1     uwe #define _LANDISK_PCI_MACHDEP_H
     35       1.1     uwe 
     36       1.1     uwe /*
     37       1.1     uwe  * Machine-specific definitions for PCI autoconfiguration.
     38       1.1     uwe  */
     39       1.1     uwe #define	__HAVE_PCI_CONF_HOOK
     40       1.1     uwe 
     41       1.1     uwe /*
     42       1.1     uwe  * Types provided to machine-independent PCI code
     43       1.1     uwe  */
     44       1.1     uwe typedef void *pci_chipset_tag_t;
     45       1.1     uwe typedef int pcitag_t;
     46       1.1     uwe typedef int pci_intr_handle_t;
     47       1.1     uwe 
     48       1.1     uwe #include <sh3/dev/shpcicvar.h>
     49       1.1     uwe 
     50       1.1     uwe /*
     51       1.1     uwe  * Forward declarations.
     52       1.1     uwe  */
     53       1.1     uwe struct pci_attach_args;
     54       1.1     uwe 
     55       1.1     uwe /*
     56       1.1     uwe  * Functions provided to machine-independent PCI code.
     57       1.1     uwe  */
     58       1.1     uwe void landisk_pci_attach_hook(struct device *, struct device *,
     59       1.1     uwe     struct pcibus_attach_args *);
     60  1.1.94.1  jruoho int landisk_pci_intr_map(const struct pci_attach_args *, pci_intr_handle_t *);
     61       1.1     uwe const char *landisk_pci_intr_string(pci_chipset_tag_t, pci_intr_handle_t);
     62       1.1     uwe const struct evcnt *landisk_pci_intr_evcnt(pci_chipset_tag_t,pci_intr_handle_t);
     63       1.1     uwe void *landisk_pci_intr_establish(pci_chipset_tag_t, pci_intr_handle_t, int,
     64       1.1     uwe     int (*)(void *), void *);
     65       1.1     uwe void landisk_pci_intr_disestablish(pci_chipset_tag_t, void *);
     66       1.1     uwe void landisk_pci_conf_interrupt(void *v, int bus, int dev, int pin,
     67       1.1     uwe     int swiz, int *iline);
     68       1.1     uwe int landisk_pci_conf_hook(void *, int, int, int, pcireg_t);
     69       1.1     uwe 
     70       1.1     uwe #define	pci_bus_maxdevs(v, busno) \
     71       1.1     uwe 	shpcic_bus_maxdevs(v, busno)
     72       1.1     uwe #define	pci_make_tag(v, bus, dev, func) \
     73       1.1     uwe 	shpcic_make_tag(v, bus, dev, func)
     74       1.1     uwe #define	pci_decompose_tag(v, tag, bp, dp, fp) \
     75       1.1     uwe 	shpcic_decompose_tag(v, tag, bp, dp, fp)
     76       1.1     uwe #define	pci_conf_read(v, tag, reg) \
     77       1.1     uwe 	shpcic_conf_read(v, tag, reg)
     78       1.1     uwe #define	pci_conf_write(v, tag, reg, data) \
     79       1.1     uwe 	shpcic_conf_write(v, tag, reg, data)
     80       1.1     uwe 
     81       1.1     uwe #define	pci_attach_hook(pa, self, pba) \
     82       1.1     uwe 	landisk_pci_attach_hook(pa, self, pba)
     83       1.1     uwe #define	pci_intr_map(pa, ihp) \
     84       1.1     uwe 	landisk_pci_intr_map(pa, ihp)
     85       1.1     uwe #define	pci_intr_string(v, ih) \
     86       1.1     uwe 	landisk_pci_intr_string(v, ih)
     87       1.1     uwe #define	pci_intr_evcnt(v, ih) \
     88       1.1     uwe 	landisk_pci_intr_evcnt(v, ih)
     89       1.1     uwe #define	pci_intr_establish(v, ih, level, ih_fun, ih_arg) \
     90       1.1     uwe 	landisk_pci_intr_establish(v, ih, level, ih_fun, ih_arg)
     91       1.1     uwe #define	pci_intr_disestablish(v, cookie) \
     92       1.1     uwe 	landisk_pci_intr_disestablish(v, cookie)
     93       1.1     uwe #define	pci_conf_interrupt(v, bus, dev, pin, swiz, iline) \
     94       1.1     uwe 	landisk_pci_conf_interrupt(v, bus, dev, pin, swiz, iline)
     95       1.1     uwe #define	pci_conf_hook(v, bus, dev, func, id) \
     96       1.1     uwe 	landisk_pci_conf_hook(v, bus, dev, func, id)
     97       1.1     uwe 
     98       1.1     uwe #ifdef _KERNEL
     99       1.1     uwe /*
    100       1.1     uwe  * ALL OF THE FOLLOWING ARE MACHINE-DEPENDENT, AND SHOULD NOT BE USED
    101       1.1     uwe  * BY PORTABLE CODE.
    102       1.1     uwe  */
    103       1.1     uwe #endif
    104       1.1     uwe 
    105       1.1     uwe #endif /* _LANDISK_PCI_MACHDEP_H */
    106