Changeset d93aafed in mainline
- Timestamp:
- 2010-10-23T17:57:21Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 33dbbd2
- Parents:
- 8304889
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/pciintel/pci.c
r8304889 rd93aafed 277 277 bool io; 278 278 /* 64-bit wide address */ 279 bool w64;279 bool addrw64; 280 280 281 281 /* Size of the io or memory range specified by the BAR */ … … 289 289 io = (bool) (val & 1); 290 290 if (io) { 291 w64 = false;291 addrw64 = false; 292 292 } else { 293 293 switch ((val >> 1) & 3) { 294 294 case 0: 295 w64 = false;295 addrw64 = false; 296 296 break; 297 297 case 2: 298 w64 = true;298 addrw64 = true; 299 299 break; 300 300 default: … … 314 314 range_size = pci_bar_mask_to_size(mask); 315 315 316 if ( w64) {316 if (addrw64) { 317 317 range_addr = ((uint64_t)pci_conf_read_32(dev, addr + 4) << 32) | 318 318 (val & 0xfffffff0); … … 321 321 } 322 322 323 if ( 0 != range_addr) {323 if (range_addr != 0) { 324 324 printf(NAME ": device %s : ", dev->name); 325 325 printf("address = %x", range_addr); … … 329 329 pci_add_range(dev, range_addr, range_size, io); 330 330 331 if ( w64)331 if (addrw64) 332 332 return addr + 8; 333 333 … … 524 524 } 525 525 526 void init_pci_dev_data(pci_dev_data_t *d , int bus, int dev, int fn)527 { 528 d ->bus = bus;529 d ->dev = dev;530 d ->fn = fn;531 } 532 533 void delete_pci_dev_data(pci_dev_data_t *d )534 { 535 if (d != NULL) {536 clean_hw_resource_list(&d ->hw_resources);537 free(d );526 void init_pci_dev_data(pci_dev_data_t *dev_data, int bus, int dev, int fn) 527 { 528 dev_data->bus = bus; 529 dev_data->dev = dev; 530 dev_data->fn = fn; 531 } 532 533 void delete_pci_dev_data(pci_dev_data_t *dev_data) 534 { 535 if (dev_data != NULL) { 536 clean_hw_resource_list(&dev_data->hw_resources); 537 free(dev_data); 538 538 } 539 539 }
Note:
See TracChangeset
for help on using the changeset viewer.