diff options
Diffstat (limited to 'hw/xfree86')
-rw-r--r-- | hw/xfree86/common/xf86pciBus.c | 4 | ||||
-rw-r--r-- | hw/xfree86/loader/xf86sym.c | 1 | ||||
-rw-r--r-- | hw/xfree86/os-support/bus/Pci.c | 10 | ||||
-rw-r--r-- | hw/xfree86/os-support/bus/axpPci.c | 13 | ||||
-rw-r--r-- | hw/xfree86/os-support/bus/linuxPci.c | 23 | ||||
-rw-r--r-- | hw/xfree86/os-support/bus/sparcPci.c | 4 | ||||
-rw-r--r-- | hw/xfree86/os-support/bus/xf86Pci.h | 3 | ||||
-rw-r--r-- | hw/xfree86/os-support/linux/lnx_axp.c | 2 | ||||
-rw-r--r-- | hw/xfree86/os-support/shared/ia64Pci.c | 2 |
9 files changed, 29 insertions, 33 deletions
diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c index 44c43fce6..1d137945f 100644 --- a/hw/xfree86/common/xf86pciBus.c +++ b/hw/xfree86/common/xf86pciBus.c @@ -1492,9 +1492,7 @@ xf86ClaimPciSlot(struct pci_device * d, DriverPtr drvp, if (active) { /* Map in this domain's I/O space */ - p->domainIO = xf86MapDomainIO(-1, VIDMEM_MMIO, - pciTag(bus, d->dev, d->func), - 0, 1); + p->domainIO = xf86MapLegacyIO(dev); } return num; diff --git a/hw/xfree86/loader/xf86sym.c b/hw/xfree86/loader/xf86sym.c index 00e9708c6..d99fb6c47 100644 --- a/hw/xfree86/loader/xf86sym.c +++ b/hw/xfree86/loader/xf86sym.c @@ -251,7 +251,6 @@ _X_HIDDEN void *xfree86LookupTab[] = { SYMFUNC(xf86MapReadSideEffects) SYMFUNC(xf86GetPciDomain) SYMFUNC(xf86MapDomainMemory) - SYMFUNC(xf86MapDomainIO) SYMFUNC(xf86ReadDomainMemory) SYMFUNC(xf86UDelay) SYMFUNC(xf86IODelay) diff --git a/hw/xfree86/os-support/bus/Pci.c b/hw/xfree86/os-support/bus/Pci.c index fcaad41c6..aa926149b 100644 --- a/hw/xfree86/os-support/bus/Pci.c +++ b/hw/xfree86/os-support/bus/Pci.c @@ -25,7 +25,7 @@ * xf86GetPciDomain() - Return domain number from a PCITAG * xf86MapDomainMemory() - Like xf86MapPciMem() but can handle * domain/host address translation - * xf86MapDomainIO() - Maps PCI I/O spaces + * xf86MapLegacyIO() - Maps PCI I/O spaces * xf86ReadDomainMemory() - Like xf86ReadPciBIOS() but can handle * domain/host address translation * @@ -497,11 +497,11 @@ xf86MapDomainMemory(int ScreenNum, int Flags, PCITAG Tag, return xf86MapVidMem(ScreenNum, Flags, Base, Size); } -_X_EXPORT IOADDRESS -xf86MapDomainIO(int ScreenNum, int Flags, PCITAG Tag, - IOADDRESS Base, unsigned long Size) +IOADDRESS +xf86MapLegacyIO(struct pci_device *dev) { - return Base; + (void) dev; + return 0; } _X_EXPORT int diff --git a/hw/xfree86/os-support/bus/axpPci.c b/hw/xfree86/os-support/bus/axpPci.c index 99c451fd5..22c5029f3 100644 --- a/hw/xfree86/os-support/bus/axpPci.c +++ b/hw/xfree86/os-support/bus/axpPci.c @@ -327,12 +327,11 @@ xf86MapDomainMemory(int ScreenNum, int Flags, PCITAG Tag, pDomain->dense_mem + Base - _bus_base(), Size); } -_X_EXPORT IOADDRESS -xf86MapDomainIO(int ScreenNum, int Flags, PCITAG Tag, - IOADDRESS Base, unsigned long Size) +IOADDRESS +xf86MapLegacyIO(struct pci_device *dev) { axpDomainPtr pDomain; - int domain = PCI_DOM_FROM_TAG(Tag); + const int domain = dev->domain; if ((domain < 0) || (domain >= pciNumDomains) || !(pDomain = xf86DomainInfo[domain])) @@ -343,7 +342,7 @@ xf86MapDomainIO(int ScreenNum, int Flags, PCITAG Tag, * base [this is ok since we also constrain sparse I/O systems to * a single domain in axpSetupDomains()] */ - if (pDomain->sparse_io) return Base; + if (pDomain->sparse_io) return 0; /* * I/O addresses on Alpha are really just different physical memory @@ -356,11 +355,11 @@ xf86MapDomainIO(int ScreenNum, int Flags, PCITAG Tag, * Map the entire I/O space (64kB) at once and only once. */ if (!pDomain->mapped_io) - pDomain->mapped_io = (IOADDRESS)xf86MapVidMem(ScreenNum, Flags, + pDomain->mapped_io = (IOADDRESS)xf86MapVidMem(-1, VIDMEM_MMIO, pDomain->dense_io - _bus_base(), 0x10000); - return pDomain->mapped_io + Base; + return pDomain->mapped_io; } _X_EXPORT int diff --git a/hw/xfree86/os-support/bus/linuxPci.c b/hw/xfree86/os-support/bus/linuxPci.c index e0b90d6ef..e7daf2112 100644 --- a/hw/xfree86/os-support/bus/linuxPci.c +++ b/hw/xfree86/os-support/bus/linuxPci.c @@ -677,33 +677,34 @@ xf86MapDomainMemory(int ScreenNum, int Flags, PCITAG Tag, * * This has no means of returning failure, so all errors are fatal */ -_X_EXPORT IOADDRESS -xf86MapDomainIO(int ScreenNum, int Flags, PCITAG Tag, - IOADDRESS Base, unsigned long Size) +IOADDRESS +xf86MapLegacyIO(struct pci_device *dev) { - int domain = xf86GetPciDomain(Tag); + const PCITAG tag = PCI_MAKE_TAG(PCI_MAKE_BUS(dev->domain, dev->bus), + dev->dev, dev->func); + const int domain = xf86GetPciDomain(tag); int fd; if ((domain <= 0) || (domain >= MAX_DOMAINS)) - FatalError("xf86MapDomainIO(): domain out of range\n"); + FatalError("xf86MapLegacyIO(): domain out of range\n"); if (DomainMmappedIO[domain]) - return (IOADDRESS)DomainMmappedIO[domain] + Base; + return (IOADDRESS)DomainMmappedIO[domain]; /* Permanently map all of I/O space */ - if ((fd = linuxOpenLegacy(Tag, "legacy_io")) < 0) { - DomainMmappedIO[domain] = linuxMapPci(ScreenNum, Flags, Tag, - 0, linuxGetIOSize(Tag), + if ((fd = linuxOpenLegacy(tag, "legacy_io")) < 0) { + DomainMmappedIO[domain] = linuxMapPci(-1, VIDMEM_MMIO, tag, + 0, linuxGetIOSize(tag), PCIIOC_MMAP_IS_IO); /* ia64 can't mmap legacy IO port space */ if (!DomainMmappedIO[domain]) - return Base; + return 0; } else { /* legacy_io file exists, encode fd */ DomainMmappedIO[domain] = (pointer)(fd << 24); } - return (IOADDRESS)DomainMmappedIO[domain] + Base; + return (IOADDRESS)DomainMmappedIO[domain]; } /* diff --git a/hw/xfree86/os-support/bus/sparcPci.c b/hw/xfree86/os-support/bus/sparcPci.c index 5e0ef5b18..ad3978b79 100644 --- a/hw/xfree86/os-support/bus/sparcPci.c +++ b/hw/xfree86/os-support/bus/sparcPci.c @@ -623,7 +623,7 @@ xf86MapDomainMemory(int ScreenNum, int Flags, PCITAG Tag, } _X_EXPORT IOADDRESS -xf86MapDomainIO(int ScreenNum, int Flags, PCITAG Tag, +xf86MapLegacyIO(int ScreenNum, int Flags, PCITAG Tag, IOADDRESS Base, unsigned long Size) { sparcDomainPtr pDomain; @@ -633,7 +633,7 @@ xf86MapDomainIO(int ScreenNum, int Flags, PCITAG Tag, !(pDomain = xf86DomainInfo[domain]) || (((unsigned long long)Base + (unsigned long long)Size) > pDomain->io_size)) - FatalError("xf86MapDomainIO() called with invalid parameters.\n"); + FatalError("xf86MapLegacyIO() called with invalid parameters.\n"); /* Permanently map all of I/O space */ if (!pDomain->io) { diff --git a/hw/xfree86/os-support/bus/xf86Pci.h b/hw/xfree86/os-support/bus/xf86Pci.h index a79d5f58e..21d6e6bb1 100644 --- a/hw/xfree86/os-support/bus/xf86Pci.h +++ b/hw/xfree86/os-support/bus/xf86Pci.h @@ -767,8 +767,7 @@ extern int pciNumBuses; int xf86GetPciDomain(PCITAG tag); pointer xf86MapDomainMemory(int ScreenNum, int Flags, PCITAG Tag, ADDRESS Base, unsigned long Size); -IOADDRESS xf86MapDomainIO(int ScreenNum, int Flags, PCITAG Tag, - IOADDRESS Base, unsigned long Size); +IOADDRESS xf86MapLegacyIO(struct pci_device *dev); int xf86ReadDomainMemory(PCITAG Tag, ADDRESS Base, int Len, unsigned char *Buf); diff --git a/hw/xfree86/os-support/linux/lnx_axp.c b/hw/xfree86/os-support/linux/lnx_axp.c index d2aa03587..e05581917 100644 --- a/hw/xfree86/os-support/linux/lnx_axp.c +++ b/hw/xfree86/os-support/linux/lnx_axp.c @@ -184,7 +184,7 @@ _alpha_iobase_query(unsigned flags, int hose, int bus, int devfn) /* * Only take over the inx/outx functions if this is a dense I/O * system *and* addressing domains are being used. The dense I/O - * routines expect I/O to be mapped (as done in xf86MapDomainIO) + * routines expect I/O to be mapped (as done in xf86MapLegacyIO) */ _alpha_outb = _dense_outb; _alpha_outw = _dense_outw; diff --git a/hw/xfree86/os-support/shared/ia64Pci.c b/hw/xfree86/os-support/shared/ia64Pci.c index 1fe119dcd..7bbd0b35b 100644 --- a/hw/xfree86/os-support/shared/ia64Pci.c +++ b/hw/xfree86/os-support/shared/ia64Pci.c @@ -56,7 +56,7 @@ * space of a given PCI domain; reads and writes are used to do port I/O. * The file descriptor for the file is stored in the upper bits of the * value passed in by the caller, and is created and populated by - * xf86MapDomainIO. + * xf86MapLegacyIO. * * If the legacy_io interface doesn't exist, we fall back to the glibc in/out * routines, which are prefixed by an underscore (e.g. _outb). |