Annotation of sys/arch/sgi/pci/pci_machdep.h, Revision 1.1
1.1 ! nbrk 1: /* $OpenBSD: pci_machdep.h,v 1.3 2007/05/20 14:22:35 miod Exp $ */
! 2:
! 3: /*
! 4: * Copyright (c) 2003-2004 Opsycon AB (www.opsycon.se / www.opsycon.com)
! 5: *
! 6: * Redistribution and use in source and binary forms, with or without
! 7: * modification, are permitted provided that the following conditions
! 8: * are met:
! 9: * 1. Redistributions of source code must retain the above copyright
! 10: * notice, this list of conditions and the following disclaimer.
! 11: * 2. Redistributions in binary form must reproduce the above copyright
! 12: * notice, this list of conditions and the following disclaimer in the
! 13: * documentation and/or other materials provided with the distribution.
! 14: *
! 15: * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
! 16: * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
! 17: * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
! 18: * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
! 19: * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
! 20: * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
! 21: * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
! 22: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
! 23: * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
! 24: * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
! 25: * SUCH DAMAGE.
! 26: *
! 27: */
! 28: typedef struct mips_pci_chipset *pci_chipset_tag_t;
! 29: typedef u_long pcitag_t;
! 30: typedef u_long pci_intr_handle_t;
! 31:
! 32: struct pci_attach_args;
! 33:
! 34: /*
! 35: * mips-specific PCI structure and type definitions.
! 36: * NOT TO BE USED DIRECTLY BY MACHINE INDEPENDENT CODE.
! 37: */
! 38: struct mips_pci_chipset {
! 39: void *pc_conf_v;
! 40: void (*pc_attach_hook)(struct device *,
! 41: struct device *, struct pcibus_attach_args *);
! 42: int (*pc_bus_maxdevs)(void *, int);
! 43: pcitag_t (*pc_make_tag)(void *, int, int, int);
! 44: void (*pc_decompose_tag)(void *, pcitag_t, int *,
! 45: int *, int *);
! 46: pcireg_t (*pc_conf_read)(void *, pcitag_t, int);
! 47: void (*pc_conf_write)(void *, pcitag_t, int, pcireg_t);
! 48:
! 49: void *pc_intr_v;
! 50: int (*pc_intr_map)(struct pci_attach_args *, pci_intr_handle_t *);
! 51: const char *(*pc_intr_string)(void *, pci_intr_handle_t);
! 52: void *(*pc_intr_establish)(void *, pci_intr_handle_t,
! 53: int, int (*)(void *), void *, char *);
! 54: void (*pc_intr_disestablish)(void *, void *);
! 55: int (*pc_ether_hw_addr)(u_int8_t *, u_int8_t, u_int8_t);
! 56: int (*pc_scsi_clock)(u_int8_t, u_int8_t);
! 57: void (*pc_sync_cache)(vaddr_t, int, int);
! 58: };
! 59:
! 60: /*
! 61: * Functions provided to machine-independent PCI code.
! 62: */
! 63: #define pci_attach_hook(p, s, pba) \
! 64: (*(pba)->pba_pc->pc_attach_hook)((p), (s), (pba))
! 65: #define pci_bus_maxdevs(c, b) \
! 66: (*(c)->pc_bus_maxdevs)((c)->pc_conf_v, (b))
! 67: #define pci_make_tag(c, b, d, f) \
! 68: (*(c)->pc_make_tag)((c)->pc_conf_v, (b), (d), (f))
! 69: #define pci_decompose_tag(c, t, bp, dp, fp) \
! 70: (*(c)->pc_decompose_tag)((c)->pc_conf_v, (t), (bp), (dp), (fp))
! 71: #define pci_conf_read(c, t, r) \
! 72: (*(c)->pc_conf_read)((c)->pc_conf_v, (t), (r))
! 73: #define pci_conf_write(c, t, r, v) \
! 74: (*(c)->pc_conf_write)((c)->pc_conf_v, (t), (r), (v))
! 75: #define pci_intr_map(c, ihp) \
! 76: (*(c)->pa_pc->pc_intr_map)((c), (ihp))
! 77: #define pci_intr_string(c, ih) \
! 78: (*(c)->pc_intr_string)((c)->pc_intr_v, (ih))
! 79: #define pci_intr_establish(c, ih, l, h, a, nm) \
! 80: (*(c)->pc_intr_establish)((c)->pc_intr_v, (ih), (l), (h), (a), (nm))
! 81: #define pci_intr_disestablish(c, iv) \
! 82: (*(c)->pc_intr_disestablish)((c)->pc_intr_v, (iv))
! 83: #define pci_ether_hw_addr(c, p, t, s) \
! 84: (*(c)->pc_ether_hw_addr)((p), (t), (s))
! 85: #define pci_scsi_clock(c, t, s) \
! 86: (*(c)->pc_scsi_clock)((t), (s))
! 87: #define pci_sync_cache(c, p, s, d) \
! 88: (*(c)->pc_sync_cache)((p), (s), (d))
CVSweb