uint8_tparity_error:1;// Device detected parity error. Parity error may not be handled.
}pci_status_t;
typedefstruct__attribute__((packed)){
uint16_tvendor_id;// 16 bit Vendor ID allocated by PCI-SIG. 0xFFFF is invalid.
uint16_tdevice_id;// 16 bit Device ID allocated by the vendor.
pci_command_tcommand;// 16 bit PCI_COMMAND register.
pci_status_tstatus;// 16 bit PCI_STATUS register.
uint8_trevision_id;// 8 bit register, revision identifier specified by vendor.
uint8_tprogIF;// 8 bit register, identifies any programming interface the device may have.
uint8_tsubclass;// 8 bit Subclass code; identifies the specific function of the device
uint8_tclass_code;// 8 bit Class Code; identifies the function of the device
uint8_tcache_line_size;// 8 bit; specifies system cache line size in 32-bit blocks. Devices can limit this. Unsupported values are treated as 0.
uint8_tlatency_timer;// 8 bit; specifies latency timer in (bus clock) units.
uint8_theader_type;// 8 bit; identifies the layout of the header and the type of device; 00 = device, 01 = pci-pci bridge, 11 = CardBus bridge. Multi-function defined by bit 7.
uint8_tbist;// 8 bit; status and control of a device's built-in self-test (BIST)
}pci_header_common_t;
typedefstruct__attribute__((packed)){
// pci_header_common_t first, then..
uint32_tbar[6];// 6 x 32 bit Base Address Registers (BARs)
uint32_tcis_pointer;// Points to Card Information Structure for PCI devices that share silicon with CardBus
uint16_tsubsystem_vendor_id;
uint16_tsubsystem_id;
uint32_texpansion_bar;// Points to the base of an Expansion ROM.
uint8_tcapabilities;// The pointer generated by pci_status#capabilities_list
uint8_t_reserved[3];// 24 bit reserved at top end of register.
uint32_t_reserved2;
uint8_tinterrupt_line;// Specifies the PIC pin that INTx# is connected to. Can be 0-15 because x86 PICs have 16 IRQs. 0xFF is no connection.
uint8_tinterrupt;// Specifies the interrupt pin the device uses. 0x1 is INTA#, 0x2 is INTB#, 0x3 is INTC#, 0x4 is INTD#, 0x0 is no interrupt.
uint8_tmin_grant;// Specifies the length of the burst period, in quarter-microsecond units
uint8_tmax_latency;// Specifies how often the device accesses the PCI bus - in quarter-microseconds