diff options
author | Tom Rini <trini@konsulko.com> | 2022-01-12 20:49:39 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2022-01-12 20:49:39 -0500 |
commit | a02af84e03e018d7cd08bb3070cbe5517004712b (patch) | |
tree | aeea10cced79093b8cb35974c410d1c2604e69ba /arch/x86/cpu/pci.c | |
parent | f0c91296015a5976a7b4a6c01892a404c18ced83 (diff) | |
parent | 2a67bf65dd6c362487f416878348398d1842ae6b (diff) |
Merge branch '2022-01-12-pci-updates'
- PCI code clean up and bug fixes from Pali
Diffstat (limited to 'arch/x86/cpu/pci.c')
-rw-r--r-- | arch/x86/cpu/pci.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/cpu/pci.c b/arch/x86/cpu/pci.c index d4f9290ca73..8a992ed8233 100644 --- a/arch/x86/cpu/pci.c +++ b/arch/x86/cpu/pci.c @@ -20,7 +20,7 @@ int pci_x86_read_config(pci_dev_t bdf, uint offset, ulong *valuep, enum pci_size_t size) { - outl(bdf | (offset & 0xfc) | PCI_CFG_EN, PCI_REG_ADDR); + outl(PCI_CONF1_ADDRESS(PCI_BUS(bdf), PCI_DEV(bdf), PCI_FUNC(bdf), offset), PCI_REG_ADDR); switch (size) { case PCI_SIZE_8: *valuep = inb(PCI_REG_DATA + (offset & 3)); @@ -39,7 +39,7 @@ int pci_x86_read_config(pci_dev_t bdf, uint offset, ulong *valuep, int pci_x86_write_config(pci_dev_t bdf, uint offset, ulong value, enum pci_size_t size) { - outl(bdf | (offset & 0xfc) | PCI_CFG_EN, PCI_REG_ADDR); + outl(PCI_CONF1_ADDRESS(PCI_BUS(bdf), PCI_DEV(bdf), PCI_FUNC(bdf), offset), PCI_REG_ADDR); switch (size) { case PCI_SIZE_8: outb(value, PCI_REG_DATA + (offset & 3)); |