home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / lxapi32.zip / PCI / pci-i386.h < prev    next >
C/C++ Source or Header  |  2002-04-26  |  2KB  |  81 lines

  1. /* $Id: pci-i386.h,v 1.2 2002/04/26 23:09:34 smilcke Exp $ */
  2.  
  3. /*
  4.  *    Low-Level PCI Access for i386 machines.
  5.  *
  6.  *    (c) 1999 Martin Mares <mj@ucw.cz>
  7.  */
  8.  
  9. #undef DEBUG
  10.  
  11. #ifdef TARGET_OS2
  12. static __inline__ void DBG(x,...){}
  13. #define __attribute__(x)
  14. #else
  15. #ifdef DEBUG
  16. #define DBG(x...) printk(x)
  17. #else
  18. #define DBG(x...)
  19. #endif
  20. #endif
  21.  
  22. #define PCI_PROBE_BIOS        0x0001
  23. #define PCI_PROBE_CONF1        0x0002
  24. #define PCI_PROBE_CONF2        0x0004
  25. #define PCI_NO_SORT        0x0100
  26. #define PCI_BIOS_SORT        0x0200
  27. #define PCI_NO_CHECKS        0x0400
  28. #define PCI_ASSIGN_ROMS        0x1000
  29. #define PCI_BIOS_IRQ_SCAN    0x2000
  30. #define PCI_ASSIGN_ALL_BUSSES    0x4000
  31.  
  32. extern unsigned int pci_probe;
  33.  
  34. /* pci-i386.c */
  35.  
  36. extern unsigned int pcibios_max_latency;
  37.  
  38. void pcibios_resource_survey(void);
  39. int pcibios_enable_resources(struct pci_dev *);
  40.  
  41. /* pci-pc.c */
  42.  
  43. extern int pcibios_last_bus;
  44. extern struct pci_bus *pci_root_bus;
  45. extern struct pci_ops *pci_root_ops;
  46.  
  47. /* pci-irq.c */
  48.  
  49. struct irq_info {
  50.     u8 bus, devfn;            /* Bus, device and function */
  51.     struct {
  52.         u8 link;        /* IRQ line ID, chipset dependent, 0=not routed */
  53.         u16 bitmap;        /* Available IRQs */
  54.     } __attribute__((packed)) irq[4];
  55.     u8 slot;            /* Slot number, 0=onboard */
  56.     u8 rfu;
  57. } __attribute__((packed));
  58.  
  59. struct irq_routing_table {
  60.     u32 signature;            /* PIRQ_SIGNATURE should be here */
  61.     u16 version;            /* PIRQ_VERSION */
  62.     u16 size;            /* Table size in bytes */
  63.     u8 rtr_bus, rtr_devfn;        /* Where the interrupt router lies */
  64.     u16 exclusive_irqs;        /* IRQs devoted exclusively to PCI usage */
  65.     u16 rtr_vendor, rtr_device;    /* Vendor and device ID of interrupt router */
  66.     u32 miniport_data;        /* Crap */
  67.     u8 rfu[11];
  68.     u8 checksum;            /* Modulo 256 checksum must give zero */
  69. #ifdef TARGET_OS2
  70.    struct irq_info *slots;
  71. #else
  72.     struct irq_info slots[0];
  73. #endif
  74. } __attribute__((packed));
  75.  
  76. extern unsigned int pcibios_irq_mask;
  77.  
  78. void pcibios_irq_init(void);
  79. void pcibios_fixup_irqs(void);
  80. void pcibios_enable_irq(struct pci_dev *dev);
  81.