Changeset 73097 in vbox for trunk/src/VBox/Devices/VirtIO
- Timestamp:
- Jul 12, 2018 9:06:33 PM (7 years ago)
- Location:
- trunk/src/VBox/Devices/VirtIO
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/VirtIO/Virtio.cpp
r71788 r73097 28 28 29 29 #define INSTANCE(pState) pState->szInstance 30 #define IFACE_TO_STATE(pIface, ifaceName) ((VPCISTATE *)((char*) pIface - RT_OFFSETOF(VPCISTATE, ifaceName)))30 #define IFACE_TO_STATE(pIface, ifaceName) ((VPCISTATE *)((char*)(pIface) - RT_UOFFSETOF(VPCISTATE, ifaceName))) 31 31 32 32 #ifdef LOG_ENABLED … … 58 58 + sizeof(VRINGDESC) * pQueue->VRing.uSize; 59 59 pQueue->VRing.addrUsed = RT_ALIGN( 60 pQueue->VRing.addrAvail + RT_ OFFSETOF(VRINGAVAIL, auRing[pQueue->VRing.uSize]),60 pQueue->VRing.addrAvail + RT_UOFFSETOF_DYN(VRINGAVAIL, auRing[pQueue->VRing.uSize]), 61 61 PAGE_SIZE); /* The used ring must start from the next page. */ 62 62 pQueue->uNextAvailIndex = 0; … … 81 81 82 82 PDMDevHlpPhysRead(pState->CTX_SUFF(pDevIns), 83 pVRing->addrAvail + RT_ OFFSETOF(VRINGAVAIL, auRing[uIndex % pVRing->uSize]),83 pVRing->addrAvail + RT_UOFFSETOF_DYN(VRINGAVAIL, auRing[uIndex % pVRing->uSize]), 84 84 &tmp, sizeof(tmp)); 85 85 return tmp; … … 91 91 92 92 PDMDevHlpPhysRead(pState->CTX_SUFF(pDevIns), 93 pVRing->addrAvail + RT_ OFFSETOF(VRINGAVAIL, uFlags),93 pVRing->addrAvail + RT_UOFFSETOF(VRINGAVAIL, uFlags), 94 94 &tmp, sizeof(tmp)); 95 95 return tmp; … … 101 101 102 102 PDMDevHlpPhysRead(pState->CTX_SUFF(pDevIns), 103 pVRing->addrUsed + RT_ OFFSETOF(VRINGUSED, uFlags),103 pVRing->addrUsed + RT_UOFFSETOF(VRINGUSED, uFlags), 104 104 &tmp, sizeof(tmp)); 105 105 … … 110 110 111 111 PDMDevHlpPCIPhysWrite(pState->CTX_SUFF(pDevIns), 112 pVRing->addrUsed + RT_ OFFSETOF(VRINGUSED, uFlags),112 pVRing->addrUsed + RT_UOFFSETOF(VRINGUSED, uFlags), 113 113 &tmp, sizeof(tmp)); 114 114 } … … 197 197 uint16_t tmp; 198 198 PDMDevHlpPhysRead(pState->CTX_SUFF(pDevIns), 199 pVRing->addrUsed + RT_ OFFSETOF(VRINGUSED, uIndex),199 pVRing->addrUsed + RT_UOFFSETOF(VRINGUSED, uIndex), 200 200 &tmp, sizeof(tmp)); 201 201 return tmp; … … 205 205 { 206 206 PDMDevHlpPCIPhysWrite(pState->CTX_SUFF(pDevIns), 207 pVRing->addrUsed + RT_ OFFSETOF(VRINGUSED, uIndex),207 pVRing->addrUsed + RT_UOFFSETOF(VRINGUSED, uIndex), 208 208 &u16Value, sizeof(u16Value)); 209 209 } … … 216 216 elem.uLen = uLen; 217 217 PDMDevHlpPCIPhysWrite(pState->CTX_SUFF(pDevIns), 218 pVRing->addrUsed + RT_ OFFSETOF(VRINGUSED, aRing[uIndex % pVRing->uSize]),218 pVRing->addrUsed + RT_UOFFSETOF_DYN(VRINGUSED, aRing[uIndex % pVRing->uSize]), 219 219 &elem, sizeof(elem)); 220 220 } -
trunk/src/VBox/Devices/VirtIO/Virtio.h
r69500 r73097 299 299 300 300 PDMDevHlpPhysRead(pState->CTX_SUFF(pDevIns), 301 pVRing->addrAvail + RT_ OFFSETOF(VRINGAVAIL, uNextFreeIndex),301 pVRing->addrAvail + RT_UOFFSETOF(VRINGAVAIL, uNextFreeIndex), 302 302 &tmp, sizeof(tmp)); 303 303 return tmp;
Note:
See TracChangeset
for help on using the changeset viewer.