VirtualBox

Changeset 17367 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Mar 5, 2009 12:50:38 AM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
43766
Message:

VMM: Added VMMR3CallR0 for use with operations which may make host calls (see VMMR0.cpp).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMM.cpp

    r17284 r17367  
    12541254
    12551255/**
     1256 * Wrapper for SUPCallVMMR0Ex which will deal with
     1257 * VINF_VMM_CALL_HOST returns.
     1258 *
     1259 * @returns VBox status code.
     1260 * @param   pVM         The VM to operate on.
     1261 * @param   uOperation  Operation to execute.
     1262 * @param   u64Arg      Constant argument.
     1263 * @param   pReqHdr     Pointer to a request header. See SUPCallVMMR0Ex for
     1264 *                      details.
     1265 */
     1266VMMR3DECL(int) VMMR3CallR0(PVM pVM, uint32_t uOperation, uint64_t u64Arg, PSUPVMMR0REQHDR pReqHdr)
     1267{
     1268    /*
     1269     * Call Ring-0 entry with init code.
     1270     */
     1271    int rc;
     1272    for (;;)
     1273    {
     1274#ifdef NO_SUPCALLR0VMM
     1275        rc = VERR_GENERAL_FAILURE;
     1276#else
     1277        rc = SUPCallVMMR0Ex(pVM->pVMR0, uOperation, u64Arg, pReqHdr);
     1278#endif
     1279        if (    pVM->vmm.s.pR0LoggerR3
     1280            &&  pVM->vmm.s.pR0LoggerR3->Logger.offScratch > 0)
     1281            RTLogFlushToLogger(&pVM->vmm.s.pR0LoggerR3->Logger, NULL);
     1282        if (rc != VINF_VMM_CALL_HOST)
     1283            break;
     1284        rc = vmmR3ServiceCallHostRequest(pVM);
     1285        if (RT_FAILURE(rc) || (rc >= VINF_EM_FIRST && rc <= VINF_EM_LAST))
     1286            break;
     1287        /* Resume R0 */
     1288    }
     1289
     1290    AssertLogRelMsgReturn(rc == VINF_SUCCESS || VBOX_FAILURE(rc),
     1291                          ("uOperation=%u rc=%Rrc\n", uOperation, rc),
     1292                          VERR_INTERNAL_ERROR);
     1293    return rc;
     1294}
     1295
     1296
     1297/**
    12561298 * Resumes executing hypervisor code when interrupted by a queue flush or a
    12571299 * debug event.
     
    14361478            return VERR_VMM_RING0_ASSERTION;
    14371479
    1438         /* 
    1439          * A forced switch to ring 0 for preemption purposes. 
     1480        /*
     1481         * A forced switch to ring 0 for preemption purposes.
    14401482         */
    14411483        case VMMCALLHOST_VM_R0_PREEMPT:
Note: See TracChangeset for help on using the changeset viewer.

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