summaryrefslogtreecommitdiffstats
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorse <se@FreeBSD.org>1996-02-19 00:30:40 +0000
committerse <se@FreeBSD.org>1996-02-19 00:30:40 +0000
commit961eb1cd883594725b9482b6df04576a582d42c5 (patch)
tree0fc4e11d491d12d6017d9f9c3dbf5d3bab0aa1e3 /sys/dev/pci
parent99375fedab6dad7551ae08bb25d00f9ff4a65e7e (diff)
downloadFreeBSD-src-961eb1cd883594725b9482b6df04576a582d42c5.zip
FreeBSD-src-961eb1cd883594725b9482b6df04576a582d42c5.tar.gz
Remove limit of port I/O addresses to 65K, since PCI specifies 32 bit
port addresses (even though the PC architecture doesn't support them). Add code to limit the I/O map size based on the lowest set bit of the address. This cures the problem with the BT946C only having a 16 bit map register, in voiolation of the PCI specs, without giving up the general support of >65K port regions.
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/pci.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c
index 1bf861c..7b1bfb2 100644
--- a/sys/dev/pci/pci.c
+++ b/sys/dev/pci/pci.c
@@ -1,6 +1,6 @@
/**************************************************************************
**
-** $Id: pci.c,v 1.44 1996/01/30 01:14:29 se Exp $
+** $Id: pci.c,v 1.45 1996/02/17 23:57:03 se Exp $
**
** General subroutines for the PCI bus.
** pci_configure ()
@@ -576,8 +576,9 @@ pci_bus_config (void)
continue;
case 1:
case 5:
- size = -(data & PCI_MAP_IO_ADDRESS_MASK);
addr = map & PCI_MAP_IO_ADDRESS_MASK;
+ size = -(data & PCI_MAP_IO_ADDRESS_MASK);
+ size &= ~(addr ^ -addr);
pci_register_io (pcicb, addr, addr+size-1);
pcicb->pcicb_pamount += size;
@@ -975,7 +976,7 @@ int pci_map_port (pcici_t tag, u_long reg, u_short* pa)
*/
ioaddr = pcibus->pb_read (tag, reg) & PCI_MAP_IO_ADDRESS_MASK;
- if (!ioaddr || ioaddr > 0xfffful) {
+ if (!ioaddr) {
printf ("pci_map_port failed: not configured by bios.\n");
return (0);
};
@@ -990,6 +991,7 @@ int pci_map_port (pcici_t tag, u_long reg, u_short* pa)
return (0);
};
iosize = -(data & PCI_MAP_IO_ADDRESS_MASK);
+ iosize &= ~(ioaddr ^ -ioaddr);
if (ioaddr < pcicb->pcicb_iobase
|| ioaddr + iosize -1 > pcicb->pcicb_iolimit) {
printf ("pci_map_port failed: device's iorange 0x%x-0x%x "
OpenPOWER on IntegriCloud