4 #include "devices/resource.h"
5 #include "lib/kernel/list.h"
7 #define PCI_BAD_DEVICE 0xffff
9 /* PCI-to-PCI bridge related numbers */
10 #define PCI_BRIDGE_BASE_CLASS 0x06
11 #define PCI_BRIDGE_SUB_CLASS 0x04
12 #define PCI_BRIDGE_REG_SBUS 0x19
13 #define PCI_BRIDGE_HEADER_TYPE 0x01
15 /* Locations of registers in the configuration space */
16 #define PCI_REG_CLASS_INTERFACE 0x09
17 #define PCI_REG_CLASS_SUB 0x0a
18 #define PCI_REG_CLASS_BASE 0x0b
19 #define PCI_REG_HEADER_TYPE 0x0e
20 #define PCI_INTERRUPT_MASK_PIN 0xff00
21 #define PCI_INTERRUPT_MASK_LINE 0xff
22 #define PCI_REGNUM_INTERRUPT 15
23 #define PCI_REGNUM_BASE_ADDRESS 4
25 /* Base address related numbers */
26 #define PCI_NUM_BARS 6
27 #define PCI_BAR_TYPE_MASK 0x1
28 #define PCI_BAR_TYPE_MEM 0x0
29 #define PCI_BAR_TYPE_IO 0x1
30 #define PCI_BAR_MASK_MEM 0xfffffff0
31 #define PCI_BAR_MASK_IO 0xfffffffc
35 struct list_elem elem;
37 /* <Bus, Device, Function> logically identify a unique PCI device */
41 /* Vendor and Device ID */
51 struct resource resources[PCI_NUM_BARS];
60 #endif /* devices/pci.h */