From: Dirk Vogt Date: Tue, 3 Aug 2010 10:03:40 +0000 (+0000) Subject: Some PCI config space registers have to be accessed in with there actual X-Git-Tag: v3.1.8~114 X-Git-Url: http://zhaoyanbai.com/repos/?a=commitdiff_plain;h=45231634111ad68640ecd6a5e886401010590d9c;p=minix.git Some PCI config space registers have to be accessed in with there actual width. Without this patch DDELinux is not able to read the PCI BARs correctly. --- diff --git a/drivers/pci/pci_intel.h b/drivers/pci/pci_intel.h index 6aef15a34..63801c9f7 100644 --- a/drivers/pci/pci_intel.h +++ b/drivers/pci/pci_intel.h @@ -28,21 +28,21 @@ Created: Jan 2000 by Philip Homburg (pci_outl(PCII_CONFADD, PCII_SELREG_(bus, dev, func, reg)), \ pci_inb(PCII_CONFDATA+((reg)&3))) #define PCII_RREG16_(bus, dev, func, reg) \ - (PCII_RREG8_(bus, dev, func, reg) | \ - (PCII_RREG8_(bus, dev, func, reg+1) << 8)) + (pci_outl(PCII_CONFADD, PCII_SELREG_(bus, dev, func, reg)), \ + pci_inw(PCII_CONFDATA+((reg)&2))) #define PCII_RREG32_(bus, dev, func, reg) \ - (PCII_RREG16_(bus, dev, func, reg) | \ - (PCII_RREG16_(bus, dev, func, reg+2) << 16)) + (pci_outl(PCII_CONFADD, PCII_SELREG_(bus, dev, func, reg)), \ + pci_inl(PCII_CONFDATA)) #define PCII_WREG8_(bus, dev, func, reg, val) \ (pci_outl(PCII_CONFADD, PCII_SELREG_(bus, dev, func, reg)), \ pci_outb(PCII_CONFDATA+((reg)&3), (val))) #define PCII_WREG16_(bus, dev, func, reg, val) \ - (PCII_WREG8_(bus, dev, func, reg, (val)), \ - (PCII_WREG8_(bus, dev, func, reg+1, (val) >> 8))) + (pci_outl(PCII_CONFADD, PCII_SELREG_(bus, dev, func, reg)), \ + pci_outw(PCII_CONFDATA+((reg)&2), (val))) #define PCII_WREG32_(bus, dev, func, reg, val) \ - (PCII_WREG16_(bus, dev, func, reg, (val)), \ - (PCII_WREG16_(bus, dev, func, reg+2, (val) >> 16))) + (pci_outl(PCII_CONFADD, PCII_SELREG_(bus, dev, func, reg)), \ + pci_outl(PCII_CONFDATA, (val))) /* PIIX configuration registers */ #define PIIX_PIRQRCA 0x60