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_REGNUM_BASE_ADDRESS 4
22 /* Base address related numbers */
23 #define PCI_NUM_BARS 6
24 #define PCI_BAR_TYPE_MASK 0x1
25 #define PCI_BAR_TYPE_MEM 0x0
26 #define PCI_BAR_TYPE_IO 0x1
27 #define PCI_BAR_MASK_MEM 0xfffffff0
28 #define PCI_BAR_MASK_IO 0xfffffffc
32 struct list_elem elem;
34 /* <Bus, Device, Function> logically identify a unique PCI device */
38 /* Vendor and Device ID */
48 struct resource resources[PCI_NUM_BARS];
54 #endif /* devices/pci.h */