Changeset 914 in vbox for trunk/src/VBox/HostDrivers
- Timestamp:
- Feb 14, 2007 11:23:08 PM (18 years ago)
- Location:
- trunk/src/VBox/HostDrivers/Support
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/SUPDRVIOC.h
r912 r914 300 300 { 301 301 /** The address of the ring-0 mapping of the allocated memory. */ 302 void *pvR0;302 RTR0PTR pvR0; 303 303 /** The address of the ring-3 mapping of the allocated memory. */ 304 void *pvR3;304 RTR3PTR pvR3; 305 305 /** The physical address of the allocation. */ 306 306 RTHCPHYS HCPhys; … … 458 458 uint32_t u32SessionCookie; 459 459 /** The VM handle. */ 460 PVM pVM;460 PVMR0 pVMR0; 461 461 /** Which operation to execute. */ 462 462 uint32_t uOperation; -
trunk/src/VBox/HostDrivers/Support/SUPDRVShared.c
r679 r914 1145 1145 * Execute. 1146 1146 */ 1147 pOut->rc = pDevExt->pfnVMMR0Entry(pIn->pVM , pIn->uOperation, pIn->pvArg);1147 pOut->rc = pDevExt->pfnVMMR0Entry(pIn->pVMR0, pIn->uOperation, pIn->pvArg); 1148 1148 *pcbReturned = sizeof(*pOut); 1149 1149 return 0; … … 1837 1837 * @param pHCPhys Where to put the physical address of allocated memory. 1838 1838 */ 1839 SUPR0DECL(int) SUPR0ContAlloc(PSUPDRVSESSION pSession, unsigned cb, void **ppvR0, void **ppvR3, PRTHCPHYS pHCPhys)1839 SUPR0DECL(int) SUPR0ContAlloc(PSUPDRVSESSION pSession, unsigned cb, void **ppvR0, PRTR3PTR ppvR3, PRTHCPHYS pHCPhys) 1840 1840 { 1841 1841 int rc; … … 2832 2832 *u.pb++ = 0xf8; 2833 2833 2834 /* 2834 /* 2835 2835 * Call VMMR0Entry 2836 * We don't have to push the arguments here, but we have to 2836 * We don't have to push the arguments here, but we have to 2837 2837 * reserve some stack space for the interrupt forwarding. 2838 2838 */ -
trunk/src/VBox/HostDrivers/Support/SUPLib.cpp
r874 r914 79 79 * Structures and Typedefs * 80 80 *******************************************************************************/ 81 typedef DECLCALLBACK(int) FNCALLVMMR0(PVM pVM, unsigned uOperation, void *pvArg);81 typedef DECLCALLBACK(int) FNCALLVMMR0(PVMR0 pVMR0, unsigned uOperation, void *pvArg); 82 82 typedef FNCALLVMMR0 *PFNCALLVMMR0; 83 83 … … 356 356 } 357 357 358 SUPR3DECL(int) SUPCallVMMR0Ex(PVM pVM, unsigned uOperation, void *pvArg, unsigned cbArg)358 SUPR3DECL(int) SUPCallVMMR0Ex(PVMR0 pVMR0, unsigned uOperation, void *pvArg, unsigned cbArg) 359 359 { 360 360 /* … … 364 364 In.u32Cookie = g_u32Cookie; 365 365 In.u32SessionCookie = g_u32SessionCookie; 366 In.pVM = pVM;366 In.pVMR0 = pVMR0; 367 367 In.uOperation = uOperation; 368 368 In.cbArg = cbArg; … … 377 377 378 378 379 SUPR3DECL(int) SUPCallVMMR0(PVM pVM, unsigned uOperation, void *pvArg)379 SUPR3DECL(int) SUPCallVMMR0(PVMR0 pVMR0, unsigned uOperation, void *pvArg) 380 380 { 381 381 #ifndef VBOX_WITHOUT_IDT_PATCHING 382 return g_pfnCallVMMR0(pVM , uOperation, pvArg);382 return g_pfnCallVMMR0(pVMR0, uOperation, pvArg); 383 383 384 384 #else 385 if ( uOperation == VMMR0_DO_RAW_RUN)385 if (RT_LIKELY(uOperation == VMMR0_DO_RAW_RUN)) 386 386 { 387 387 Assert(!pvArg); 388 388 return suplibOSIOCtlFast(SUP_IOCTL_FAST_DO_RAW_RUN); 389 389 } 390 if ( uOperation == VMMR0_DO_HWACC_RUN)390 if (RT_LIKELY(uOperation == VMMR0_DO_HWACC_RUN)) 391 391 { 392 392 Assert(!pvArg); … … 398 398 return suplibOSIOCtlFast(SUP_IOCTL_FAST_DO_NOP); 399 399 } 400 return SUPCallVMMR0Ex(pVM , uOperation, pvArg, pvArg ? sizeof(pvArg) : 0);400 return SUPCallVMMR0Ex(pVMR0, uOperation, pvArg, pvArg ? sizeof(pvArg) : 0); 401 401 #endif 402 402 } … … 478 478 SUPR3DECL(void *) SUPContAlloc(unsigned cb, PRTHCPHYS pHCPhys) 479 479 { 480 return SUPContAlloc2(cb, N ULL, pHCPhys);481 } 482 483 484 SUPR3DECL(void *) SUPContAlloc2(unsigned cb, void **ppvR0, PRTHCPHYS pHCPhys)480 return SUPContAlloc2(cb, NIL_RTR0PTR, pHCPhys); 481 } 482 483 484 SUPR3DECL(void *) SUPContAlloc2(unsigned cb, PRTR0PTR pR0Ptr, PRTHCPHYS pHCPhys) 485 485 { 486 486 /* … … 490 490 AssertPtr(pHCPhys); 491 491 *pHCPhys = NIL_RTHCPHYS; 492 AssertPtrNull(pR0Ptr); 493 if (pR0Ptr) 494 *pR0Ptr = NIL_RTR0PTR; 492 495 493 496 /* … … 506 509 rc = SUPPageAlloc(In.cb >> PAGE_SHIFT, &Out.pvR3); 507 510 Out.HCPhys = (uintptr_t)Out.pvR3 + (PAGE_SHIFT * 1024); 508 Out.pvR0 = Out.pvR3;511 Out.pvR0 = (uintptr_t)Out.pvR3; 509 512 } 510 513 if (VBOX_SUCCESS(rc)) 511 514 { 512 515 *pHCPhys = (RTHCPHYS)Out.HCPhys; 513 if (p pvR0)514 *p pvR0= Out.pvR0;516 if (pR0Ptr) 517 *pR0Ptr = Out.pvR0; 515 518 return Out.pvR3; 516 519 } … … 717 720 * reg params: 718 721 * <GCC> <MSC> <argument> 719 * rdi rcx pVM 722 * rdi rcx pVMR0 720 723 * esi edx uOperation 721 724 * rdx r8 pvArg -
trunk/src/VBox/HostDrivers/Support/testcase/tstInt.cpp
r913 r914 89 89 PVMR0 pVMR0; 90 90 RTHCPHYS HCPhysVM; 91 PVM pVM = (PVM)SUPContAlloc2(sizeof(*pVM), (void **)&pVMR0, &HCPhysVM);91 PVM pVM = (PVM)SUPContAlloc2(sizeof(*pVM), &pVMR0, &HCPhysVM); 92 92 if (pVM) 93 93 { 94 94 pVM->pVMGC = 0; 95 pVM->pVMHC = pVM; 95 pVM->pVMR3 = pVM; 96 pVM->pVMR0 = pVMR0; 96 97 pVM->HCPhysVM = HCPhysVM; 97 98 pVM->pSession = pSession; … … 108 109 for (i = cIterations; i > 0; i--) 109 110 { 110 rc = SUPCallVMMR0( (PVM)pVMR0, VMMR0_DO_NOP, NULL);111 rc = SUPCallVMMR0(pVMR0, VMMR0_DO_NOP, NULL); 111 112 if (rc != VINF_SUCCESS) 112 113 { … … 130 131 { 131 132 uint64_t OneStartTick = ASMReadTSC(); 132 rc = SUPCallVMMR0( (PVM)pVMR0, VMMR0_DO_NOP, NULL);133 rc = SUPCallVMMR0(pVMR0, VMMR0_DO_NOP, NULL); 133 134 uint64_t Ticks = ASMReadTSC() - OneStartTick; 134 135 if (Ticks < MinTicks)
Note:
See TracChangeset
for help on using the changeset viewer.