VirtualBox

Ignore:
Timestamp:
Mar 31, 2018 8:24:41 PM (7 years ago)
Author:
vboxsync
Message:

DevVGA,VBoxVideo: Code cleanup in progress. bugref:9094

Location:
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPCr.cpp

    r71590 r71595  
    262262
    263263
    264 static int vboxMpCrShgsmiTransportCmdSubmitDr(PVBOXMP_CRSHGSMITRANSPORT pCon, PVBOXVDMACBUF_DR pDr,
     264static int vboxMpCrShgsmiTransportCmdSubmitDr(PVBOXMP_CRSHGSMITRANSPORT pCon, VBOXVDMACBUF_DR RT_UNTRUSTED_VOLATILE_HOST *pDr,
    265265                                              PFNVBOXVDMADDICMDCOMPLETE_DPC pfnComplete)
    266266{
     
    281281}
    282282
    283 static int vboxMpCrShgsmiTransportCmdSubmitDmaCmd(PVBOXMP_CRSHGSMITRANSPORT pCon, PVBOXVDMACMD pHdr,
     283static int vboxMpCrShgsmiTransportCmdSubmitDmaCmd(PVBOXMP_CRSHGSMITRANSPORT pCon, VBOXVDMACMD RT_UNTRUSTED_VOLATILE_HOST *pHdr,
    284284                                                  PFNVBOXVDMADDICMDCOMPLETE_DPC pfnComplete)
    285285{
    286     PVBOXVDMACBUF_DR pDr = VBOXVDMACBUF_DR_FROM_TAIL(pHdr);
     286    VBOXVDMACBUF_DR RT_UNTRUSTED_VOLATILE_HOST *pDr = VBOXVDMACBUF_DR_FROM_TAIL(pHdr);
    287287    return vboxMpCrShgsmiTransportCmdSubmitDr(pCon, pDr, pfnComplete);
    288288}
    289289
    290 static void vboxMpCrShgsmiTransportCmdTermDmaCmd(PVBOXMP_CRSHGSMITRANSPORT pCon, PVBOXVDMACMD pHdr)
    291 {
    292     PVBOXVDMACBUF_DR pDr = VBOXVDMACBUF_DR_FROM_TAIL(pHdr);
     290static void vboxMpCrShgsmiTransportCmdTermDmaCmd(PVBOXMP_CRSHGSMITRANSPORT pCon, VBOXVDMACMD RT_UNTRUSTED_VOLATILE_HOST *pHdr)
     291{
     292    VBOXVDMACBUF_DR RT_UNTRUSTED_VOLATILE_HOST *pDr = VBOXVDMACBUF_DR_FROM_TAIL(pHdr);
    293293    PVBOXMP_DEVEXT pDevExt = pCon->pDevExt;
    294     vboxVdmaCBufDrFree (&pDevExt->u.primary.Vdma, pDr);
     294    vboxVdmaCBufDrFree(&pDevExt->u.primary.Vdma, pDr);
    295295}
    296296
     
    308308    Assert(KeGetCurrentIrql() == DISPATCH_LEVEL);
    309309
    310     PVBOXMP_CRSHGSMITRANSPORT pCon = (PVBOXMP_CRSHGSMITRANSPORT)pvContext;
    311     PVBOXVDMACBUF_DR pDr = VBOXVDMACBUF_DR_FROM_DDI_CMD(pDdiCmd);
    312     PVBOXVDMACMD pHdr = VBOXVDMACBUF_DR_TAIL(pDr, VBOXVDMACMD);
    313     VBOXVDMACMD_CHROMIUM_CMD *pBody = VBOXMP_CRSHGSMICON_DR_GET_CRCMD(pHdr);
    314     const UINT cBuffers = 2;
     310    PVBOXMP_CRSHGSMITRANSPORT               pCon = (PVBOXMP_CRSHGSMITRANSPORT)pvContext;
     311    PVBOXVDMACBUF_DR                        pDr  = VBOXVDMACBUF_DR_FROM_DDI_CMD(pDdiCmd);
     312    VBOXVDMACMD RT_UNTRUSTED_VOLATILE_HOST *pHdr = VBOXVDMACBUF_DR_TAIL(pDr, VBOXVDMACMD);
     313    VBOXVDMACMD_CHROMIUM_CMD               *pBody = VBOXMP_CRSHGSMICON_DR_GET_CRCMD(pHdr);
     314    const UINT                              cBuffers = 2;
    315315    Assert(pBody->cBuffers == cBuffers);
    316     PVBOXMP_CRHGSMICMD_READ pWrData = VBOXMP_CRSHGSMICON_DR_GET_CMDBUF(pHdr, cBuffers, VBOXMP_CRHGSMICMD_READ);
    317     CRVBOXHGSMIREAD *pCmd = &pWrData->Cmd;
    318     VBOXVDMACMD_CHROMIUM_BUFFER *pBufCmd = &pBody->aBuffers[0];
     316
     317    PVBOXMP_CRHGSMICMD_READ                 pWrData = VBOXMP_CRSHGSMICON_DR_GET_CMDBUF(pHdr, cBuffers, VBOXMP_CRHGSMICMD_READ);
     318    CRVBOXHGSMIREAD                        *pCmd    = &pWrData->Cmd;
     319    VBOXVDMACMD_CHROMIUM_BUFFER            *pBufCmd = &pBody->aBuffers[0];
    319320    Assert(pBufCmd->cbBuffer == sizeof (CRVBOXHGSMIREAD));
    320     CRVBOXHGSMIREAD * pWr = (CRVBOXHGSMIREAD*)vboxMpCrShgsmiTransportBufFromOffset(pCon, pBufCmd->offBuffer);
     321
     322    CRVBOXHGSMIREAD                        *pWr = (CRVBOXHGSMIREAD*)vboxMpCrShgsmiTransportBufFromOffset(pCon, pBufCmd->offBuffer);
    321323    PFNVBOXMP_CRSHGSMITRANSPORT_SENDREADASYNC_COMPLETION pfnCompletion = (PFNVBOXMP_CRSHGSMITRANSPORT_SENDREADASYNC_COMPLETION)pBufCmd->u64GuestData;
    322     VBOXVDMACMD_CHROMIUM_BUFFER *pRxBuf = &pBody->aBuffers[1];
    323     PVBOXMP_CRSHGSMICON_BUFDR pWbDr = (PVBOXMP_CRSHGSMICON_BUFDR)pRxBuf->u64GuestData;
    324     void RT_UNTRUSTED_VOLATILE_HOST *pvRx = NULL;
    325     uint32_t cbRx = 0;
     324    VBOXVDMACMD_CHROMIUM_BUFFER            *pRxBuf = &pBody->aBuffers[1];
     325    PVBOXMP_CRSHGSMICON_BUFDR               pWbDr = (PVBOXMP_CRSHGSMICON_BUFDR)pRxBuf->u64GuestData;
     326    void RT_UNTRUSTED_VOLATILE_HOST        *pvRx = NULL;
     327    uint32_t                                cbRx = 0;
    326328
    327329    int rc = pDr->rc;
     
    362364    const uint32_t cBuffers = 2;
    363365    const uint32_t cbCmd = VBOXMP_CRSHGSMICON_DR_SIZE(cBuffers, sizeof (VBOXMP_CRHGSMICMD_READ), cbContextData);
    364     PVBOXVDMACMD pHdr = VBOXVDMACBUF_DR_TAIL(pDr, VBOXVDMACMD);
    365     VBOXVDMACMD_CHROMIUM_CMD *pBody = VBOXMP_CRSHGSMICON_DR_GET_CRCMD(pHdr);
    366     PVBOXMP_CRHGSMICMD_READ pWrData = VBOXMP_CRSHGSMICON_DR_GET_CMDBUF(pHdr, cBuffers, VBOXMP_CRHGSMICMD_READ);
    367     CRVBOXHGSMIREAD *pCmd = &pWrData->Cmd;
     366    VBOXVDMACMD RT_UNTRUSTED_VOLATILE_HOST *pHdr    = VBOXVDMACBUF_DR_TAIL(pDr, VBOXVDMACMD);
     367    VBOXVDMACMD_CHROMIUM_CMD               *pBody  = VBOXMP_CRSHGSMICON_DR_GET_CRCMD(pHdr);
     368    PVBOXMP_CRHGSMICMD_READ                 pWrData = VBOXMP_CRSHGSMICON_DR_GET_CMDBUF(pHdr, cBuffers, VBOXMP_CRHGSMICMD_READ);
     369    CRVBOXHGSMIREAD                        *pCmd    = &pWrData->Cmd;
    368370
    369371    if (cbCmd > cbContextData)
     
    408410static int vboxMpCrShgsmiTransportCmdSubmitReadAsync(PVBOXMP_CRSHGSMITRANSPORT pCon, void *pvContext)
    409411{
    410     VBOXVDMACMD* pHdr = VBOXMP_CRSHGSMICON_DR_GET_FROM_CMDCTX(pvContext, 2, sizeof (VBOXMP_CRHGSMICMD_READ));
     412    VBOXVDMACMD RT_UNTRUSTED_VOLATILE_HOST *pHdr = VBOXMP_CRSHGSMICON_DR_GET_FROM_CMDCTX(pvContext, 2, sizeof(VBOXMP_CRHGSMICMD_READ));
    411413    return vboxMpCrShgsmiTransportCmdSubmitDmaCmd(pCon, pHdr, vboxMpCrShgsmiTransportSendReadAsyncCompletion);
    412414}
     
    437439    Assert(KeGetCurrentIrql() == DISPATCH_LEVEL);
    438440
    439     PVBOXMP_CRSHGSMITRANSPORT pCon = (PVBOXMP_CRSHGSMITRANSPORT)pvContext;
    440     PVBOXVDMACBUF_DR pDr = VBOXVDMACBUF_DR_FROM_DDI_CMD(pDdiCmd);
    441     PVBOXVDMACMD pHdr = VBOXVDMACBUF_DR_TAIL(pDr, VBOXVDMACMD);
    442     VBOXVDMACMD_CHROMIUM_CMD *pBody = VBOXMP_CRSHGSMICON_DR_GET_CRCMD(pHdr);
     441    PVBOXMP_CRSHGSMITRANSPORT               pCon = (PVBOXMP_CRSHGSMITRANSPORT)pvContext;
     442    PVBOXVDMACBUF_DR                        pDr = VBOXVDMACBUF_DR_FROM_DDI_CMD(pDdiCmd);
     443    VBOXVDMACMD RT_UNTRUSTED_VOLATILE_HOST *pHdr = VBOXVDMACBUF_DR_TAIL(pDr, VBOXVDMACMD);
     444    VBOXVDMACMD_CHROMIUM_CMD               *pBody = VBOXMP_CRSHGSMICON_DR_GET_CRCMD(pHdr);
    443445    const UINT cBuffers = 3;
    444446    Assert(pBody->cBuffers == cBuffers);
    445     PVBOXMP_CRHGSMICMD_WRITEREAD pWrData = VBOXMP_CRSHGSMICON_DR_GET_CMDBUF(pHdr, cBuffers, VBOXMP_CRHGSMICMD_WRITEREAD);
    446     CRVBOXHGSMIWRITEREAD *pCmd = &pWrData->Cmd;
    447     VBOXVDMACMD_CHROMIUM_BUFFER *pBufCmd = &pBody->aBuffers[0];
     447
     448    PVBOXMP_CRHGSMICMD_WRITEREAD            pWrData = VBOXMP_CRSHGSMICON_DR_GET_CMDBUF(pHdr, cBuffers, VBOXMP_CRHGSMICMD_WRITEREAD);
     449    CRVBOXHGSMIWRITEREAD                   *pCmd = &pWrData->Cmd;
     450    VBOXVDMACMD_CHROMIUM_BUFFER            *pBufCmd = &pBody->aBuffers[0];
    448451    Assert(pBufCmd->cbBuffer == sizeof (CRVBOXHGSMIWRITEREAD));
    449     CRVBOXHGSMIWRITEREAD * pWr = (CRVBOXHGSMIWRITEREAD*)vboxMpCrShgsmiTransportBufFromOffset(pCon, pBufCmd->offBuffer);
    450     VBOXVDMACMD_CHROMIUM_BUFFER *pRxBuf = &pBody->aBuffers[2];
    451     PVBOXMP_CRSHGSMICON_BUFDR pWbDr = (PVBOXMP_CRSHGSMICON_BUFDR)pRxBuf->u64GuestData;
     452
     453    CRVBOXHGSMIWRITEREAD                   *pWr = (CRVBOXHGSMIWRITEREAD*)vboxMpCrShgsmiTransportBufFromOffset(pCon, pBufCmd->offBuffer);
     454    VBOXVDMACMD_CHROMIUM_BUFFER            *pRxBuf = &pBody->aBuffers[2];
     455    PVBOXMP_CRSHGSMICON_BUFDR               pWbDr = (PVBOXMP_CRSHGSMICON_BUFDR)pRxBuf->u64GuestData;
    452456    PFNVBOXMP_CRSHGSMITRANSPORT_SENDWRITEREADASYNC_COMPLETION pfnCompletion = (PFNVBOXMP_CRSHGSMITRANSPORT_SENDWRITEREADASYNC_COMPLETION)pBufCmd->u64GuestData;
    453     void RT_UNTRUSTED_VOLATILE_HOST *pvRx = NULL;
    454     uint32_t cbRx = 0;
     457    void RT_UNTRUSTED_VOLATILE_HOST        *pvRx = NULL;
     458    uint32_t                                cbRx = 0;
    455459
    456460    int rc = pDr->rc;
     
    522526    Assert(KeGetCurrentIrql() == DISPATCH_LEVEL);
    523527
    524     PVBOXMP_CRSHGSMITRANSPORT pCon = (PVBOXMP_CRSHGSMITRANSPORT)pvContext;
    525     PVBOXVDMACBUF_DR pDr = VBOXVDMACBUF_DR_FROM_DDI_CMD(pDdiCmd);
    526     PVBOXVDMACMD pHdr = VBOXVDMACBUF_DR_TAIL(pDr, VBOXVDMACMD);
    527     VBOXVDMACMD_CHROMIUM_CMD *pBody = VBOXMP_CRSHGSMICON_DR_GET_CRCMD(pHdr);
    528     const UINT cBuffers = 2;
     528    PVBOXMP_CRSHGSMITRANSPORT               pCon = (PVBOXMP_CRSHGSMITRANSPORT)pvContext;
     529    PVBOXVDMACBUF_DR                        pDr = VBOXVDMACBUF_DR_FROM_DDI_CMD(pDdiCmd);
     530    VBOXVDMACMD RT_UNTRUSTED_VOLATILE_HOST *pHdr = VBOXVDMACBUF_DR_TAIL(pDr, VBOXVDMACMD);
     531    VBOXVDMACMD_CHROMIUM_CMD               *pBody = VBOXMP_CRSHGSMICON_DR_GET_CRCMD(pHdr);
     532    const UINT                              cBuffers = 2;
    529533    Assert(pBody->cBuffers == cBuffers);
    530     PVBOXMP_CRHGSMICMD_WRITE pWrData = VBOXMP_CRSHGSMICON_DR_GET_CMDBUF(pHdr, cBuffers, VBOXMP_CRHGSMICMD_WRITE);
    531     CRVBOXHGSMIWRITE *pCmd = &pWrData->Cmd;
    532     VBOXVDMACMD_CHROMIUM_BUFFER *pBufCmd = &pBody->aBuffers[0];
     534
     535    PVBOXMP_CRHGSMICMD_WRITE                pWrData = VBOXMP_CRSHGSMICON_DR_GET_CMDBUF(pHdr, cBuffers, VBOXMP_CRHGSMICMD_WRITE);
     536    CRVBOXHGSMIWRITE                       *pCmd = &pWrData->Cmd;
     537    VBOXVDMACMD_CHROMIUM_BUFFER            *pBufCmd = &pBody->aBuffers[0];
    533538    Assert(pBufCmd->cbBuffer == sizeof (CRVBOXHGSMIWRITE));
    534539    PFNVBOXMP_CRSHGSMITRANSPORT_SENDWRITEASYNC_COMPLETION pfnCompletion = (PFNVBOXMP_CRSHGSMITRANSPORT_SENDWRITEASYNC_COMPLETION)pBufCmd->u64GuestData;
     
    601606    }
    602607
    603     PVBOXVDMACMD pHdr = VBOXVDMACBUF_DR_TAIL(pDr, VBOXVDMACMD);
    604     VBOXVDMACMD_CHROMIUM_CMD *pBody = VBOXMP_CRSHGSMICON_DR_GET_CRCMD(pHdr);
    605     PVBOXMP_CRHGSMICMD_WRITEREAD pWrData = VBOXMP_CRSHGSMICON_DR_GET_CMDBUF(pHdr, cBuffers, VBOXMP_CRHGSMICMD_WRITEREAD);
    606     CRVBOXHGSMIWRITEREAD *pCmd = &pWrData->Cmd;
     608    VBOXVDMACMD RT_UNTRUSTED_VOLATILE_HOST *pHdr = VBOXVDMACBUF_DR_TAIL(pDr, VBOXVDMACMD);
     609    VBOXVDMACMD_CHROMIUM_CMD               *pBody = VBOXMP_CRSHGSMICON_DR_GET_CRCMD(pHdr);
     610    PVBOXMP_CRHGSMICMD_WRITEREAD            pWrData = VBOXMP_CRSHGSMICON_DR_GET_CMDBUF(pHdr, cBuffers, VBOXMP_CRHGSMICMD_WRITEREAD);
     611    CRVBOXHGSMIWRITEREAD                   *pCmd = &pWrData->Cmd;
    607612
    608613    pDr->fFlags = VBOXVDMACBUF_FLAG_BUF_FOLLOWS_DR;
     
    698703    }
    699704
    700     PVBOXVDMACMD pHdr = VBOXVDMACBUF_DR_TAIL(pDr, VBOXVDMACMD);
    701     VBOXVDMACMD_CHROMIUM_CMD *pBody = VBOXMP_CRSHGSMICON_DR_GET_CRCMD(pHdr);
    702     PVBOXMP_CRHGSMICMD_WRITE pWrData = VBOXMP_CRSHGSMICON_DR_GET_CMDBUF(pHdr, cBuffers, VBOXMP_CRHGSMICMD_WRITE);
    703     CRVBOXHGSMIWRITE *pCmd = &pWrData->Cmd;
     705    VBOXVDMACMD RT_UNTRUSTED_VOLATILE_HOST *pHdr = VBOXVDMACBUF_DR_TAIL(pDr, VBOXVDMACMD);
     706    VBOXVDMACMD_CHROMIUM_CMD               *pBody = VBOXMP_CRSHGSMICON_DR_GET_CRCMD(pHdr);
     707    PVBOXMP_CRHGSMICMD_WRITE                pWrData = VBOXMP_CRSHGSMICON_DR_GET_CMDBUF(pHdr, cBuffers, VBOXMP_CRHGSMICMD_WRITE);
     708    CRVBOXHGSMIWRITE                       *pCmd = &pWrData->Cmd;
    704709
    705710    pDr->fFlags = VBOXVDMACBUF_FLAG_BUF_FOLLOWS_DR;
     
    775780void VBoxMpCrShgsmiTransportCmdTermWriteReadAsync(PVBOXMP_CRSHGSMITRANSPORT pCon, void *pvContext)
    776781{
    777     VBOXVDMACMD* pHdr = VBOXMP_CRSHGSMICON_DR_GET_FROM_CMDCTX(pvContext, 3, sizeof (VBOXMP_CRHGSMICMD_WRITEREAD));
     782    VBOXVDMACMD RT_UNTRUSTED_VOLATILE_HOST *pHdr = VBOXMP_CRSHGSMICON_DR_GET_FROM_CMDCTX(pvContext, 3,
     783                                                                                         sizeof(VBOXMP_CRHGSMICMD_WRITEREAD));
    778784    vboxMpCrShgsmiTransportCmdTermDmaCmd(pCon, pHdr);
    779785}
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPMisc.cpp

    r71590 r71595  
    13571357
    13581358    PVBOXVDMACBUF_DR pDr = (PVBOXVDMACBUF_DR)pvContext;
    1359     PVBOXVDMACMD pHdr = VBOXVDMACBUF_DR_TAIL(pDr, VBOXVDMACMD);
     1359    VBOXVDMACMD RT_UNTRUSTED_VOLATILE_HOST *pHdr = VBOXVDMACBUF_DR_TAIL(pDr, VBOXVDMACMD);
    13601360    VBOXVDMACMD_CHROMIUM_CMD *pBody = VBOXVDMACMD_BODY(pHdr, VBOXVDMACMD_CHROMIUM_CMD);
    13611361    UINT cBufs = pBody->cBuffers;
     
    14001400        pDr->rc = VERR_NOT_IMPLEMENTED;
    14011401
    1402         PVBOXVDMACMD pHdr = VBOXVDMACBUF_DR_TAIL(pDr, VBOXVDMACMD);
     1402        VBOXVDMACMD RT_UNTRUSTED_VOLATILE_HOST *pHdr = VBOXVDMACBUF_DR_TAIL(pDr, VBOXVDMACMD);
    14031403        pHdr->enmType = VBOXVDMACMD_TYPE_CHROMIUM_CMD;
    14041404        pHdr->u32CmdSpecific = 0;
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVModes.cpp

    r71196 r71595  
    561561    PVBOXWDDMCHILDSTATUSCB pCtx = (PVBOXWDDMCHILDSTATUSCB)pvContext;
    562562    PVBOXVDMACBUF_DR pDr = pCtx->pDr;
    563     PVBOXVDMACMD pHdr = VBOXVDMACBUF_DR_TAIL(pDr, VBOXVDMACMD);
     563    VBOXVDMACMD RT_UNTRUSTED_VOLATILE_HOST *pHdr = VBOXVDMACBUF_DR_TAIL(pDr, VBOXVDMACMD);
    564564    VBOXVDMACMD_CHILD_STATUS_IRQ *pBody = VBOXVDMACMD_BODY(pHdr, VBOXVDMACMD_CHILD_STATUS_IRQ);
    565565
     
    590590        pDr->rc = VERR_NOT_IMPLEMENTED;
    591591
    592         PVBOXVDMACMD pHdr = VBOXVDMACBUF_DR_TAIL(pDr, VBOXVDMACMD);
     592        VBOXVDMACMD RT_UNTRUSTED_VOLATILE_HOST *pHdr = VBOXVDMACBUF_DR_TAIL(pDr, VBOXVDMACMD);
    593593        pHdr->enmType = VBOXVDMACMD_TYPE_CHILD_STATUS_IRQ;
    594594        pHdr->u32CmdSpecific = 0;
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp

    r71590 r71595  
    39633963                SIZE_T cbTransfered = 0;
    39643964                SIZE_T cbTransferSize = pBuildPagingBuffer->Transfer.TransferSize;
    3965                 PVBOXVDMACMD pHdr = VBOXVDMACBUF_DR_TAIL(pDr, VBOXVDMACMD);
     3965                VBOXVDMACMD RT_UNTRUSTED_VOLATILE_HOST *pHdr = VBOXVDMACBUF_DR_TAIL(pDr, VBOXVDMACMD);
    39663966                do
    39673967                {
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette