- Timestamp:
- Oct 14, 2008 12:35:50 PM (16 years ago)
- Location:
- trunk/src/VBox/Runtime
- Files:
-
- 3 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/Makefile.kmk
r13248 r13254 976 976 generic/RTLogWriteStdOut-stub-generic.cpp \ 977 977 generic/mppresent-generic.cpp \ 978 r0drv/generic/RTThreadPreemptIsEnabled-r0drv-generic.cpp \ 979 r0drv/generic/RTThreadPreemptDisable-r0drv-generic.cpp \ 980 r0drv/generic/RTThreadPreemptRestore-r0drv-generic.cpp \ 978 981 r0drv/linux/alloc-r0drv-linux.c \ 979 982 r0drv/linux/initterm-r0drv-linux.c \ … … 1010 1013 r0drv/memobj-r0drv.cpp \ 1011 1014 r0drv/mpnotification-r0drv.c \ 1015 r0drv/generic/RTThreadPreemptIsEnabled-r0drv-generic.cpp \ 1016 r0drv/generic/RTThreadPreemptDisable-r0drv-generic.cpp \ 1017 r0drv/generic/RTThreadPreemptRestore-r0drv-generic.cpp \ 1012 1018 r0drv/nt/alloc-r0drv-nt.cpp \ 1013 1019 r0drv/nt/assert-r0drv-nt.cpp \ … … 1054 1060 generic/timer-generic.cpp \ 1055 1061 r0drv/generic/RTMpOn-r0drv-generic.cpp \ 1062 r0drv/generic/RTThreadPreemptIsEnabled-r0drv-generic.cpp \ 1063 r0drv/generic/RTThreadPreemptDisable-r0drv-generic.cpp \ 1064 r0drv/generic/RTThreadPreemptRestore-r0drv-generic.cpp \ 1056 1065 r0drv/generic/mpnotification-r0drv-generic.cpp \ 1057 1066 r0drv/darwin/alloc-r0drv-darwin.cpp \ … … 1103 1112 r0drv/memobj-r0drv.cpp \ 1104 1113 r0drv/generic/RTMpOn-r0drv-generic.cpp \ 1114 r0drv/generic/RTThreadPreemptIsEnabled-r0drv-generic.cpp \ 1115 r0drv/generic/RTThreadPreemptDisable-r0drv-generic.cpp \ 1116 r0drv/generic/RTThreadPreemptRestore-r0drv-generic.cpp \ 1105 1117 r0drv/generic/mpnotification-r0drv-generic.cpp \ 1106 1118 r0drv/os2/alloc-r0drv-os2.cpp \ … … 1149 1161 generic/mppresent-generic.cpp \ 1150 1162 r0drv/generic/RTMpOn-r0drv-generic.cpp \ 1163 r0drv/generic/RTThreadPreemptIsEnabled-r0drv-generic.cpp \ 1164 r0drv/generic/RTThreadPreemptDisable-r0drv-generic.cpp \ 1165 r0drv/generic/RTThreadPreemptRestore-r0drv-generic.cpp \ 1151 1166 r0drv/generic/mpnotification-r0drv-generic.cpp \ 1152 1167 r0drv/freebsd/alloc-r0drv-freebsd.c \ … … 1196 1211 else # !VBOX_WITH_SOLARIS_VBI 1197 1212 RuntimeR0Drv_SOURCES.solaris += \ 1213 r0drv/generic/RTThreadPreemptIsEnabled-r0drv-generic.cpp \ 1214 r0drv/generic/RTThreadPreemptDisable-r0drv-generic.cpp \ 1215 r0drv/generic/RTThreadPreemptRestore-r0drv-generic.cpp \ 1198 1216 r0drv/solaris/mpnotification-r0drv-solaris.c \ 1199 1217 r0drv/solaris/alloc-r0drv-solaris.c \ -
trunk/src/VBox/Runtime/common/log/log.cpp
r12905 r13254 143 143 if (pLogger->MutexSem != NIL_RTSEMFASTMUTEX) 144 144 { 145 # if defined(IN_RING0) \ 146 && (defined(RT_OS_WINDOWS) || defined(RT_OS_SOLARIS)) 147 if (!RTThreadPreemptIsEnabled()) 148 return VERR_PREEMPT_DISABLED; 149 # endif 145 150 int rc = RTSemFastMutexRequest(pLogger->MutexSem); 146 151 if (RT_FAILURE(rc)) -
trunk/src/VBox/Runtime/r0drv/nt/thread-r0drv-nt.cpp
r8245 r13254 72 72 73 73 74 RTDECL(bool) RTThreadPreemptIsEnabled(RTTHREAD hThread) 75 { 76 Assert(hThread == NIL_RTTHREAD); 77 KIRQL Irql = KeGetCurrentIrql(); 78 return Irql <= APC_LEVEL; 79 } 80 81 82 RTDECL(void) RTThreadPreemptDisable(PRTTHREADPREEMPTSTATE pState) 83 { 84 AssertPtr(pState); 85 Assert(pState->uchOldIrql == 255); 86 Assert(KeGetCurrentIrql() <= DISPATCH_LEVEL); 87 88 KeRaiseIrql(DISPATCH_LEVEL, &pState->uchOldIrql); 89 } 90 91 92 RTDECL(void) RTThreadPreemptRestore(PRTTHREADPREEMPTSTATE pState) 93 { 94 AssertPtr(pState); 95 96 KeLowerIrql(pState->uchOldIrql); 97 pState->uchOldIrql = 255; 98 } 99 -
trunk/src/VBox/Runtime/r0drv/solaris/thread-r0drv-solaris.c
r8245 r13254 49 49 clock_t cTicks; 50 50 unsigned long timeout; 51 51 52 52 if (!cMillies) 53 53 { … … 63 63 #if 0 64 64 timeout = ddi_get_lbolt(); 65 timeout += cTicks; 66 65 timeout += cTicks; 66 67 67 kcondvar_t cnd; 68 68 kmutex_t mtx; … … 98 98 } 99 99 100 101 RTDECL(bool) RTThreadPreemptIsEnabled(RTTHREAD hThread) 102 { 103 Assert(hThread == NIL_RTTHREAD); 104 return curthread->t_preempt == 0; 105 } 106 107 108 RTDECL(void) RTThreadPreemptDisable(PRTTHREADPREEMPTSTATE pState) 109 { 110 AssertPtr(pState); 111 Assert(pState->uchDummy != 42); 112 pState->uchDummy = 42; 113 114 kpreempt_disable(); 115 } 116 117 118 RTDECL(void) RTThreadPreemptRestore(PRTTHREADPREEMPTSTATE pState) 119 { 120 AssertPtr(pState); 121 Assert(pState->uchDummy == 42); 122 pState->uchDummy = 0; 123 124 kpreempt_enable(); 125 } 126 -
trunk/src/VBox/Runtime/r0drv/solaris/vbi/thread-r0drv-solaris.c
r9176 r13254 62 62 #if 0 63 63 timeout = ddi_get_lbolt(); 64 timeout += cTicks; 65 64 timeout += cTicks; 65 66 66 kcondvar_t cnd; 67 67 kmutex_t mtx; … … 96 96 } 97 97 98 99 RTDECL(bool) RTThreadPreemptIsEnabled(RTTHREAD hThread) 100 { 101 Assert(hThread == NIL_RTTHREAD); 102 return vbi_is_preempt_enabled() != 0; 103 } 104 105 106 RTDECL(void) RTThreadPreemptDisable(PRTTHREADPREEMPTSTATE pState) 107 { 108 AssertPtr(pState); 109 Assert(pState->uchDummy != 42); 110 pState->uchDummy = 42; 111 vbi_preempt_disable(); 112 } 113 114 115 RTDECL(void) RTThreadPreemptRestore(PRTTHREADPREEMPTSTATE pState) 116 { 117 AssertPtr(pState); 118 Assert(pState->uchDummy == 42); 119 pState->uchDummy = 0; 120 vbi_preempt_enable(); 121 } 122
Note:
See TracChangeset
for help on using the changeset viewer.