Changeset 71590 in vbox for trunk/include/VBox/Graphics
- Timestamp:
- Mar 31, 2018 6:34:28 PM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 121579
- Location:
- trunk/include/VBox/Graphics
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/Graphics/HGSMI.h
r71585 r71590 94 94 * @thread EMT on the host side. 95 95 */ 96 typedef DECLCALLBACK(int) FNHGSMICHANNELHANDLER(void *pvHandler, uint16_t u16ChannelInfo, void *pvBuffer, HGSMISIZE cbBuffer); 96 typedef DECLCALLBACK(int) FNHGSMICHANNELHANDLER(void *pvHandler, uint16_t u16ChannelInfo, 97 RT_UNTRUSTED_VOLATILE_HSTGST void *pvBuffer, HGSMISIZE cbBuffer); 97 98 /** Pointer to a channel handler callback. */ 98 99 typedef FNHGSMICHANNELHANDLER *PFNHGSMICHANNELHANDLER; … … 124 125 RT_C_DECLS_BEGIN 125 126 126 DECLINLINE(HGSMIBUFFERHEADER *) HGSMIBufferHeaderFromPtr(void *pvBuffer)127 DECLINLINE(HGSMIBUFFERHEADER *) HGSMIBufferHeaderFromPtr(void RT_UNTRUSTED_VOLATILE_HSTGST *pvBuffer) 127 128 { 128 129 return (HGSMIBUFFERHEADER *)pvBuffer; 129 130 } 130 131 131 DECLINLINE(uint8_t *) HGSMIBufferDataFromPtr(void*pvBuffer)132 { 133 return (uint8_t *)pvBuffer + sizeof(HGSMIBUFFERHEADER);134 } 135 136 DECLINLINE(HGSMIBUFFERTAIL *) HGSMIBufferTailFromPtr(void *pvBuffer,137 138 { 139 return (HGSMIBUFFERTAIL *)(HGSMIBufferDataFromPtr(pvBuffer) + u32DataSize);132 DECLINLINE(uint8_t RT_UNTRUSTED_VOLATILE_HSTGST *) HGSMIBufferDataFromPtr(void RT_UNTRUSTED_VOLATILE_HSTGST *pvBuffer) 133 { 134 return (uint8_t RT_UNTRUSTED_VOLATILE_HSTGST *)pvBuffer + sizeof(HGSMIBUFFERHEADER); 135 } 136 137 DECLINLINE(HGSMIBUFFERTAIL RT_UNTRUSTED_VOLATILE_HSTGST *) 138 HGSMIBufferTailFromPtr(void RT_UNTRUSTED_VOLATILE_HSTGST *pvBuffer, uint32_t u32DataSize) 139 { 140 return (HGSMIBUFFERTAIL RT_UNTRUSTED_VOLATILE_HSTGST *)(HGSMIBufferDataFromPtr(pvBuffer) + u32DataSize); 140 141 } 141 142 … … 145 146 } 146 147 147 DECLINLINE(HGSMIBUFFERHEADER *) HGSMIBufferHeaderFromData(const void*pvData)148 { 149 return (HGSMIBUFFERHEADER *)((uint8_t *)pvData - sizeof(HGSMIBUFFERHEADER));148 DECLINLINE(HGSMIBUFFERHEADER RT_UNTRUSTED_VOLATILE_HSTGST *) HGSMIBufferHeaderFromData(const void RT_UNTRUSTED_VOLATILE_HSTGST *pvData) 149 { 150 return (HGSMIBUFFERHEADER RT_UNTRUSTED_VOLATILE_HSTGST *)((uint8_t *)pvData - sizeof(HGSMIBUFFERHEADER)); 150 151 } 151 152 … … 155 156 } 156 157 157 DECLINLINE(HGSMIOFFSET) HGSMIPointerToOffset(const HGSMIAREA *pArea, 158 const void *pv) 158 DECLINLINE(HGSMIOFFSET) HGSMIPointerToOffset(const HGSMIAREA *pArea, const void RT_UNTRUSTED_VOLATILE_HSTGST *pv) 159 159 { 160 160 return pArea->offBase + (HGSMIOFFSET)((uint8_t *)pv - pArea->pu8Base); 161 161 } 162 162 163 DECLINLINE(void *) HGSMIOffsetToPointer(const HGSMIAREA *pArea, 164 HGSMIOFFSET offBuffer) 163 DECLINLINE(void RT_UNTRUSTED_VOLATILE_HSTGST *) HGSMIOffsetToPointer(const HGSMIAREA *pArea, HGSMIOFFSET offBuffer) 165 164 { 166 165 return pArea->pu8Base + (offBuffer - pArea->offBase); 167 166 } 168 167 169 DECLINLINE(uint8_t *) HGSMIBufferDataFromOffset(const HGSMIAREA *pArea, 170 HGSMIOFFSET offBuffer) 171 { 172 void *pvBuffer = HGSMIOffsetToPointer(pArea, offBuffer); 168 DECLINLINE(uint8_t RT_UNTRUSTED_VOLATILE_HSTGST*) HGSMIBufferDataFromOffset(const HGSMIAREA *pArea, HGSMIOFFSET offBuffer) 169 { 170 void RT_UNTRUSTED_VOLATILE_HSTGST *pvBuffer = HGSMIOffsetToPointer(pArea, offBuffer); 173 171 return HGSMIBufferDataFromPtr(pvBuffer); 174 172 } 175 173 176 DECLINLINE(HGSMIOFFSET) HGSMIBufferOffsetFromData(const HGSMIAREA *pArea, 177 void *pvData) 178 { 179 HGSMIBUFFERHEADER *pHeader = HGSMIBufferHeaderFromData(pvData); 174 DECLINLINE(HGSMIOFFSET) HGSMIBufferOffsetFromData(const HGSMIAREA *pArea, void RT_UNTRUSTED_VOLATILE_HSTGST *pvData) 175 { 176 HGSMIBUFFERHEADER RT_UNTRUSTED_VOLATILE_HSTGST *pHeader = HGSMIBufferHeaderFromData(pvData); 180 177 return HGSMIPointerToOffset(pArea, pHeader); 181 178 } 182 179 183 DECLINLINE(uint8_t *) HGSMIBufferDataAndChInfoFromOffset(const HGSMIAREA *pArea, 184 HGSMIOFFSET offBuffer, 185 uint16_t *pu16ChannelInfo) 186 { 187 HGSMIBUFFERHEADER *pHeader = (HGSMIBUFFERHEADER *)HGSMIOffsetToPointer(pArea, offBuffer); 180 DECLINLINE(uint8_t RT_UNTRUSTED_VOLATILE_HSTGST *) HGSMIBufferDataAndChInfoFromOffset(const HGSMIAREA *pArea, 181 HGSMIOFFSET offBuffer, 182 uint16_t *pu16ChannelInfo) 183 { 184 HGSMIBUFFERHEADER RT_UNTRUSTED_VOLATILE_HSTGST *pHeader = 185 (HGSMIBUFFERHEADER RT_UNTRUSTED_VOLATILE_HSTGST *)HGSMIOffsetToPointer(pArea, offBuffer); 188 186 *pu16ChannelInfo = pHeader->u16ChannelInfo; 189 187 return HGSMIBufferDataFromPtr(pHeader); 190 188 } 191 189 192 uint32_t HGSMIChecksum(HGSMIOFFSET offBuffer, 193 const HGSMIBUFFERHEADER *pHeader, 194 const HGSMIBUFFERTAIL *pTail); 195 196 int HGSMIAreaInitialize(HGSMIAREA *pArea, 197 void *pvBase, 198 HGSMISIZE cbArea, 199 HGSMIOFFSET offBase); 200 190 uint32_t HGSMIChecksum(HGSMIOFFSET offBuffer, const HGSMIBUFFERHEADER RT_UNTRUSTED_VOLATILE_HSTGST *pHeader, 191 const HGSMIBUFFERTAIL RT_UNTRUSTED_VOLATILE_HSTGST *pTail); 192 193 int HGSMIAreaInitialize(HGSMIAREA *pArea, void *pvBase, HGSMISIZE cbArea, HGSMIOFFSET offBase); 201 194 void HGSMIAreaClear(HGSMIAREA *pArea); 202 195 … … 206 199 } 207 200 208 DECLINLINE(bool) HGSMIAreaContainsPointer(const HGSMIAREA *pArea, const void *pv) 209 { 210 return (uintptr_t)pv >= (uintptr_t)pArea->pu8Base && (uintptr_t)pv - (uintptr_t)pArea->pu8Base < pArea->cbArea; 211 } 212 213 HGSMIOFFSET HGSMIBufferInitializeSingle(const HGSMIAREA *pArea, 214 HGSMIBUFFERHEADER *pHeader, 215 HGSMISIZE cbBuffer, 216 uint8_t u8Channel, 217 uint16_t u16ChannelInfo); 218 219 int HGSMIHeapSetup(HGSMIHEAP *pHeap, 220 void *pvBase, 221 HGSMISIZE cbArea, 222 HGSMIOFFSET offBase, 223 const HGSMIENV *pEnv); 224 201 DECLINLINE(bool) HGSMIAreaContainsPointer(const HGSMIAREA *pArea, const void RT_UNTRUSTED_VOLATILE_HSTGST *pv) 202 { 203 return (uintptr_t)pv - (uintptr_t)pArea->pu8Base < pArea->cbArea; 204 } 205 206 HGSMIOFFSET HGSMIBufferInitializeSingle(const HGSMIAREA *pArea, HGSMIBUFFERHEADER *pHeader, HGSMISIZE cbBuffer, 207 uint8_t u8Channel, uint16_t u16ChannelInfo); 208 209 int HGSMIHeapSetup(HGSMIHEAP *pHeap, void *pvBase, HGSMISIZE cbArea, HGSMIOFFSET offBase, const HGSMIENV *pEnv); 225 210 void HGSMIHeapDestroy(HGSMIHEAP *pHeap); 226 227 void *HGSMIHeapBufferAlloc(HGSMIHEAP *pHeap, 228 HGSMISIZE cbBuffer); 229 230 void HGSMIHeapBufferFree(HGSMIHEAP *pHeap, 231 void *pvBuf); 232 233 void *HGSMIHeapAlloc(HGSMIHEAP *pHeap, 234 HGSMISIZE cbData, 235 uint8_t u8Channel, 236 uint16_t u16ChannelInfo); 237 238 void HGSMIHeapFree(HGSMIHEAP *pHeap, 239 void *pvData); 211 void RT_UNTRUSTED_VOLATILE_HSTGST *HGSMIHeapBufferAlloc(HGSMIHEAP *pHeap, HGSMISIZE cbBuffer); 212 void HGSMIHeapBufferFree(HGSMIHEAP *pHeap, void RT_UNTRUSTED_VOLATILE_HSTGST *pvBuf); 213 214 void RT_UNTRUSTED_VOLATILE_HOST *HGSMIHeapAlloc(HGSMIHEAP *pHeap, 215 HGSMISIZE cbData, 216 uint8_t u8Channel, 217 uint16_t u16ChannelInfo); 218 219 void HGSMIHeapFree(HGSMIHEAP *pHeap, void RT_UNTRUSTED_VOLATILE_HSTGST *pvData); 240 220 241 221 DECLINLINE(const HGSMIAREA *) HGSMIHeapArea(HGSMIHEAP *pHeap) … … 254 234 } 255 235 256 DECLINLINE(HGSMIOFFSET) HGSMIHeapBufferOffset(HGSMIHEAP *pHeap, 257 void *pvData) 236 DECLINLINE(HGSMIOFFSET) HGSMIHeapBufferOffset(HGSMIHEAP *pHeap, void RT_UNTRUSTED_VOLATILE_HOST *pvData) 258 237 { 259 238 return HGSMIBufferOffsetFromData(HGSMIHeapArea(pHeap), pvData); 260 239 } 261 240 262 HGSMICHANNEL *HGSMIChannelFindById(HGSMICHANNELINFO *pChannelInfo, 263 uint8_t u8Channel); 264 265 int HGSMIChannelRegister(HGSMICHANNELINFO *pChannelInfo, 266 uint8_t u8Channel, 267 const char *pszName, 268 PFNHGSMICHANNELHANDLER pfnChannelHandler, 269 void *pvChannelHandler); 270 271 int HGSMIBufferProcess(const HGSMIAREA *pArea, 272 HGSMICHANNELINFO *pChannelInfo, 273 HGSMIOFFSET offBuffer); 241 HGSMICHANNEL *HGSMIChannelFindById(HGSMICHANNELINFO *pChannelInfo, uint8_t u8Channel); 242 243 int HGSMIChannelRegister(HGSMICHANNELINFO *pChannelInfo, uint8_t u8Channel, const char *pszName, 244 PFNHGSMICHANNELHANDLER pfnChannelHandler, void *pvChannelHandler); 245 int HGSMIBufferProcess(const HGSMIAREA *pArea, HGSMICHANNELINFO *pChannelInfo, HGSMIOFFSET offBuffer); 274 246 RT_C_DECLS_END 275 247 -
trunk/include/VBox/Graphics/HGSMIBase.h
r69307 r71590 48 48 } 49 49 50 DECLHIDDEN(void *) VBoxHGSMIBufferAlloc(PHGSMIGUESTCOMMANDCONTEXT pCtx, 51 HGSMISIZE cbData, 52 uint8_t u8Ch, 53 uint16_t u16Op); 54 DECLHIDDEN(void) VBoxHGSMIBufferFree(PHGSMIGUESTCOMMANDCONTEXT pCtx, 55 void *pvBuffer); 56 DECLHIDDEN(int) VBoxHGSMIBufferSubmit(PHGSMIGUESTCOMMANDCONTEXT pCtx, 57 void *pvBuffer); 50 DECLHIDDEN(void RT_UNTRUSTED_VOLATILE_HOST *) VBoxHGSMIBufferAlloc(PHGSMIGUESTCOMMANDCONTEXT pCtx, HGSMISIZE cbData, 51 uint8_t u8Ch, uint16_t u16Op); 52 DECLHIDDEN(void) VBoxHGSMIBufferFree(PHGSMIGUESTCOMMANDCONTEXT pCtx, void RT_UNTRUSTED_VOLATILE_HOST *pvBuffer); 53 DECLHIDDEN(int) VBoxHGSMIBufferSubmit(PHGSMIGUESTCOMMANDCONTEXT pCtx, void RT_UNTRUSTED_VOLATILE_HOST *pvBuffer); 58 54 /** @} */ 59 55 -
trunk/include/VBox/Graphics/HGSMIHostCmd.h
r69015 r71590 38 38 * @{ */ 39 39 40 DECLHIDDEN(void) VBoxHGSMIHostCmdComplete(PHGSMIHOSTCOMMANDCONTEXT pCtx, 41 void *pvMem); 40 DECLHIDDEN(void) VBoxHGSMIHostCmdComplete(PHGSMIHOSTCOMMANDCONTEXT pCtx, void RT_UNTRUSTED_VOLATILE_HOST *pvMem); 42 41 DECLHIDDEN(void) VBoxHGSMIProcessHostQueue(PHGSMIHOSTCOMMANDCONTEXT pCtx); 43 42 -
trunk/include/VBox/Graphics/HGSMIMemAlloc.h
r69107 r71590 76 76 void HGSMIMAUninit(HGSMIMADATA *pMA); 77 77 78 void *HGSMIMAAlloc(HGSMIMADATA *pMA, HGSMISIZE cb);79 void HGSMIMAFree(HGSMIMADATA *pMA, void *pv);78 void RT_UNTRUSTED_VOLATILE_HSTGST *HGSMIMAAlloc(HGSMIMADATA *pMA, HGSMISIZE cb); 79 void HGSMIMAFree(HGSMIMADATA *pMA, void RT_UNTRUSTED_VOLATILE_GUEST *pv); 80 80 81 81 HGSMIMABLOCK *HGSMIMASearchOffset(HGSMIMADATA *pMA, HGSMIOFFSET off); -
trunk/include/VBox/Graphics/VBoxVideo.h
r70075 r71590 1358 1358 1359 1359 1360 DECLINLINE(uint8_t *) VBoxSHGSMIBufferData (const VBOXSHGSMIHEADER* pHeader) 1361 { 1362 return (uint8_t *)pHeader + sizeof (VBOXSHGSMIHEADER); 1360 DECLINLINE(uint8_t RT_UNTRUSTED_VOLATILE_GUEST *) 1361 VBoxSHGSMIBufferData(const VBOXSHGSMIHEADER RT_UNTRUSTED_VOLATILE_GUEST *pHeader) 1362 { 1363 return (uint8_t RT_UNTRUSTED_VOLATILE_GUEST *)pHeader + sizeof(VBOXSHGSMIHEADER); 1363 1364 } 1364 1365 1365 #define VBoxSHGSMIBufferHeaderSize() (sizeof 1366 1367 DECLINLINE( PVBOXSHGSMIHEADER) VBoxSHGSMIBufferHeader (const void*pvData)1368 { 1369 return ( PVBOXSHGSMIHEADER)((uint8_t *)pvData - sizeof(VBOXSHGSMIHEADER));1366 #define VBoxSHGSMIBufferHeaderSize() (sizeof(VBOXSHGSMIHEADER)) 1367 1368 DECLINLINE(VBOXSHGSMIHEADER RT_UNTRUSTED_VOLATILE_GUEST *) VBoxSHGSMIBufferHeader(const void RT_UNTRUSTED_VOLATILE_GUEST *pvData) 1369 { 1370 return (VBOXSHGSMIHEADER RT_UNTRUSTED_VOLATILE_GUEST *)((uintptr_t)pvData - sizeof(VBOXSHGSMIHEADER)); 1370 1371 } 1371 1372 … … 1391 1392 uint32_t u32Offset; 1392 1393 int32_t i32Result; 1393 } VBOXVDMA_CTL , *PVBOXVDMA_CTL;1394 } VBOXVDMA_CTL; 1394 1395 1395 1396 typedef struct VBOXVDMA_RECTL
Note:
See TracChangeset
for help on using the changeset viewer.