x86: Add support for PCI BAR1
This patch adds support for PCI BAR1 and also changes the pci_init(), instead of having one function for each `bar` we now set the `bar` to pci_config_addr_t parameter before calling the pci_init() function..
This commit is contained in:
parent
6dc27579bc
commit
60f6edef80
4 changed files with 7 additions and 10 deletions
|
@ -234,12 +234,9 @@ pci_pirq_set_irq(PIRQ pirq, uint8_t irq, uint8_t route_to_legacy)
|
|||
* \param meta Base address of optional driver-defined metadata.
|
||||
*/
|
||||
void
|
||||
pci_init_bar0(pci_driver_t *c_this,
|
||||
pci_config_addr_t pci_addr,
|
||||
uintptr_t meta)
|
||||
pci_init(pci_driver_t *c_this, pci_config_addr_t pci_addr, uintptr_t meta)
|
||||
{
|
||||
pci_addr.reg_off = PCI_CONFIG_REG_BAR0;
|
||||
/* The BAR0 value is masked to clear non-address bits. */
|
||||
/* The reg_off (BAR) value is masked to clear non-address bits. */
|
||||
c_this->mmio = pci_config_read(pci_addr) & ~0xFFF;
|
||||
c_this->meta = meta;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue