x86: Add generic driver structure and associated initialization code

This patch adds a generic device driver structure with a field for
referencing an MMIO range.  It also provides a structure
initialization procedure that initializes the MMIO range field with
the value read from the PCI BAR0 register for a device.
This commit is contained in:
Michael LeMay 2015-07-03 05:03:12 -07:00 committed by Jesus Sanchez-Palencia
parent 2dccb55e15
commit c5f9cefac7
2 changed files with 25 additions and 0 deletions

View file

@ -58,4 +58,13 @@ typedef union pci_config_addr {
uint32_t pci_config_read(pci_config_addr_t addr);
/**
* PCI device driver instance with a single MMIO range.
*/
typedef struct pci_driver {
uintptr_t mmio; /**< MMIO range base address */
} pci_driver_t;
void pci_init_bar0(pci_driver_t *c_this, pci_config_addr_t pci_addr);
#endif /* CPU_X86_DRIVERS_LEGACY_PC_PCI_H_ */