PCI: Difference between revisions

Jump to navigation Jump to search
[unchecked revision][unchecked revision]
Content deleted Content added
m Reverted edits by Essial (Talk); changed back to last version by Combuster
Line 249: Line 249:
|}
|}


When you want to retrieve the actual base address of a BAR, be sure to mask (that is, clear) the lower bits. For Memory Space BARs, you calculate (BAR & 0xFFFFFFF0). For I/O Space BARs, you calculate (BAR & 0xFFFFFFF8). Do '''not''' shift the bits to the right or the values will be incorrect.
When you want to retrieve the actual base address of a BAR, be sure to mask the lower bits. For Memory Space BARs, you calculate (BAR & 0xFFFFFFF0). For I/O Space BARs, you calculate (BAR & 0xFFF8).


To determine the size of memory maps needed by a PCI device, you must read the BAR .
To determine the size of memory maps needed by a PCI device, you must read the BAR .