Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset e8d6ce2 in mainline


Ignore:
Timestamp:
2013-09-10T13:47:34Z (8 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master
Children:
feeac0d
Parents:
4cdcd2b
Message:

Do not add unimplemented ranges.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/pci/pciintel/pci.c

    r4cdcd2b re8d6ce2  
    454454{
    455455        /* Value of the BAR */
    456         uint32_t val, mask;
     456        uint32_t val;
     457        uint32_t bar;
     458        uint32_t mask;
     459
    457460        /* IO space address */
    458461        bool io;
     
    492495        /* Get the address mask. */
    493496        pci_conf_write_32(fun, addr, 0xffffffff);
    494         mask &= pci_conf_read_32(fun, addr);
    495        
     497        bar = pci_conf_read_32(fun, addr);
     498
     499        /*
     500         * Unimplemented BARs read back as all 0's.
     501         */
     502        if (!bar)
     503                return addr + (addrw64 ? 8 : 4);
     504
     505        mask &= bar;   
     506
    496507        /* Restore the original value. */
    497508        pci_conf_write_32(fun, addr, val);
Note: See TracChangeset for help on using the changeset viewer.