Changeset 20864 in vbox for trunk/src/VBox/HostDrivers
- Timestamp:
- Jun 23, 2009 7:19:42 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 49009
- Location:
- trunk/src/VBox/HostDrivers/Support
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/SUPLib.cpp
r20862 r20864 149 149 150 150 151 SUPR3DECL(int) SUP Install(void)151 SUPR3DECL(int) SUPR3Install(void) 152 152 { 153 153 return suplibOsInstall(); … … 155 155 156 156 157 SUPR3DECL(int) SUP Uninstall(void)157 SUPR3DECL(int) SUPR3Uninstall(void) 158 158 { 159 159 return suplibOsUninstall(); … … 486 486 487 487 488 SUPR3DECL(int) SUP Term(bool fForced)488 SUPR3DECL(int) SUPR3Term(bool fForced) 489 489 { 490 490 /* 491 491 * Verify state. 492 492 */ 493 AssertMsg(g_cInits > 0, ("SUP Term() is called before SUPR3Init()!\n"));493 AssertMsg(g_cInits > 0, ("SUPR3Term() is called before SUPR3Init()!\n")); 494 494 if (g_cInits == 0) 495 495 return VERR_WRONG_ORDER; … … 526 526 527 527 528 SUPR3DECL(SUPPAGINGMODE) SUP GetPagingMode(void)528 SUPR3DECL(SUPPAGINGMODE) SUPR3GetPagingMode(void) 529 529 { 530 530 /* fake */ … … 550 550 || RT_FAILURE(Req.Hdr.rc)) 551 551 { 552 LogRel(("SUP GetPagingMode: %Rrc %Rrc\n", rc, Req.Hdr.rc));552 LogRel(("SUPR3GetPagingMode: %Rrc %Rrc\n", rc, Req.Hdr.rc)); 553 553 Req.u.Out.enmMode = SUPPAGINGMODE_INVALID; 554 554 } … … 568 568 569 569 570 SUPR3DECL(int) SUP CallVMMR0Fast(PVMR0 pVMR0, unsigned uOperation, VMCPUID idCpu)570 SUPR3DECL(int) SUPR3CallVMMR0Fast(PVMR0 pVMR0, unsigned uOperation, VMCPUID idCpu) 571 571 { 572 572 if (RT_LIKELY(uOperation == SUP_VMMR0_DO_RAW_RUN)) … … 582 582 583 583 584 SUPR3DECL(int) SUP CallVMMR0Ex(PVMR0 pVMR0, VMCPUID idCpu, unsigned uOperation, uint64_t u64Arg, PSUPVMMR0REQHDR pReqHdr)584 SUPR3DECL(int) SUPR3CallVMMR0Ex(PVMR0 pVMR0, VMCPUID idCpu, unsigned uOperation, uint64_t u64Arg, PSUPVMMR0REQHDR pReqHdr) 585 585 { 586 586 /* … … 645 645 646 646 647 SUPR3DECL(int) SUP CallVMMR0(PVMR0 pVMR0, VMCPUID idCpu, unsigned uOperation, void *pvArg)647 SUPR3DECL(int) SUPR3CallVMMR0(PVMR0 pVMR0, VMCPUID idCpu, unsigned uOperation, void *pvArg) 648 648 { 649 649 /* … … 655 655 ("%#x\n", uOperation), 656 656 VERR_INTERNAL_ERROR); 657 return SUP CallVMMR0Ex(pVMR0, idCpu, uOperation, (uintptr_t)pvArg, NULL);658 } 659 660 661 SUPR3DECL(int) SUP SetVMForFastIOCtl(PVMR0 pVMR0)657 return SUPR3CallVMMR0Ex(pVMR0, idCpu, uOperation, (uintptr_t)pvArg, NULL); 658 } 659 660 661 SUPR3DECL(int) SUPR3SetVMForFastIOCtl(PVMR0 pVMR0) 662 662 { 663 663 if (RT_UNLIKELY(g_u32FakeMode)) … … 834 834 835 835 836 SUPR3DECL(int) SUP PageAlloc(size_t cPages, void **ppvPages)836 SUPR3DECL(int) SUPR3PageAlloc(size_t cPages, void **ppvPages) 837 837 { 838 838 /* … … 850 850 851 851 852 SUPR3DECL(int) SUP PageFree(void *pvPages, size_t cPages)852 SUPR3DECL(int) SUPR3PageFree(void *pvPages, size_t cPages) 853 853 { 854 854 /* … … 876 876 * On entry this will point to an array of with cbMemory >> PAGE_SHIFT entries. 877 877 */ 878 intsupR3PageLock(void *pvStart, size_t cPages, PSUPPAGE paPages)878 SUPR3DECL(int) supR3PageLock(void *pvStart, size_t cPages, PSUPPAGE paPages) 879 879 { 880 880 /* … … 938 938 * down by SUPPageLock(). 939 939 */ 940 intsupR3PageUnlock(void *pvStart)940 SUPR3DECL(int) supR3PageUnlock(void *pvStart) 941 941 { 942 942 /* … … 968 968 969 969 970 SUPR3DECL(int) SUP PageAllocLockedEx(size_t cPages, void **ppvPages, PSUPPAGE paPages)970 SUPR3DECL(int) SUPR3PageAllocLockedEx(size_t cPages, void **ppvPages, PSUPPAGE paPages) 971 971 { 972 972 return SUPR3PageAllocEx(cPages, 0 /*fFlags*/, ppvPages, NULL /*pR0Ptr*/, paPages); … … 974 974 975 975 976 SUPR3DECL(int) SUP PageFreeLocked(void *pvPages, size_t cPages)976 SUPR3DECL(int) SUPR3PageFreeLocked(void *pvPages, size_t cPages) 977 977 { 978 978 /* … … 1001 1001 1002 1002 /** 1003 * Fallback for SUPPageAllocLockedEx on systems where RTR0MemObjPhysAllocNC isn't supported. 1003 * Fallback for SUPR3PageAllocLockedEx on systems where RTR0MemObjPhysAllocNC 1004 * isn't supported. 1004 1005 */ 1005 1006 static int supPagePageAllocNoKernelFallback(size_t cPages, void **ppvPages, PSUPPAGE paPages) … … 1234 1235 1235 1236 1236 SUPR3DECL(void *) SUPContAlloc(size_t cPages, PRTHCPHYS pHCPhys) 1237 { 1238 return SUPContAlloc2(cPages, NIL_RTR0PTR, pHCPhys); 1239 } 1240 1241 1242 SUPR3DECL(void *) SUPContAlloc2(size_t cPages, PRTR0PTR pR0Ptr, PRTHCPHYS pHCPhys) 1237 SUPR3DECL(void *) SUPR3ContAlloc(size_t cPages, PRTR0PTR pR0Ptr, PRTHCPHYS pHCPhys) 1243 1238 { 1244 1239 /* … … 1289 1284 1290 1285 1291 SUPR3DECL(int) SUP ContFree(void *pv, size_t cPages)1286 SUPR3DECL(int) SUPR3ContFree(void *pv, size_t cPages) 1292 1287 { 1293 1288 /* … … 1324 1319 1325 1320 1326 SUPR3DECL(int) SUP LowAlloc(size_t cPages, void **ppvPages, PRTR0PTR ppvPagesR0, PSUPPAGE paPages)1321 SUPR3DECL(int) SUPR3LowAlloc(size_t cPages, void **ppvPages, PRTR0PTR ppvPagesR0, PSUPPAGE paPages) 1327 1322 { 1328 1323 /* … … 1389 1384 1390 1385 1391 SUPR3DECL(int) SUP LowFree(void *pv, size_t cPages)1386 SUPR3DECL(int) SUPR3LowFree(void *pv, size_t cPages) 1392 1387 { 1393 1388 /* … … 1448 1443 1449 1444 1450 SUPR3DECL(int) SUP LoadModule(const char *pszFilename, const char *pszModule, void **ppvImageBase)1445 SUPR3DECL(int) SUPR3LoadModule(const char *pszFilename, const char *pszModule, void **ppvImageBase) 1451 1446 { 1452 1447 int rc = VINF_SUCCESS; … … 1460 1455 rc = supLoadModule(pszFilename, pszModule, NULL, ppvImageBase); 1461 1456 else 1462 LogRel(("SUP LoadModule: Verification of \"%s\" failed, rc=%Rrc\n", rc));1457 LogRel(("SUPR3LoadModule: Verification of \"%s\" failed, rc=%Rrc\n", rc)); 1463 1458 return rc; 1464 1459 } … … 1533 1528 * Check the VMMR0.r0 module if loaded. 1534 1529 */ 1535 /** @todo call the SUP LoadModule caller.... */1530 /** @todo call the SUPR3LoadModule caller.... */ 1536 1531 /** @todo proper reference counting and such. */ 1537 1532 if (g_pvVMMR0 != NIL_RTR0PTR) 1538 1533 { 1539 1534 void *pvValue; 1540 if (!SUP GetSymbolR0((void *)g_pvVMMR0, pszSymbol, &pvValue))1535 if (!SUPR3GetSymbolR0((void *)g_pvVMMR0, pszSymbol, &pvValue)) 1541 1536 { 1542 1537 *pValue = (uintptr_t)pvValue; … … 1652 1647 1653 1648 /** 1654 * Worker for SUP LoadModule().1649 * Worker for SUPR3LoadModule(). 1655 1650 * 1656 1651 * @returns VBox status code. … … 1868 1863 1869 1864 1870 SUPR3DECL(int) SUP FreeModule(void *pvImageBase)1865 SUPR3DECL(int) SUPR3FreeModule(void *pvImageBase) 1871 1866 { 1872 1867 /* fake */ … … 1898 1893 1899 1894 1900 SUPR3DECL(int) SUP GetSymbolR0(void *pvImageBase, const char *pszSymbol, void **ppvValue)1895 SUPR3DECL(int) SUPR3GetSymbolR0(void *pvImageBase, const char *pszSymbol, void **ppvValue) 1901 1896 { 1902 1897 *ppvValue = NULL; … … 1933 1928 1934 1929 1935 SUPR3DECL(int) SUP LoadVMM(const char *pszFilename)1930 SUPR3DECL(int) SUPR3LoadVMM(const char *pszFilename) 1936 1931 { 1937 1932 void *pvImageBase; 1938 return SUP LoadModule(pszFilename, "VMMR0.r0", &pvImageBase);1939 } 1940 1941 1942 SUPR3DECL(int) SUP UnloadVMM(void)1943 { 1944 return SUP FreeModule((void*)g_pvVMMR0);1945 } 1946 1947 1948 SUPR3DECL(int) SUP GipGetPhys(PRTHCPHYS pHCPhys)1933 return SUPR3LoadModule(pszFilename, "VMMR0.r0", &pvImageBase); 1934 } 1935 1936 1937 SUPR3DECL(int) SUPR3UnloadVMM(void) 1938 { 1939 return SUPR3FreeModule((void*)g_pvVMMR0); 1940 } 1941 1942 1943 SUPR3DECL(int) SUPR3GipGetPhys(PRTHCPHYS pHCPhys) 1949 1944 { 1950 1945 if (g_pSUPGlobalInfoPage) -
trunk/src/VBox/HostDrivers/Support/SUPLibInternal.h
r20862 r20864 315 315 316 316 317 intsupR3PageLock(void *pvStart, size_t cPages, PSUPPAGE paPages);318 intsupR3PageUnlock(void *pvStart);317 SUPR3DECL(int) supR3PageLock(void *pvStart, size_t cPages, PSUPPAGE paPages); 318 SUPR3DECL(int) supR3PageUnlock(void *pvStart); 319 319 320 320 RT_C_DECLS_END -
trunk/src/VBox/HostDrivers/Support/testcase/SUPInstall.cpp
r14831 r20864 42 42 { 43 43 RTR3Init(); 44 int rc = SUP Install();44 int rc = SUPR3Install(); 45 45 if (RT_SUCCESS(rc)) 46 46 { -
trunk/src/VBox/HostDrivers/Support/testcase/SUPUninstall.cpp
r14831 r20864 42 42 { 43 43 RTR3Init(); 44 int rc = SUP Uninstall();44 int rc = SUPR3Uninstall(); 45 45 if (RT_SUCCESS(rc)) 46 46 { -
trunk/src/VBox/HostDrivers/Support/testcase/tstContiguous.cpp
r13837 r20864 56 56 */ 57 57 RTHCPHYS HCPhys; 58 void *pv = SUP ContAlloc(8, &HCPhys);58 void *pv = SUPR3ContAlloc(8, NIL_RTR0PTR, &HCPhys); 59 59 rcRet += pv == NULL || HCPhys == 0; 60 60 if (pv && HCPhys) 61 61 { 62 62 memset(pv, 0xff, PAGE_SIZE * 8); 63 pv = SUP ContAlloc(5, &HCPhys);63 pv = SUPR3ContAlloc(5, NIL_RTR0PTR, &HCPhys); 64 64 rcRet += pv == NULL || HCPhys == 0; 65 65 if (pv && HCPhys) 66 66 { 67 67 memset(pv, 0x7f, PAGE_SIZE * 5); 68 rc = SUP ContFree(pv, 5);68 rc = SUPR3ContFree(pv, 5); 69 69 rcRet += rc != 0; 70 70 if (rc) 71 RTPrintf("tstContiguous: SUP ContFree failed! rc=%Rrc\n", rc);71 RTPrintf("tstContiguous: SUPR3ContFree failed! rc=%Rrc\n", rc); 72 72 73 73 void *apv[128]; 74 74 for (unsigned i = 0; i < RT_ELEMENTS(apv); i++) 75 75 { 76 apv[i] = SUP ContAlloc(1 + (i % 11), &HCPhys);76 apv[i] = SUPR3ContAlloc(1 + (i % 11), NIL_RTR0PTR, &HCPhys); 77 77 if (!apv[i]) 78 78 { … … 84 84 if (apv[i]) 85 85 { 86 rc = SUP ContFree(apv[i], 1 + (i % 11));86 rc = SUPR3ContFree(apv[i], 1 + (i % 11)); 87 87 rcRet += rc != 0; 88 88 if (rc) 89 RTPrintf("tstContiguous: i=%d SUP ContFree failed! rc=%Rrc\n", i, rc);89 RTPrintf("tstContiguous: i=%d SUPR3ContFree failed! rc=%Rrc\n", i, rc); 90 90 } 91 91 } 92 92 else 93 RTPrintf("tstContiguous: SUP ContAlloc (2nd) failed!\n");93 RTPrintf("tstContiguous: SUPR3ContAlloc (2nd) failed!\n"); 94 94 } 95 95 else 96 RTPrintf("tstContiguous: SUP ContAlloc failed!\n");96 RTPrintf("tstContiguous: SUPR3ContAlloc failed!\n"); 97 97 98 rc = SUP Term();99 RTPrintf("tstContiguous: SUP Term -> rc=%Rrc\n", rc);98 rc = SUPR3Term(false /*fForced*/); 99 RTPrintf("tstContiguous: SUPR3Term -> rc=%Rrc\n", rc); 100 100 rcRet += rc != 0; 101 101 } -
trunk/src/VBox/HostDrivers/Support/testcase/tstGIP-2.cpp
r17091 r20864 178 178 } 179 179 180 SUP Term();180 SUPR3Term(false /*fForced*/); 181 181 } 182 182 else -
trunk/src/VBox/HostDrivers/Support/testcase/tstGetPagingMode.cpp
r14831 r20864 47 47 if (RT_SUCCESS(rc)) 48 48 { 49 SUPPAGINGMODE enmMode = SUP GetPagingMode();49 SUPPAGINGMODE enmMode = SUPR3GetPagingMode(); 50 50 switch (enmMode) 51 51 { … … 89 89 } 90 90 91 int rc2 = SUP Term();92 RTPrintf("SUP Term -> rc=%Rrc\n", rc2);91 int rc2 = SUPR3Term(false /*fForced*/); 92 RTPrintf("SUPR3Term -> rc=%Rrc\n", rc2); 93 93 } 94 94 else -
trunk/src/VBox/HostDrivers/Support/testcase/tstInit.cpp
r14831 r20864 48 48 if (!rc) 49 49 { 50 rc = SUP Term();51 RTPrintf("tstInit: SUP Term -> rc=%d\n", rc);50 rc = SUPR3Term(false /*fForced*/); 51 RTPrintf("tstInit: SUPR3Term -> rc=%d\n", rc); 52 52 } 53 53 -
trunk/src/VBox/HostDrivers/Support/testcase/tstInt.cpp
r20602 r20864 92 92 */ 93 93 char szFile[RTPATH_MAX]; 94 rc = SUP LoadVMM(ExeDirFile(szFile, argv[0], "VMMR0.r0"));94 rc = SUPR3LoadVMM(ExeDirFile(szFile, argv[0], "VMMR0.r0")); 95 95 if (!rc) 96 96 { … … 103 103 PSUPPAGE paPages = (PSUPPAGE)RTMemAllocZ(cPages * sizeof(SUPPAGE)); 104 104 if (paPages) 105 rc = SUP LowAlloc(cPages, (void **)&pVM, &pVMR0, &paPages[0]);105 rc = SUPR3LowAlloc(cPages, (void **)&pVM, &pVMR0, &paPages[0]); 106 106 else 107 107 rc = VERR_NO_MEMORY; … … 115 115 pVM->enmVMState = VMSTATE_CREATED; 116 116 117 rc = SUP SetVMForFastIOCtl(pVMR0);117 rc = SUPR3SetVMForFastIOCtl(pVMR0); 118 118 if (!rc) 119 119 { … … 124 124 for (i = cIterations; i > 0; i--) 125 125 { 126 rc = SUP CallVMMR0(pVMR0, NIL_VMCPUID, VMMR0_DO_SLOW_NOP, NULL);126 rc = SUPR3CallVMMR0(pVMR0, NIL_VMCPUID, VMMR0_DO_SLOW_NOP, NULL); 127 127 if (rc != VINF_SUCCESS) 128 128 { 129 RTPrintf("tstInt: SUP CallVMMR0 -> rc=%Rrc i=%d Expected VINF_SUCCESS!\n", rc, i);129 RTPrintf("tstInt: SUPR3CallVMMR0 -> rc=%Rrc i=%d Expected VINF_SUCCESS!\n", rc, i); 130 130 rcRet++; 131 131 break; 132 132 } 133 133 } 134 RTPrintf("tstInt: Performed SUP CallVMMR0 %d times (rc=%Rrc)\n", cIterations, rc);134 RTPrintf("tstInt: Performed SUPR3CallVMMR0 %d times (rc=%Rrc)\n", cIterations, rc); 135 135 136 136 /* … … 146 146 { 147 147 uint64_t OneStartTick = ASMReadTSC(); 148 rc = SUP CallVMMR0Fast(pVMR0, VMMR0_DO_NOP, 0);148 rc = SUPR3CallVMMR0Fast(pVMR0, VMMR0_DO_NOP, 0); 149 149 uint64_t Ticks = ASMReadTSC() - OneStartTick; 150 150 if (Ticks < MinTicks) … … 153 153 if (RT_UNLIKELY(rc != VINF_SUCCESS)) 154 154 { 155 RTPrintf("tstInt: SUP CallVMMR0Fast -> rc=%Rrc i=%d Expected VINF_SUCCESS!\n", rc, i);155 RTPrintf("tstInt: SUPR3CallVMMR0Fast -> rc=%Rrc i=%d Expected VINF_SUCCESS!\n", rc, i); 156 156 rcRet++; 157 157 break; … … 161 161 uint64_t NanoSecs = RTTimeNanoTS() - StartTS; 162 162 163 RTPrintf("tstInt: SUP CallVMMR0Fast - %d iterations in %llu ns / %llu ticks. %llu ns / %#llu ticks per iteration. Min %llu ticks.\n",163 RTPrintf("tstInt: SUPR3CallVMMR0Fast - %d iterations in %llu ns / %llu ticks. %llu ns / %#llu ticks per iteration. Min %llu ticks.\n", 164 164 i, NanoSecs, Ticks, NanoSecs / i, Ticks / i, MinTicks); 165 165 … … 174 174 { 175 175 uint64_t OneStartTick = ASMReadTSC(); 176 rc = SUP CallVMMR0Ex(pVMR0, NIL_VMCPUID, VMMR0_DO_SLOW_NOP, 0, NULL);176 rc = SUPR3CallVMMR0Ex(pVMR0, NIL_VMCPUID, VMMR0_DO_SLOW_NOP, 0, NULL); 177 177 uint64_t Ticks = ASMReadTSC() - OneStartTick; 178 178 if (Ticks < MinTicks) … … 181 181 if (RT_UNLIKELY(rc != VINF_SUCCESS)) 182 182 { 183 RTPrintf("tstInt: SUP CallVMMR0Ex -> rc=%Rrc i=%d Expected VINF_SUCCESS!\n", rc, i);183 RTPrintf("tstInt: SUPR3CallVMMR0Ex -> rc=%Rrc i=%d Expected VINF_SUCCESS!\n", rc, i); 184 184 rcRet++; 185 185 break; … … 189 189 NanoSecs = RTTimeNanoTS() - StartTS; 190 190 191 RTPrintf("tstInt: SUP CallVMMR0Ex - %d iterations in %llu ns / %llu ticks. %llu ns / %#llu ticks per iteration. Min %llu ticks.\n",191 RTPrintf("tstInt: SUPR3CallVMMR0Ex - %d iterations in %llu ns / %llu ticks. %llu ns / %#llu ticks per iteration. Min %llu ticks.\n", 192 192 i, NanoSecs, Ticks, NanoSecs / i, Ticks / i, MinTicks); 193 193 } … … 195 195 else 196 196 { 197 RTPrintf("tstInt: SUP SetVMForFastIOCtl failed: %Rrc\n", rc);197 RTPrintf("tstInt: SUPR3SetVMForFastIOCtl failed: %Rrc\n", rc); 198 198 rcRet++; 199 199 } … … 201 201 else 202 202 { 203 RTPrintf("tstInt: SUP ContAlloc2(%#zx,,) failed\n", sizeof(*pVM));203 RTPrintf("tstInt: SUPR3ContAlloc(%#zx,,) failed\n", sizeof(*pVM)); 204 204 rcRet++; 205 205 } … … 208 208 * Unload VMM. 209 209 */ 210 rc = SUP UnloadVMM();210 rc = SUPR3UnloadVMM(); 211 211 if (rc) 212 212 { 213 RTPrintf("tstInt: SUP UnloadVMM failed with rc=%Rrc\n", rc);213 RTPrintf("tstInt: SUPR3UnloadVMM failed with rc=%Rrc\n", rc); 214 214 rcRet++; 215 215 } … … 217 217 else 218 218 { 219 RTPrintf("tstInt: SUP LoadVMM failed with rc=%Rrc\n", rc);219 RTPrintf("tstInt: SUPR3LoadVMM failed with rc=%Rrc\n", rc); 220 220 rcRet++; 221 221 } … … 224 224 * Terminate. 225 225 */ 226 rc = SUP Term();226 rc = SUPR3Term(false /*fForced*/); 227 227 rcRet += rc != 0; 228 RTPrintf("tstInt: SUP Term -> rc=%Rrc\n", rc);228 RTPrintf("tstInt: SUPR3Term -> rc=%Rrc\n", rc); 229 229 } 230 230 -
trunk/src/VBox/HostDrivers/Support/testcase/tstLow.cpp
r14831 r20864 59 59 void *pvPages0 = (void *)0x77777777; 60 60 memset(&aPages0[0], 0x8f, sizeof(aPages0)); 61 rc = SUP LowAlloc(RT_ELEMENTS(aPages0), &pvPages0, NULL, aPages0);61 rc = SUPR3LowAlloc(RT_ELEMENTS(aPages0), &pvPages0, NULL, aPages0); 62 62 if (RT_SUCCESS(rc)) 63 63 { … … 91 91 } 92 92 } 93 SUP LowFree(pvPages0, RT_ELEMENTS(aPages0));93 SUPR3LowFree(pvPages0, RT_ELEMENTS(aPages0)); 94 94 } 95 95 else 96 96 { 97 RTPrintf("SUP LowAlloc(%d,,) failed -> rc=%Rrc\n", RT_ELEMENTS(aPages0), rc);97 RTPrintf("SUPR3LowAlloc(%d,,) failed -> rc=%Rrc\n", RT_ELEMENTS(aPages0), rc); 98 98 rcRet++; 99 99 } … … 107 107 void *pvPages1 = (void *)0x77777777; 108 108 memset(&aPages1[0], 0x8f, sizeof(aPages1)); 109 rc = SUP LowAlloc(cPages, &pvPages1, NULL, aPages1);109 rc = SUPR3LowAlloc(cPages, &pvPages1, NULL, aPages1); 110 110 if (RT_SUCCESS(rc)) 111 111 { … … 139 139 } 140 140 } 141 SUP LowFree(pvPages1, cPages);141 SUPR3LowFree(pvPages1, cPages); 142 142 } 143 143 else 144 144 { 145 RTPrintf("SUP LowAlloc(%d,,) failed -> rc=%Rrc\n", cPages, rc);145 RTPrintf("SUPR3LowAlloc(%d,,) failed -> rc=%Rrc\n", cPages, rc); 146 146 rcRet++; 147 147 } -
trunk/src/VBox/HostDrivers/Support/testcase/tstPage.cpp
r14831 r20864 1 /* $Id$ */ 1 2 /** @file 2 * 3 * VBox host drivers - Ring-0 support drivers - Testcases: 4 * Test the page allocation interface 3 * SUP Testcase - Page allocation interface (ring 3). 5 4 */ 6 5 7 6 /* 8 * Copyright (C) 2006-200 7Sun Microsystems, Inc.7 * Copyright (C) 2006-2009 Sun Microsystems, Inc. 9 8 * 10 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 51 50 { 52 51 void *pv; 53 rc = SUP PageAlloc(1, &pv);52 rc = SUPR3PageAlloc(1, &pv); 54 53 cErrors += rc != 0; 55 54 if (!rc) 56 55 { 57 56 memset(pv, 0xff, PAGE_SIZE); 58 rc = SUP PageFree(pv, 1);57 rc = SUPR3PageFree(pv, 1); 59 58 cErrors += rc != 0; 60 59 if (rc) 61 RTPrintf("tstPage: SUP PageFree() failed rc=%d\n", rc);60 RTPrintf("tstPage: SUPR3PageFree() failed rc=%d\n", rc); 62 61 } 63 62 else 64 RTPrintf("tstPage: SUP PageAlloc(1,) failed rc=%d\n", rc);63 RTPrintf("tstPage: SUPR3PageAlloc(1,) failed rc=%d\n", rc); 65 64 66 65 /* 67 66 * Big chunk. 68 67 */ 69 rc = SUP PageAlloc(1023, &pv);68 rc = SUPR3PageAlloc(1023, &pv); 70 69 cErrors += rc != 0; 71 70 if (!rc) 72 71 { 73 72 memset(pv, 0xfe, 1023 << PAGE_SHIFT); 74 rc = SUP PageFree(pv, 1023);73 rc = SUPR3PageFree(pv, 1023); 75 74 cErrors += rc != 0; 76 75 if (rc) 77 RTPrintf("tstPage: SUP PageFree() failed rc=%d\n", rc);76 RTPrintf("tstPage: SUPR3PageFree() failed rc=%d\n", rc); 78 77 } 79 78 else 80 RTPrintf("tstPage: SUP PageAlloc(1,) failed rc=%d\n", rc);79 RTPrintf("tstPage: SUPR3PageAlloc(1,) failed rc=%d\n", rc); 81 80 82 81 83 //rc = SUP Term();82 //rc = SUPR3Term(); 84 83 cErrors += rc != 0; 85 84 if (rc) 86 RTPrintf("tstPage: SUP Term failed rc=%d\n", rc);85 RTPrintf("tstPage: SUPR3Term failed rc=%d\n", rc); 87 86 } 88 87 else -
trunk/src/VBox/HostDrivers/Support/testcase/tstPin.cpp
r20862 r20864 61 61 */ 62 62 void *pv; 63 int rc = SUP PageAlloc(1, &pv);63 int rc = SUPR3PageAlloc(1, &pv); 64 64 AssertRC(rc); 65 65 RTPrintf("pv=%p\n", pv); … … 88 88 { 89 89 aPinnings[i].pv = NULL; 90 SUP PageAlloc(0x10000 >> PAGE_SHIFT, &aPinnings[i].pv);90 SUPR3PageAlloc(0x10000 >> PAGE_SHIFT, &aPinnings[i].pv); 91 91 aPinnings[i].pvAligned = RT_ALIGN_P(aPinnings[i].pv, PAGE_SIZE); 92 92 rc = supR3PageLock(aPinnings[i].pvAligned, 0xf000 >> PAGE_SHIFT, &aPinnings[i].aPages[0]); … … 108 108 RTPrintf("SUPPageLock -> rc=%d\n", rc); 109 109 rcRet++; 110 SUP PageFree(aPinnings[i].pv, 0x10000 >> PAGE_SHIFT);110 SUPR3PageFree(aPinnings[i].pv, 0x10000 >> PAGE_SHIFT); 111 111 aPinnings[i].pv = aPinnings[i].pvAligned = NULL; 112 112 break; … … 133 133 { 134 134 memset(aPinnings[i].pv, 0xcc, 0x10000); 135 SUP PageFree(aPinnings[i].pv, 0x10000 >> PAGE_SHIFT);135 SUPR3PageFree(aPinnings[i].pv, 0x10000 >> PAGE_SHIFT); 136 136 aPinnings[i].pv = NULL; 137 137 } … … 142 142 * Allocate a bit of contiguous memory. 143 143 */ 144 pv = SUP ContAlloc(RT_ALIGN_Z(15003, PAGE_SIZE) >> PAGE_SHIFT, &HCPhys);144 pv = SUPR3ContAlloc(RT_ALIGN_Z(15003, PAGE_SIZE) >> PAGE_SHIFT, NIL_RTR0PTR, &HCPhys); 145 145 rcRet += pv == NULL || HCPhys == 0; 146 146 if (pv && HCPhys) 147 147 { 148 RTPrintf("SUP ContAlloc(15003) -> HCPhys=%llx pv=%p\n", HCPhys, pv);148 RTPrintf("SUPR3ContAlloc(15003) -> HCPhys=%llx pv=%p\n", HCPhys, pv); 149 149 void *pv0 = pv; 150 150 memset(pv0, 0xaf, 15003); 151 pv = SUP ContAlloc(RT_ALIGN_Z(12999, PAGE_SIZE) >> PAGE_SHIFT, &HCPhys);151 pv = SUPR3ContAlloc(RT_ALIGN_Z(12999, PAGE_SIZE) >> PAGE_SHIFT, NIL_RTR0PTR, &HCPhys); 152 152 rcRet += pv == NULL || HCPhys == 0; 153 153 if (pv && HCPhys) 154 154 { 155 RTPrintf("SUP ContAlloc(12999) -> HCPhys=%llx pv=%p\n", HCPhys, pv);155 RTPrintf("SUPR3ContAlloc(12999) -> HCPhys=%llx pv=%p\n", HCPhys, pv); 156 156 memset(pv, 0xbf, 12999); 157 rc = SUP ContFree(pv, RT_ALIGN_Z(12999, PAGE_SIZE) >> PAGE_SHIFT);157 rc = SUPR3ContFree(pv, RT_ALIGN_Z(12999, PAGE_SIZE) >> PAGE_SHIFT); 158 158 rcRet += rc != 0; 159 159 if (rc) 160 RTPrintf("SUP ContFree failed! rc=%d\n", rc);160 RTPrintf("SUPR3ContFree failed! rc=%d\n", rc); 161 161 } 162 162 else 163 RTPrintf("SUP ContAlloc (2nd) failed!\n");163 RTPrintf("SUPR3ContAlloc (2nd) failed!\n"); 164 164 memset(pv0, 0xaf, 15003); 165 165 /* pv0 is intentionally not freed! */ 166 166 } 167 167 else 168 RTPrintf("SUP ContAlloc failed!\n");168 RTPrintf("SUPR3ContAlloc failed!\n"); 169 169 170 170 /* … … 174 174 #define BIG_SIZEPP (BIG_SIZE + PAGE_SIZE) 175 175 pv = NULL; 176 SUP PageAlloc(BIG_SIZEPP >> PAGE_SHIFT, &pv);176 SUPR3PageAlloc(BIG_SIZEPP >> PAGE_SHIFT, &pv); 177 177 if (pv) 178 178 { … … 204 204 rcRet++; 205 205 } 206 SUP PageFree(pv, BIG_SIZEPP >> PAGE_SHIFT);207 } 208 209 rc = SUP Term();210 RTPrintf("SUP Term -> rc=%d\n", rc);206 SUPR3PageFree(pv, BIG_SIZEPP >> PAGE_SHIFT); 207 } 208 209 rc = SUPR3Term(false /*fForced*/); 210 RTPrintf("SUPR3Term -> rc=%d\n", rc); 211 211 rcRet += rc != 0; 212 212 }
Note:
See TracChangeset
for help on using the changeset viewer.