10 IrqAUX = 12, /* PS/2 port */
11 IrqIRQ13 = 13, /* coprocessor on 386 */
17 MaxVectorPIC = VectorPIC+MaxIrqPIC,
21 Vctl* next; /* handlers on this vector */
23 char name[KNAMELEN]; /* of driver */
24 int isintr; /* interrupt or fault/trap */
27 int (*isr)(int); /* get isr bit for this irq */
28 int (*eoi)(int); /* eoi */
30 void (*f)(Ureg*, void*); /* handler to call */
31 void* a; /* argument to call it with */
35 BusCBUS = 0, /* Corollary CBUS */
36 BusCBUSII, /* Corollary CBUS II */
37 BusEISA, /* Extended ISA */
38 BusFUTURE, /* IEEE Futurebus */
39 BusINTERN, /* Internal bus */
40 BusISA, /* Industry Standard Architecture */
41 BusMBI, /* Multibus I */
42 BusMBII, /* Multibus II */
43 BusMCA, /* Micro Channel Architecture */
46 BusNUBUS, /* Apple Macintosh NuBus */
47 BusPCI, /* Peripheral Component Interconnect */
48 BusPCMCIA, /* PC Memory Card International Association */
49 BusTC, /* DEC TurboChannel */
50 BusVL, /* VESA Local bus */
52 BusXPRESS, /* Express System Bus */
55 #define MKBUS(t,b,d,f) (((t)<<24)|(((b)&0xFF)<<16)|(((d)&0x1F)<<11)|(((f)&0x07)<<8))
56 #define BUSFNO(tbdf) (((tbdf)>>8)&0x07)
57 #define BUSDNO(tbdf) (((tbdf)>>11)&0x1F)
58 #define BUSBNO(tbdf) (((tbdf)>>16)&0xFF)
59 #define BUSTYPE(tbdf) ((tbdf)>>24)
60 #define BUSDF(tbdf) ((tbdf)&0x000FF00)
61 #define BUSBDF(tbdf) ((tbdf)&0x0FFFF00)
62 #define BUSUNKNOWN (-1)
72 enum { /* type 0 and type 1 pre-defined header */
73 PciVID = 0x00, /* vendor ID */
74 PciDID = 0x02, /* device ID */
75 PciPCR = 0x04, /* command */
76 PciPSR = 0x06, /* status */
77 PciRID = 0x08, /* revision ID */
78 PciCCRp = 0x09, /* programming interface class code */
79 PciCCRu = 0x0A, /* sub-class code */
80 PciCCRb = 0x0B, /* base class code */
81 PciCLS = 0x0C, /* cache line size */
82 PciLTR = 0x0D, /* latency timer */
83 PciHDT = 0x0E, /* header type */
84 PciBST = 0x0F, /* BIST */
86 PciBAR0 = 0x10, /* base address */
89 PciINTL = 0x3C, /* interrupt line */
90 PciINTP = 0x3D, /* interrupt pin */
93 enum { /* type 0 pre-defined header */
94 PciCIS = 0x28, /* cardbus CIS pointer */
95 PciSVID = 0x2C, /* subsystem vendor ID */
96 PciSID = 0x2E, /* subsystem ID */
97 PciEBAR0 = 0x30, /* expansion ROM base address */
98 PciMGNT = 0x3E, /* burst period length */
99 PciMLT = 0x3F, /* maximum latency between bursts */
102 enum { /* type 1 pre-defined header */
103 PciPBN = 0x18, /* primary bus number */
104 PciSBN = 0x19, /* secondary bus number */
105 PciUBN = 0x1A, /* subordinate bus number */
106 PciSLTR = 0x1B, /* secondary latency timer */
107 PciIBR = 0x1C, /* I/O base */
108 PciILR = 0x1D, /* I/O limit */
109 PciSPSR = 0x1E, /* secondary status */
110 PciMBR = 0x20, /* memory base */
111 PciMLR = 0x22, /* memory limit */
112 PciPMBR = 0x24, /* prefetchable memory base */
113 PciPMLR = 0x26, /* prefetchable memory limit */
114 PciPUBR = 0x28, /* prefetchable base upper 32 bits */
115 PciPULR = 0x2C, /* prefetchable limit upper 32 bits */
116 PciIUBR = 0x30, /* I/O base upper 16 bits */
117 PciIULR = 0x32, /* I/O limit upper 16 bits */
118 PciEBAR1 = 0x28, /* expansion ROM base address */
119 PciBCR = 0x3E, /* bridge control register */
122 enum { /* type 2 pre-defined header */
125 PciCBPBN = 0x18, /* primary bus number */
126 PciCBSBN = 0x19, /* secondary bus number */
127 PciCBUBN = 0x1A, /* subordinate bus number */
128 PciCBSLTR = 0x1B, /* secondary latency timer */
133 PciCBIBR0 = 0x2C, /* I/O base */
134 PciCBILR0 = 0x30, /* I/O limit */
135 PciCBIBR1 = 0x34, /* I/O base */
136 PciCBILR1 = 0x38, /* I/O limit */
137 PciCBSVID = 0x40, /* subsystem vendor ID */
138 PciCBSID = 0x42, /* subsystem ID */
139 PciCBLMBAR = 0x44, /* legacy mode base address */
142 typedef struct Pcisiz Pcisiz;
150 typedef struct Pcidev Pcidev;
151 typedef struct Pcidev {
152 int tbdf; /* type+bus+device+function */
153 ushort vid; /* vendor ID */
154 ushort did; /* device ID */
162 ulong bar; /* base address */
166 uchar intl; /* interrupt line */
169 Pcidev* link; /* next device on this bno */
171 Pcidev* bridge; /* down a bus */
179 #define PCIWINDOW 0x80000000
180 #define PCIWADDR(va) (PADDR(va)+PCIWINDOW)