Changeset 54449 in vbox
- Timestamp:
- Feb 24, 2015 2:54:42 PM (10 years ago)
- Location:
- trunk/src/VBox/Runtime/testcase
- Files:
-
- 1 edited
- 3 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/testcase/Makefile.kmk
r54398 r54449 178 178 tstRTR0SemMutexDriverHardened \ 179 179 tstRTR0TimerDriverHardened \ 180 tstR 0ThreadPreemptionDriverHardened \180 tstRTR0ThreadPreemptionDriverHardened \ 181 181 tstRTR0ThreadDriverHardened 182 182 DLLS += \ … … 184 184 tstRTR0SemMutexDriver \ 185 185 tstRTR0TimerDriver \ 186 tstR 0ThreadPreemptionDriver \186 tstRTR0ThreadPreemptionDriver \ 187 187 tstRTR0ThreadDriver 188 188 else … … 191 191 tstRTR0SemMutexDriver \ 192 192 tstRTR0TimerDriver \ 193 tstR 0ThreadPreemptionDriver \193 tstRTR0ThreadPreemptionDriver \ 194 194 tstRTR0ThreadDriver 195 195 endif … … 199 199 tstRTR0SemMutex \ 200 200 tstRTR0Timer \ 201 tstR 0ThreadPreemption \201 tstRTR0ThreadPreemption \ 202 202 tstRTR0Thread 203 203 ifdef VBOX_WITH_RAW_MODE … … 762 762 763 763 764 tstR 0ThreadPreemption_TEMPLATE = VBoxR0765 tstR 0ThreadPreemption_INST = $(INST_TESTCASE)766 tstR 0ThreadPreemption_DEFS = IN_RT_R0767 tstR 0ThreadPreemption_SYSSUFF = .r0768 tstR 0ThreadPreemption_SOURCES = tstR0ThreadPreemption.cpp769 tstR 0ThreadPreemption_LIBS = $(PATH_STAGE_LIB)/RuntimeR0$(VBOX_SUFF_LIB)764 tstRTR0ThreadPreemption_TEMPLATE = VBoxR0 765 tstRTR0ThreadPreemption_INST = $(INST_TESTCASE) 766 tstRTR0ThreadPreemption_DEFS = IN_RT_R0 767 tstRTR0ThreadPreemption_SYSSUFF = .r0 768 tstRTR0ThreadPreemption_SOURCES = tstRTR0ThreadPreemption.cpp 769 tstRTR0ThreadPreemption_LIBS = $(PATH_STAGE_LIB)/RuntimeR0$(VBOX_SUFF_LIB) 770 770 if1of ($(VBOX_LDR_FMT), pe lx) 771 tstR 0ThreadPreemption_LIBS += $(PATH_STAGE_LIB)/SUPR0$(VBOX_SUFF_LIB)771 tstRTR0ThreadPreemption_LIBS += $(PATH_STAGE_LIB)/SUPR0$(VBOX_SUFF_LIB) 772 772 endif 773 773 if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win" 774 tstR 0ThreadPreemptionDriverHardened_TEMPLATE = VBoxR3HardenedTstExe775 tstR 0ThreadPreemptionDriverHardened_NAME = tstR0ThreadPreemptionDriver776 tstR 0ThreadPreemptionDriverHardened_DEFS = PROGRAM_NAME_STR=\"tstR0ThreadPreemptionDriver\"777 tstR 0ThreadPreemptionDriverHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplate.cpp778 tstR 0ThreadPreemptionDriver_TEMPLATE = VBoxR3TstDll774 tstRTR0ThreadPreemptionDriverHardened_TEMPLATE = VBoxR3HardenedTstExe 775 tstRTR0ThreadPreemptionDriverHardened_NAME = tstRTR0ThreadPreemptionDriver 776 tstRTR0ThreadPreemptionDriverHardened_DEFS = PROGRAM_NAME_STR=\"tstRTR0ThreadPreemptionDriver\" 777 tstRTR0ThreadPreemptionDriverHardened_SOURCES = ../../HostDrivers/Support/SUPR3HardenedMainTemplate.cpp 778 tstRTR0ThreadPreemptionDriver_TEMPLATE = VBoxR3TstDll 779 779 else 780 tstR 0ThreadPreemptionDriver_TEMPLATE = VBOXR3TSTEXE781 endif 782 tstR 0ThreadPreemptionDriver_SOURCES = tstR0ThreadPreemptionDriver.cpp780 tstRTR0ThreadPreemptionDriver_TEMPLATE = VBOXR3TSTEXE 781 endif 782 tstRTR0ThreadPreemptionDriver_SOURCES = tstRTR0ThreadPreemptionDriver.cpp 783 783 784 784 -
trunk/src/VBox/Runtime/testcase/tstRTR0ThreadPreemption.cpp
r54436 r54449 5 5 6 6 /* 7 * Copyright (C) 2009-201 3Oracle Corporation7 * Copyright (C) 2009-2015 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 36 36 #include <iprt/string.h> 37 37 #include <VBox/sup.h> 38 #include "tstR 0ThreadPreemption.h"38 #include "tstRTR0ThreadPreemption.h" 39 39 40 40 … … 181 181 switch (uOperation) 182 182 { 183 case TSTR 0THREADPREMEPTION_SANITY_OK:184 break; 185 186 case TSTR 0THREADPREMEPTION_SANITY_FAILURE:183 case TSTRTR0THREADPREEMPTION_SANITY_OK: 184 break; 185 186 case TSTRTR0THREADPREEMPTION_SANITY_FAILURE: 187 187 RTStrPrintf(pszErr, cchErr, "!42failure42%1024s", ""); 188 188 break; 189 189 190 case TSTR 0THREADPREMEPTION_BASIC:190 case TSTRTR0THREADPREEMPTION_BASIC: 191 191 { 192 192 if (!ASMIntAreEnabled()) … … 207 207 } 208 208 209 case TSTR 0THREADPREMEPTION_IS_TRUSTY:209 case TSTRTR0THREADPREEMPTION_IS_TRUSTY: 210 210 if (!RTThreadPreemptIsPendingTrusty()) 211 211 RTStrPrintf(pszErr, cchErr, "!Untrusty"); 212 212 break; 213 213 214 case TSTR 0THREADPREMEPTION_IS_PENDING:214 case TSTRTR0THREADPREEMPTION_IS_PENDING: 215 215 { 216 216 RTTHREADPREEMPTSTATE State = RTTHREADPREEMPTSTATE_INITIALIZER; … … 259 259 } 260 260 261 case TSTR 0THREADPREMEPTION_NESTED:261 case TSTRTR0THREADPREEMPTION_NESTED: 262 262 { 263 263 bool const fDefault = RTThreadPreemptIsEnabled(NIL_RTTHREAD); … … 294 294 } 295 295 296 case TSTR 0THREADPREEMPTION_CTXHOOKS:296 case TSTRTR0THREADPREEMPTION_CTXHOOKS: 297 297 { 298 298 if (!RTThreadPreemptIsEnabled(NIL_RTTHREAD)) -
trunk/src/VBox/Runtime/testcase/tstRTR0ThreadPreemption.h
r54436 r54449 5 5 6 6 /* 7 * Copyright (C) 2009-201 3Oracle Corporation7 * Copyright (C) 2009-2015 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 27 27 #ifdef IN_RING0 28 28 RT_C_DECLS_BEGIN 29 DECLEXPORT(int) TSTR 0ThreadPreemptionSrvReqHandler(PSUPDRVSESSION pSession, uint32_t uOperation,30 uint64_t u64Arg, PSUPR0SERVICEREQHDR pReqHdr);29 DECLEXPORT(int) TSTRTR0ThreadPreemptionSrvReqHandler(PSUPDRVSESSION pSession, uint32_t uOperation, 30 uint64_t u64Arg, PSUPR0SERVICEREQHDR pReqHdr); 31 31 RT_C_DECLS_END 32 32 #endif 33 33 34 typedef enum TSTR 0THREADPREMEPTION34 typedef enum TSTRTR0THREADPREEMPTION 35 35 { 36 TSTR 0THREADPREMEPTION_SANITY_OK = 1,37 TSTR 0THREADPREMEPTION_SANITY_FAILURE,38 TSTR 0THREADPREMEPTION_BASIC,39 TSTR 0THREADPREMEPTION_IS_TRUSTY,40 TSTR 0THREADPREMEPTION_IS_PENDING,41 TSTR 0THREADPREMEPTION_NESTED,42 TSTR 0THREADPREEMPTION_CTXHOOKS43 } TSTR 0THREADPREMEPTION;36 TSTRTR0THREADPREEMPTION_SANITY_OK = 1, 37 TSTRTR0THREADPREEMPTION_SANITY_FAILURE, 38 TSTRTR0THREADPREEMPTION_BASIC, 39 TSTRTR0THREADPREEMPTION_IS_TRUSTY, 40 TSTRTR0THREADPREEMPTION_IS_PENDING, 41 TSTRTR0THREADPREEMPTION_NESTED, 42 TSTRTR0THREADPREEMPTION_CTXHOOKS 43 } TSTRTR0THREADPREEMPTION; 44 44 -
trunk/src/VBox/Runtime/testcase/tstRTR0ThreadPreemptionDriver.cpp
r54436 r54449 5 5 6 6 /* 7 * Copyright (C) 2009-201 3Oracle Corporation7 * Copyright (C) 2009-2015 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 42 42 #ifdef VBOX 43 43 # include <VBox/sup.h> 44 # include "tstR 0ThreadPreemption.h"44 # include "tstRTR0ThreadPreemption.h" 45 45 #endif 46 46 … … 88 88 */ 89 89 RTTEST hTest; 90 int rc = RTTestInitAndCreate("tstR 0ThreadPreemption", &hTest);90 int rc = RTTestInitAndCreate("tstRTR0ThreadPreemption", &hTest); 91 91 if (rc) 92 92 return rc; … … 104 104 rc = RTPathExecDir(szPath, sizeof(szPath)); 105 105 if (RT_SUCCESS(rc)) 106 rc = RTPathAppend(szPath, sizeof(szPath), "tstR 0ThreadPreemption.r0");106 rc = RTPathAppend(szPath, sizeof(szPath), "tstRTR0ThreadPreemption.r0"); 107 107 if (RT_FAILURE(rc)) 108 108 { … … 112 112 113 113 void *pvImageBase; 114 rc = SUPR3LoadServiceModule(szPath, "tstR 0ThreadPreemption",115 "TSTR 0ThreadPreemptionSrvReqHandler",114 rc = SUPR3LoadServiceModule(szPath, "tstRTR0ThreadPreemption", 115 "TSTRTR0ThreadPreemptionSrvReqHandler", 116 116 &pvImageBase); 117 117 if (RT_FAILURE(rc)) … … 135 135 Req.Hdr.cbReq = sizeof(Req); 136 136 Req.szMsg[0] = '\0'; 137 RTTESTI_CHECK_RC(rc = SUPR3CallR0Service("tstR 0ThreadPreemption", sizeof("tstR0ThreadPreemption") - 1,138 TSTR 0THREADPREMEPTION_SANITY_OK, 0, &Req.Hdr), VINF_SUCCESS);137 RTTESTI_CHECK_RC(rc = SUPR3CallR0Service("tstRTR0ThreadPreemption", sizeof("tstRTR0ThreadPreemption") - 1, 138 TSTRTR0THREADPREEMPTION_SANITY_OK, 0, &Req.Hdr), VINF_SUCCESS); 139 139 if (RT_FAILURE(rc)) 140 140 return RTTestSummaryAndDestroy(hTest); … … 146 146 Req.Hdr.cbReq = sizeof(Req); 147 147 Req.szMsg[0] = '\0'; 148 RTTESTI_CHECK_RC(rc = SUPR3CallR0Service("tstR 0ThreadPreemption", sizeof("tstR0ThreadPreemption") - 1,149 TSTR 0THREADPREMEPTION_SANITY_FAILURE, 0, &Req.Hdr), VINF_SUCCESS);148 RTTESTI_CHECK_RC(rc = SUPR3CallR0Service("tstRTR0ThreadPreemption", sizeof("tstRTR0ThreadPreemption") - 1, 149 TSTRTR0THREADPREEMPTION_SANITY_FAILURE, 0, &Req.Hdr), VINF_SUCCESS); 150 150 if (RT_FAILURE(rc)) 151 151 return RTTestSummaryAndDestroy(hTest); … … 161 161 Req.Hdr.cbReq = sizeof(Req); 162 162 Req.szMsg[0] = '\0'; 163 RTTESTI_CHECK_RC(rc = SUPR3CallR0Service("tstR 0ThreadPreemption", sizeof("tstR0ThreadPreemption") - 1,164 TSTR 0THREADPREMEPTION_BASIC, 0, &Req.Hdr), VINF_SUCCESS);163 RTTESTI_CHECK_RC(rc = SUPR3CallR0Service("tstRTR0ThreadPreemption", sizeof("tstRTR0ThreadPreemption") - 1, 164 TSTRTR0THREADPREEMPTION_BASIC, 0, &Req.Hdr), VINF_SUCCESS); 165 165 if (RT_FAILURE(rc)) 166 166 return RTTestSummaryAndDestroy(hTest); … … 180 180 Req.Hdr.cbReq = sizeof(Req); 181 181 Req.szMsg[0] = '\0'; 182 RTTESTI_CHECK_RC(rc = SUPR3CallR0Service("tstR 0ThreadPreemption", sizeof("tstR0ThreadPreemption") - 1,183 TSTR 0THREADPREMEPTION_IS_TRUSTY, 0, &Req.Hdr), VINF_SUCCESS);182 RTTESTI_CHECK_RC(rc = SUPR3CallR0Service("tstRTR0ThreadPreemption", sizeof("tstRTR0ThreadPreemption") - 1, 183 TSTRTR0THREADPREEMPTION_IS_TRUSTY, 0, &Req.Hdr), VINF_SUCCESS); 184 184 if (RT_FAILURE(rc)) 185 185 return RTTestSummaryAndDestroy(hTest); … … 212 212 Req.Hdr.cbReq = sizeof(Req); 213 213 Req.szMsg[0] = '\0'; 214 RTTESTI_CHECK_RC(rc = SUPR3CallR0Service("tstR 0ThreadPreemption", sizeof("tstR0ThreadPreemption") - 1,215 TSTR 0THREADPREMEPTION_IS_PENDING, 0, &Req.Hdr), VINF_SUCCESS);214 RTTESTI_CHECK_RC(rc = SUPR3CallR0Service("tstRTR0ThreadPreemption", sizeof("tstRTR0ThreadPreemption") - 1, 215 TSTRTR0THREADPREEMPTION_IS_PENDING, 0, &Req.Hdr), VINF_SUCCESS); 216 216 if ( strcmp(Req.szMsg, "!cLoops=1\n") 217 217 || i >= 64) … … 241 241 Req.Hdr.cbReq = sizeof(Req); 242 242 Req.szMsg[0] = '\0'; 243 RTTESTI_CHECK_RC(rc = SUPR3CallR0Service("tstR 0ThreadPreemption", sizeof("tstR0ThreadPreemption") - 1,244 TSTR 0THREADPREMEPTION_NESTED, 0, &Req.Hdr), VINF_SUCCESS);243 RTTESTI_CHECK_RC(rc = SUPR3CallR0Service("tstRTR0ThreadPreemption", sizeof("tstRTR0ThreadPreemption") - 1, 244 TSTRTR0THREADPREEMPTION_NESTED, 0, &Req.Hdr), VINF_SUCCESS); 245 245 if (Req.szMsg[0] == '!') 246 246 RTTestIFailed("%s", &Req.szMsg[1]); … … 261 261 Req.Hdr.cbReq = sizeof(Req); 262 262 Req.szMsg[0] = '\0'; 263 RTTESTI_CHECK_RC(rc = SUPR3CallR0Service("tstR 0ThreadPreemption", sizeof("tstR0ThreadPreemption") - 1,264 TSTR 0THREADPREEMPTION_CTXHOOKS, 0, &Req.Hdr), VINF_SUCCESS);263 RTTESTI_CHECK_RC(rc = SUPR3CallR0Service("tstRTR0ThreadPreemption", sizeof("tstRTR0ThreadPreemption") - 1, 264 TSTRTR0THREADPREEMPTION_CTXHOOKS, 0, &Req.Hdr), VINF_SUCCESS); 265 265 if (RT_FAILURE(rc)) 266 266 return RTTestSummaryAndDestroy(hTest);
Note:
See TracChangeset
for help on using the changeset viewer.