From 40a95e4cfb321729804117a3c4a64ecf16182a73 Mon Sep 17 00:00:00 2001 From: Niklas Hallqvist Date: Wed, 20 Sep 2000 17:29:48 +0000 Subject: Extend the region in which we allow mapping unmapped PCI devices. The former code only allowed one fixed up device mapping. --- sys/arch/i386/pci/pci_addr_fixup.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sys/arch/i386/pci/pci_addr_fixup.c b/sys/arch/i386/pci/pci_addr_fixup.c index 1e9dc657beb..8493d7d991e 100644 --- a/sys/arch/i386/pci/pci_addr_fixup.c +++ b/sys/arch/i386/pci/pci_addr_fixup.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_addr_fixup.c,v 1.2 2000/09/07 20:50:38 mickey Exp $ */ +/* $OpenBSD: pci_addr_fixup.c,v 1.3 2000/09/20 17:29:47 niklas Exp $ */ /* $NetBSD: pci_addr_fixup.c,v 1.7 2000/08/03 20:10:45 nathanw Exp $ */ /*- @@ -297,9 +297,8 @@ pciaddr_do_resource_allocate(pc, tag, mapreg, ex, type, addr, size) PCIBIOS_PRINTV(("No available resources. fixup failed\n")); return (1); } - error = extent_alloc_subregion(ex, start, start + size - 1, size, - size, 0, - EX_FAST|EX_NOWAIT|EX_MALLOCOK, addr); + error = extent_alloc_subregion(ex, start, ex->ex_end, size, size, 0, + EX_FAST|EX_NOWAIT|EX_MALLOCOK, addr); if (error) { PCIBIOS_PRINTV(("No available resources. fixup failed\n")); return (1); @@ -343,7 +342,7 @@ pciaddr_do_resource_reserve(pc, tag, mapreg, ex, type, addr, size) if (*addr == 0) return (1); - error = extent_alloc_region(ex, *addr, size, EX_NOWAIT| EX_MALLOCOK); + error = extent_alloc_region(ex, *addr, size, EX_NOWAIT | EX_MALLOCOK); if (error) { PCIBIOS_PRINTV(("Resource conflict.\n")); pci_conf_write(pc, tag, mapreg, 0); /* clear */ -- cgit v1.2.3