diff options
author | imp <imp@FreeBSD.org> | 2005-06-03 19:41:06 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2005-06-03 19:41:06 +0000 |
commit | 074906c2f63a32ced210fc7b104d34fcf43d5ba0 (patch) | |
tree | 1df46df2a39a9477585132e60932e65b4f210cfc | |
parent | fb4f81e2c77814a3e773a2a4914e9ff642099164 (diff) | |
download | FreeBSD-src-074906c2f63a32ced210fc7b104d34fcf43d5ba0.zip FreeBSD-src-074906c2f63a32ced210fc7b104d34fcf43d5ba0.tar.gz |
Mask off the bar's value after the probe test write before testing
against 0 in pci_alloc_map, just like we do in pci_add_map. Also,
make sure that we restore the value to the BAR that was there before
if the bar is 0. Chances are that it was 0 before the write too and
that the restoration is a nop, but better safe than sorry.
Notice by: dwhite
-rw-r--r-- | sys/dev/pci/pci.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index 9d32237..c0ed235 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -1626,8 +1626,8 @@ pci_alloc_map(device_t dev, device_t child, int type, int *rid, map = pci_read_config(child, *rid, 4); pci_write_config(child, *rid, 0xffffffff, 4); testval = pci_read_config(child, *rid, 4); - if (testval == 0) - return (NULL); + if (pci_mapbase(testval) == 0) + goto out; if (pci_maptype(testval) & PCI_MAPMEM) { if (type != SYS_RES_MEMORY) { if (bootverbose) |