Changeset 397 in vbox for trunk/src/VBox/HostDrivers
- Timestamp:
- Jan 28, 2007 2:34:06 AM (18 years ago)
- Location:
- trunk/src/VBox/HostDrivers/Support
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/SUPDRVIOC.h
r42 r397 132 132 #define SUP_IOCTL_SET_VM_FOR_FAST SUP_CTL_CODE(20) 133 133 134 /** Fast path IOCtl: VMMR0_DO_R UN_GC*/134 /** Fast path IOCtl: VMMR0_DO_RAW_RUN */ 135 135 #define SUP_IOCTL_FAST_DO_RAW_RUN SUP_CTL_CODE_FAST(64) 136 /** Fast path IOCtl: VMMR0_ HWACC_RUN_GUEST*/136 /** Fast path IOCtl: VMMR0_DO_HWACC_RUN */ 137 137 #define SUP_IOCTL_FAST_DO_HWACC_RUN SUP_CTL_CODE_FAST(65) 138 /** Just a NOP call for profiling the latency of a fast ioctl call to VMMR0. */ 139 #define SUP_IOCTL_FAST_DO_NOP SUP_CTL_CODE_FAST(66) 138 140 139 141 -
trunk/src/VBox/HostDrivers/Support/SUPDRVShared.c
r392 r397 559 559 int VBOXCALL supdrvIOCtlFast(unsigned uIOCtl, PSUPDRVDEVEXT pDevExt, PSUPDRVSESSION pSession) 560 560 { 561 if ( !pSession->pVM 562 || pDevExt->pfnVMMR0Entry) 563 return VERR_INTERNAL_ERROR; 564 switch (uIOCtl) 565 { 566 case SUP_IOCTL_FAST_DO_RAW_RUN: 567 return pDevExt->pfnVMMR0Entry(pSession->pVM, VMMR0_DO_RUN_GC, NULL); 568 case SUP_IOCTL_FAST_DO_HWACC_RUN: 569 return pDevExt->pfnVMMR0Entry(pSession->pVM, VMMR0_HWACC_RUN_GUEST, NULL); 570 default: 571 return VERR_INTERNAL_ERROR; 572 } 561 /* 562 * Disable interrupts before invoking VMMR0Entry() because it ASSUMES 563 * that interrupts are disabled. (We check the two prereqs after doing 564 * this only to allow the compiler to optimize things better.) 565 */ 566 RTCCUINTREG uFlags = ASMGetFlags(); 567 ASMIntDisable(); 568 569 int rc; 570 if (RT_LIKELY(pSession->pVM && pDevExt->pfnVMMR0Entry)) 571 { 572 switch (uIOCtl) 573 { 574 case SUP_IOCTL_FAST_DO_RAW_RUN: 575 rc = pDevExt->pfnVMMR0Entry(pSession->pVM, VMMR0_DO_RAW_RUN, NULL); 576 break; 577 case SUP_IOCTL_FAST_DO_HWACC_RUN: 578 rc = pDevExt->pfnVMMR0Entry(pSession->pVM, VMMR0_DO_HWACC_RUN, NULL); 579 break; 580 case SUP_IOCTL_FAST_DO_NOP: 581 rc = pDevExt->pfnVMMR0Entry(pSession->pVM, VMMR0_DO_NOP, NULL); 582 break; 583 default: 584 rc = VERR_INTERNAL_ERROR; 585 break; 586 } 587 } 588 else 589 rc = VERR_INTERNAL_ERROR; 590 591 ASMSetFlags(uFlags); 592 return rc; 573 593 } 574 594 #endif /* VBOX_WITHOUT_IDT_PATCHING */ -
trunk/src/VBox/HostDrivers/Support/SUPLib.cpp
r339 r397 381 381 #ifndef VBOX_WITHOUT_IDT_PATCHING 382 382 return g_pfnCallVMMR0(pVM, uOperation, pvArg); 383 383 384 #else 384 if (uOperation == VMMR0_DO_R UN_GC)385 if (uOperation == VMMR0_DO_RAW_RUN) 385 386 { 386 387 Assert(!pvArg); 387 388 return suplibOSIOCtlFast(SUP_IOCTL_FAST_DO_RAW_RUN); 388 389 } 389 if (uOperation == VMMR0_ HWACC_RUN_GUEST)390 if (uOperation == VMMR0_DO_HWACC_RUN) 390 391 { 391 392 Assert(!pvArg); 392 393 return suplibOSIOCtlFast(SUP_IOCTL_FAST_DO_HWACC_RUN); 394 } 395 if (uOperation == VMMR0_DO_NOP) 396 { 397 Assert(!pvArg); 398 return suplibOSIOCtlFast(SUP_IOCTL_FAST_DO_NOP); 393 399 } 394 400 return SUPCallVMMR0Ex(pVM, uOperation, pvArg, pvArg ? sizeof(pvArg) : 0); -
trunk/src/VBox/HostDrivers/Support/darwin/SUPDrv-darwin.cpp
r387 r397 430 430 * the session and iCmd, and only returns a VBox status code. 431 431 */ 432 if ( iCmd == 1 433 || iCmd == 1) 432 if ( iCmd == SUP_IOCTL_FAST_DO_RAW_RUN 433 || iCmd == SUP_IOCTL_FAST_DO_HWACC_RUN 434 || iCmd == SUP_IOCTL_FAST_DO_NOP) 434 435 return supdrvIOCtlFast(iCmd, &g_DevExt, pSession); 435 436 return VBoxSupDrvIOCtlSlow(pSession, iCmd, pData, pProcess); -
trunk/src/VBox/HostDrivers/Support/testcase/tstInt.cpp
r1 r397 89 89 for (int i = cIterations; i > 0; i--) 90 90 { 91 rc = SUPCallVMMR0(&vm, 0xdeadbeef, NULL); 92 //RTPrintf("tstInt: SUPCallVMMR0 -> rc=%Vrc i=%d\n", rc, i); 91 rc = SUPCallVMMR0(&vm, VMMR0_DO_NOP, NULL); 92 if (rc != VINF_SUCCESS) 93 { 94 RTPrintf("tstInt: SUPCallVMMR0 -> rc=%Vrc i=%d Expected VINF_SUCCESS!\n", rc, i); 95 break;s 96 } 93 97 } 94 98 RTPrintf("tstInt: Performed SUPCallVMMR0 %d times (rc=%Vrc)\n", cIterations, rc);
Note:
See TracChangeset
for help on using the changeset viewer.