Changeset 20864 in vbox for trunk/src/VBox/HostDrivers/Support/testcase
- Timestamp:
- Jun 23, 2009 7:19:42 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 49009
- Location:
- trunk/src/VBox/HostDrivers/Support/testcase
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
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.