diff options
author | imp <imp@FreeBSD.org> | 2002-02-19 07:05:22 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2002-02-19 07:05:22 +0000 |
commit | a253cc8bc2f9e0e5169ea680b0bb644e652f1dc8 (patch) | |
tree | 164537fb05ed7fa3b17b754eb36a9cdfc36a9552 | |
parent | ca03e62ab090440e06ef68f67fd4261328bb9946 (diff) | |
download | FreeBSD-src-a253cc8bc2f9e0e5169ea680b0bb644e652f1dc8.zip FreeBSD-src-a253cc8bc2f9e0e5169ea680b0bb644e652f1dc8.tar.gz |
Put the stard/end adjustments back. They are needed. Also make start
== 0 a special case. I hope this fixes the real problem that phk and
others were seeing.
-rw-r--r-- | sys/dev/pci/pci_pci.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/sys/dev/pci/pci_pci.c b/sys/dev/pci/pci_pci.c index 8b5eef5..637271e 100644 --- a/sys/dev/pci/pci_pci.c +++ b/sys/dev/pci/pci_pci.c @@ -264,7 +264,7 @@ pcib_write_ivar(device_t dev, device_t child, int which, uintptr_t value) static int pcib_is_isa_io(u_long start) { - if ((start & 0xfffUL) > 0x3ffUL) + if ((start & 0xfffUL) > 0x3ffUL || start == 0) return (0); return (1); } @@ -275,7 +275,7 @@ pcib_is_isa_io(u_long start) static int pcib_is_isa_mem(u_long start) { - if (start > 0xfffffUL) + if (start > 0xfffffUL || start == 0) return (0); return (1); } @@ -306,6 +306,14 @@ pcib_alloc_resource(device_t dev, device_t child, int type, int *rid, */ switch (type) { case SYS_RES_IOPORT: + if (!pcib_is_isa_io(start)) { + if (start < sc->iobase) + start = sc->iobase; + if (end > sc->iolimit) + end = sc->iolimit; + if (end < start) + start = 0; + } if (!pcib_is_isa_io(start) && ((start < sc->iobase) || (end > sc->iolimit))) { device_printf(dev, "device %s%d requested unsupported I/O range 0x%lx-0x%lx" @@ -326,6 +334,14 @@ pcib_alloc_resource(device_t dev, device_t child, int type, int *rid, * flag as the request bubbles up? */ case SYS_RES_MEMORY: + if (!pcib_is_isa_mem(start)) { + if (start < sc->membase && end > sc->membase) + start = sc->membase; + if (end > sc->memlimit) + end = sc->memlimit; + if (end < start) + start = 0; + } if (!pcib_is_isa_mem(start) && (((start < sc->membase) || (end > sc->memlimit)) && ((start < sc->pmembase) || (end > sc->pmemlimit)))) { |