1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-14 10:09:48 +00:00

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.
This commit is contained in:
Stefan Eßer 1996-02-19 00:30:40 +00:00
parent e14b85c5e3
commit 8ec7a852b0
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=14153
2 changed files with 10 additions and 6 deletions

View File

@ -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 "

View File

@ -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 "