Changeset 44543 in vbox
- Timestamp:
- Feb 5, 2013 1:16:35 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 83595
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/pci.h
r44528 r44543 546 546 } PCIDEVICE; 547 547 548 /* @todo: handle extended space access */ 549 DECLINLINE(void) PCIDevSetByte(PPCIDEVICE pPciDev, uint32_t uOffset, uint8_t u8Value) 550 { 551 pPciDev->config[uOffset] = u8Value; 552 } 553 554 DECLINLINE(uint8_t) PCIDevGetByte(PPCIDEVICE pPciDev, uint32_t uOffset) 555 { 556 return pPciDev->config[uOffset]; 557 } 558 559 DECLINLINE(void) PCIDevSetWord(PPCIDEVICE pPciDev, uint32_t uOffset, uint16_t u16Value) 560 { 561 *(uint16_t*)&pPciDev->config[uOffset] = RT_H2LE_U16(u16Value); 562 } 563 564 DECLINLINE(uint16_t) PCIDevGetWord(PPCIDEVICE pPciDev, uint32_t uOffset) 565 { 566 uint16_t u16Value = *(uint16_t*)&pPciDev->config[uOffset]; 548 /** @todo handle extended space access. */ 549 550 DECLINLINE(void) PCIDevSetByte(PPCIDEVICE pPciDev, uint32_t offReg, uint8_t u8Value) 551 { 552 pPciDev->config[offReg] = u8Value; 553 } 554 555 DECLINLINE(uint8_t) PCIDevGetByte(PPCIDEVICE pPciDev, uint32_t offReg) 556 { 557 return pPciDev->config[offReg]; 558 } 559 560 DECLINLINE(void) PCIDevSetWord(PPCIDEVICE pPciDev, uint32_t offReg, uint16_t u16Value) 561 { 562 *(uint16_t*)&pPciDev->config[offReg] = RT_H2LE_U16(u16Value); 563 } 564 565 DECLINLINE(uint16_t) PCIDevGetWord(PPCIDEVICE pPciDev, uint32_t offReg) 566 { 567 uint16_t u16Value = *(uint16_t*)&pPciDev->config[offReg]; 567 568 return RT_H2LE_U16(u16Value); 568 569 } 569 570 570 DECLINLINE(void) PCIDevSetDWord(PPCIDEVICE pPciDev, uint32_t uOffset, uint32_t u32Value)571 { 572 *(uint32_t*)&pPciDev->config[ uOffset] = RT_H2LE_U32(u32Value);573 } 574 575 DECLINLINE(uint32_t) PCIDevGetDWord(PPCIDEVICE pPciDev, uint32_t uOffset)576 { 577 uint32_t u32Value = *(uint32_t*)&pPciDev->config[ uOffset];571 DECLINLINE(void) PCIDevSetDWord(PPCIDEVICE pPciDev, uint32_t offReg, uint32_t u32Value) 572 { 573 *(uint32_t*)&pPciDev->config[offReg] = RT_H2LE_U32(u32Value); 574 } 575 576 DECLINLINE(uint32_t) PCIDevGetDWord(PPCIDEVICE pPciDev, uint32_t offReg) 577 { 578 uint32_t u32Value = *(uint32_t*)&pPciDev->config[offReg]; 578 579 return RT_H2LE_U32(u32Value); 579 580 } 580 581 581 DECLINLINE(void) PCIDevSetQWord(PPCIDEVICE pPciDev, uint32_t uOffset, uint64_t u64Value)582 { 583 *(uint64_t*)&pPciDev->config[ uOffset] = RT_H2LE_U64(u64Value);584 } 585 586 DECLINLINE(uint64_t) PCIDevGetQWord(PPCIDEVICE pPciDev, uint32_t uOffset)587 { 588 uint64_t u64Value = *(uint64_t*)&pPciDev->config[ uOffset];582 DECLINLINE(void) PCIDevSetQWord(PPCIDEVICE pPciDev, uint32_t offReg, uint64_t u64Value) 583 { 584 *(uint64_t*)&pPciDev->config[offReg] = RT_H2LE_U64(u64Value); 585 } 586 587 DECLINLINE(uint64_t) PCIDevGetQWord(PPCIDEVICE pPciDev, uint32_t offReg) 588 { 589 uint64_t u64Value = *(uint64_t*)&pPciDev->config[offReg]; 589 590 return RT_H2LE_U64(u64Value); 590 591 }
Note:
See TracChangeset
for help on using the changeset viewer.