diff options
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r-- | sys/arch/amd64/pci/pci_machdep.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/sys/arch/amd64/pci/pci_machdep.c b/sys/arch/amd64/pci/pci_machdep.c index 19137f17676..67fa23b429d 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.28 2009/04/21 19:18:09 kettenis Exp $ */ +/* $OpenBSD: pci_machdep.c,v 1.29 2009/04/29 18:28:38 kettenis Exp $ */ /* $NetBSD: pci_machdep.c,v 1.3 2003/05/07 21:33:58 fvdl Exp $ */ /*- @@ -372,9 +372,19 @@ pci_init_extents(void) bios_memmap_t *bmp; u_int64_t size; - if (pciio_ex == NULL) - pciio_ex = extent_create("pciio", 0, 0xffff, M_DEVBUF, - NULL, 0, EX_NOWAIT); + if (pciio_ex == NULL) { + /* + * We only have 64K of addressable I/O space. + * However, since BARs may contain garbage, we cover + * the full 32-bit address space defined by PCI of + * which we only make the first 64K available. + */ + pciio_ex = extent_create("pciio", 0, 0xffffffff, M_DEVBUF, + NULL, 0, EX_NOWAIT | EX_FILLED); + if (pciio_ex == NULL) + return; + extent_free(pciio_ex, 0, 0x10000, M_NOWAIT); + } if (pcimem_ex == NULL) { pcimem_ex = extent_create("pcimem", 0, 0xffffffff, M_DEVBUF, |