diff options
author | Brad Smith <brad@cvs.openbsd.org> | 2004-10-09 19:52:05 +0000 |
---|---|---|
committer | Brad Smith <brad@cvs.openbsd.org> | 2004-10-09 19:52:05 +0000 |
commit | faf72ac487efb530d82918a5b281a5eb1b07ccdb (patch) | |
tree | 0b951e43cc9d2853b6a786e47e5f1a43b80781fe /sys/dev/pci/pci_map.c | |
parent | 74c7745a1e0c8b9a700b0787fd79665d00189013 (diff) |
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@
Diffstat (limited to 'sys/dev/pci/pci_map.c')
-rw-r--r-- | sys/dev/pci/pci_map.c | 5 |
1 files changed, 3 insertions, 2 deletions
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); } |