Fix the off-by-one error in the calculation of the valid port range.

Reduce default value of pcicb_membase to 0x2000000 (from 0x4000000)
since this seems to be the lower bound used by many systems.

Submitted by:	Mihoko Tanaka <m_tanaka@pa.yokogawa.co.jp>
This commit is contained in:
Stefan Eßer 1995-12-15 13:40:20 +00:00
parent c5a69148b9
commit 6549c8c929
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=12872
2 changed files with 8 additions and 8 deletions

View File

@ -1,6 +1,6 @@
/**************************************************************************
**
** $Id: pci.c,v 1.36 1995/12/07 12:47:42 davidg Exp $
** $Id: pci.c,v 1.37 1995/12/14 09:54:08 phk Exp $
**
** General subroutines for the PCI bus.
** pci_configure ()
@ -156,8 +156,8 @@ static struct pcicb pcibus0 = {
0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, /* real allocation */
0, 0xFFFF, /* iobase/limit */
0x4000000, 0xFFFFFFFFu, /* nonprefetch membase/limit */
0x4000000, 0xFFFFFFFFu /* prefetch membase/limit */
0x2000000, 0xFFFFFFFFu, /* nonprefetch membase/limit */
0x2000000, 0xFFFFFFFFu /* prefetch membase/limit */
};
static struct pcicb *pcicb;
@ -923,7 +923,7 @@ int pci_map_port (pcici_t tag, u_long reg, u_short* pa)
};
iosize = -(data & PCI_MAP_IO_ADDRESS_MASK);
if (ioaddr < pcicb->pcicb_iobase
|| ioaddr + iosize > pcicb->pcicb_iolimit) {
|| ioaddr + iosize -1 > pcicb->pcicb_iolimit) {
printf ("pci_map_port failed: device's iorange 0x%x-0x%x "
"is incompatible with its bridge's range 0x%x-0x%x\n",
(unsigned) ioaddr, (unsigned) ioaddr + iosize - 1,

View File

@ -1,6 +1,6 @@
/**************************************************************************
**
** $Id: pci.c,v 1.36 1995/12/07 12:47:42 davidg Exp $
** $Id: pci.c,v 1.37 1995/12/14 09:54:08 phk Exp $
**
** General subroutines for the PCI bus.
** pci_configure ()
@ -156,8 +156,8 @@ static struct pcicb pcibus0 = {
0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, /* real allocation */
0, 0xFFFF, /* iobase/limit */
0x4000000, 0xFFFFFFFFu, /* nonprefetch membase/limit */
0x4000000, 0xFFFFFFFFu /* prefetch membase/limit */
0x2000000, 0xFFFFFFFFu, /* nonprefetch membase/limit */
0x2000000, 0xFFFFFFFFu /* prefetch membase/limit */
};
static struct pcicb *pcicb;
@ -923,7 +923,7 @@ int pci_map_port (pcici_t tag, u_long reg, u_short* pa)
};
iosize = -(data & PCI_MAP_IO_ADDRESS_MASK);
if (ioaddr < pcicb->pcicb_iobase
|| ioaddr + iosize > pcicb->pcicb_iolimit) {
|| ioaddr + iosize -1 > pcicb->pcicb_iolimit) {
printf ("pci_map_port failed: device's iorange 0x%x-0x%x "
"is incompatible with its bridge's range 0x%x-0x%x\n",
(unsigned) ioaddr, (unsigned) ioaddr + iosize - 1,