From faf72ac487efb530d82918a5b281a5eb1b07ccdb Mon Sep 17 00:00:00 2001 From: Brad Smith Date: Sat, 9 Oct 2004 19:52:05 +0000 Subject: When testing for a void region, use PCI_MAPREG_MEM_SIZE() for 32bit memaddr. If the 32bit mask read is 0, wmask will be 0xffffffff00000000, and PCI_MAPREG_MEM64_SIZE() won't make this 0. From NetBSD ok mickey@ --- sys/dev/pci/pci_map.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sys/dev/pci') diff --git a/sys/dev/pci/pci_map.c b/sys/dev/pci/pci_map.c index 37ff92e32b7..5c44dadeb0b 100644 --- a/sys/dev/pci/pci_map.c +++ b/sys/dev/pci/pci_map.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_map.c,v 1.10 2003/08/27 20:59:15 mickey Exp $ */ +/* $OpenBSD: pci_map.c,v 1.11 2004/10/09 19:52:04 brad Exp $ */ /* $NetBSD: pci_map.c,v 1.7 2000/05/10 16:58:42 thorpej Exp $ */ /*- @@ -167,7 +167,8 @@ nbsd_pci_mem_find(pc, tag, reg, type, basep, sizep, flagsp) waddress = (u_int64_t)address1 << 32UL | address; wmask = (u_int64_t)mask1 << 32UL | mask; - if (PCI_MAPREG_MEM64_SIZE(wmask) == 0) { + if ((is64bit && PCI_MAPREG_MEM64_SIZE(wmask) == 0) || + (!is64bit && PCI_MAPREG_MEM_SIZE(mask) == 0)) { printf("pci_mem_find: void region\n"); return (1); } -- cgit v1.2.3