Changeset ad6857c in mainline for uspace/drv/pciintel/pci.c
- Timestamp:
- 2011-02-27T02:43:29Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8e1eb4d0
- Parents:
- 1ae51ae
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/pciintel/pci.c
r1ae51ae rad6857c 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.