Пример #1
0
 /**
  * @copydoc VBOXHGCMSVCHELPERS::pfnCall
  * Wraps to the call member function
  */
 static DECLCALLBACK(void) svcCall (void * pvService,
                                    VBOXHGCMCALLHANDLE callHandle,
                                    uint32_t u32ClientID,
                                    void *pvClient,
                                    uint32_t u32Function,
                                    uint32_t cParms,
                                    VBOXHGCMSVCPARM paParms[])
 {
     AssertLogRelReturnVoid(VALID_PTR(pvService));
     LogFlowFunc (("pvService=%p, callHandle=%p, u32ClientID=%u, pvClient=%p, u32Function=%u, cParms=%u, paParms=%p\n", pvService, callHandle, u32ClientID, pvClient, u32Function, cParms, paParms));
     SELF *pSelf = reinterpret_cast<SELF *>(pvService);
     pSelf->call(callHandle, u32ClientID, pvClient, u32Function, cParms, paParms);
     LogFlowFunc (("returning\n"));
 }
Пример #2
0
/**
 * Frees allocated pages, for bailing out on failure.
 *
 * This will not call VMSetError on failure but will use AssertLogRel instead.
 *
 * @param   pVM         The cross context VM structure.
 * @param   pAllocReq   The allocation request to undo.
 */
GMMR3DECL(void) GMMR3FreeAllocatedPages(PVM pVM, GMMALLOCATEPAGESREQ const *pAllocReq)
{
    uint32_t cb = RT_OFFSETOF(GMMFREEPAGESREQ, aPages[pAllocReq->cPages]);
    PGMMFREEPAGESREQ pReq = (PGMMFREEPAGESREQ)RTMemTmpAllocZ(cb);
    AssertLogRelReturnVoid(pReq);

    pReq->Hdr.u32Magic = SUPVMMR0REQHDR_MAGIC;
    pReq->Hdr.cbReq = cb;
    pReq->enmAccount = pAllocReq->enmAccount;
    pReq->cPages = pAllocReq->cPages;
    uint32_t iPage = pAllocReq->cPages;
    while (iPage-- > 0)
    {
        Assert(pAllocReq->aPages[iPage].idPage != NIL_GMM_PAGEID);
        pReq->aPages[iPage].idPage = pAllocReq->aPages[iPage].idPage;
    }

    int rc = VMMR3CallR0(pVM, VMMR0_DO_GMM_FREE_PAGES, 0, &pReq->Hdr);
    AssertLogRelRC(rc);

    RTMemTmpFree(pReq);
}