diff options
author | 2009-04-13 21:22:38 +0000 | |
---|---|---|
committer | 2009-04-13 21:22:38 +0000 | |
commit | f1b7bded77f88ee319214edf0cc9c0dbb59246d8 (patch) | |
tree | a6064f8a9bf48b358080f566657920ded2c7ab0b | |
parent | The start of Origin 200 support. Based on some code contributed by pefo@ (diff) | |
download | wireguard-openbsd-f1b7bded77f88ee319214edf0cc9c0dbb59246d8.tar.xz wireguard-openbsd-f1b7bded77f88ee319214edf0cc9c0dbb59246d8.zip |
Ignore zero-sized regions from the BIOS memory map when reserving root PCI
bus address space. Fixes a problem reported by david@.
-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", |