diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2009-04-13 21:23:17 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2009-04-13 21:23:17 +0000 |
commit | 74b55ca1869536316e37de9b21e1fd50f2f9dd56 (patch) | |
tree | 053ca7363b2d5f0517a6f30ab0fdc310197882e7 /sys/arch | |
parent | 5a4ab77cd05371c9c73e0252ecb3d9b195c4cccc (diff) |
Ignore zero-sized regions from the BIOS memory map when reserving root PCI
bus address space. Fixes a problem reported by david@.
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/amd64/pci/pci_machdep.c | 6 | ||||
-rw-r--r-- | sys/arch/i386/pci/pci_machdep.c | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/sys/arch/amd64/pci/pci_machdep.c b/sys/arch/amd64/pci/pci_machdep.c index e91d7e8215f..78853bf8136 100644 --- a/sys/arch/amd64/pci/pci_machdep.c +++ b/sys/arch/amd64/pci/pci_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_machdep.c,v 1.25 2009/04/11 17:13:33 kettenis Exp $ */ +/* $OpenBSD: pci_machdep.c,v 1.26 2009/04/13 21:23:16 kettenis Exp $ */ /* $NetBSD: pci_machdep.c,v 1.3 2003/05/07 21:33:58 fvdl Exp $ */ /*- @@ -582,6 +582,10 @@ pci_init_extents(void) if (bmp->addr + size >= 0x100000000ULL) size = 0x100000000ULL - bmp->addr; + /* Ignore zero-sized regions. */ + if (size == 0) + continue; + if (extent_alloc_region(pcimem_ex, bmp->addr, size, EX_NOWAIT)) printf("memory map conflict 0x%llx/0x%llx\n", diff --git a/sys/arch/i386/pci/pci_machdep.c b/sys/arch/i386/pci/pci_machdep.c index de60d8500d2..dd545221c8a 100644 --- a/sys/arch/i386/pci/pci_machdep.c +++ b/sys/arch/i386/pci/pci_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_machdep.c,v 1.46 2009/04/11 17:13:33 kettenis Exp $ */ +/* $OpenBSD: pci_machdep.c,v 1.47 2009/04/13 21:22:38 kettenis Exp $ */ /* $NetBSD: pci_machdep.c,v 1.28 1997/06/06 23:29:17 thorpej Exp $ */ /*- @@ -632,6 +632,10 @@ pci_init_extents(void) if (bmp->addr + size >= 0x100000000ULL) size = 0x100000000ULL - bmp->addr; + /* Ignore zero-sized regions. */ + if (size == 0) + continue; + if (extent_alloc_region(pcimem_ex, bmp->addr, size, EX_NOWAIT)) printf("memory map conflict 0x%llx/0x%llx\n", |