Changeset 51b46f2 in mainline for uspace/drv/pciintel/pci.c
- Timestamp:
- 2011-03-01T15:39:52Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e135751
- Parents:
- 0e3505a (diff), cc44f7e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/pciintel/pci.c
r0e3505a r51b46f2 320 320 /* Get the value of the BAR. */ 321 321 val = pci_conf_read_32(fun, addr); 322 323 #define IO_MASK (~0x3) 324 #define MEM_MASK (~0xf) 322 325 323 326 io = (bool) (val & 1); 324 327 if (io) { 325 328 addrw64 = false; 329 mask = IO_MASK; 326 330 } else { 331 mask = MEM_MASK; 327 332 switch ((val >> 1) & 3) { 328 333 case 0: … … 340 345 /* Get the address mask. */ 341 346 pci_conf_write_32(fun, addr, 0xffffffff); 342 mask = pci_conf_read_32(fun, addr);347 mask &= pci_conf_read_32(fun, addr); 343 348 344 349 /* Restore the original value. */ … … 659 664 size_t pci_bar_mask_to_size(uint32_t mask) 660 665 { 661 return ((mask & 0xfffffff0) ^ 0xffffffff) + 1; 666 size_t size = mask & ~(mask - 1); 667 return size; 662 668 } 663 669
Note:
See TracChangeset
for help on using the changeset viewer.