Changeset 22614 in vbox
- Timestamp:
- Aug 31, 2009 3:43:41 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
-
include/iprt/thread.h (modified) (1 diff)
-
src/VBox/Runtime/r0drv/solaris/thread-r0drv-solaris.c (modified) (3 diffs)
-
src/VBox/Runtime/r0drv/solaris/vbi/thread-r0drv-solaris.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/thread.h
r22566 r22614 484 484 uint8_t bReserved3; 485 485 # define RTTHREADPREEMPTSTATE_INITIALIZER { NIL_RTCPUID, 255, 0, 0, 0 } 486 #elif defined(RT_OS_SOLARIS) 487 /** The Old PIL. Don't touch! */ 488 uint32_t uOldPil; 489 # define RTTHREADPREEMPTSTATE_INITIALIZER { NIL_RTCPUID, UINT32_MAX } 486 490 #else 487 491 /** Reserved, MBZ. */ -
trunk/src/VBox/Runtime/r0drv/solaris/thread-r0drv-solaris.c
r22566 r22614 67 67 cTicks = 0; 68 68 69 #if 070 timeout = ddi_get_lbolt();71 timeout += cTicks;72 73 kcondvar_t cnd;74 kmutex_t mtx;75 mutex_init(&mtx, "IPRT Sleep Mutex", MUTEX_DRIVER, NULL);76 cv_init(&cnd, "IPRT Sleep CV", CV_DRIVER, NULL);77 mutex_enter(&mtx);78 cv_timedwait (&cnd, &mtx, timeout);79 mutex_exit(&mtx);80 cv_destroy(&cnd);81 mutex_destroy(&mtx);82 #endif83 84 #if 185 69 delay(cTicks); 86 #endif87 88 #if 089 /* Hmm, no same effect as using delay() */90 struct timespec t;91 t.tv_sec = 0;92 t.tv_nsec = cMillies * 1000000L;93 nanosleep (&t, NULL);94 #endif95 70 96 71 return VINF_SUCCESS; … … 144 119 { 145 120 AssertPtr(pState); 146 Assert(pState->u32Reserved == 0); 147 pState->u32Reserved = 42; 148 121 Assert(pState->uOldPil == UINT32_MAX); 149 122 kpreempt_disable(); 123 pState->uOldPil = splr(ipltospl(LOCK_LEVEL - 1)); 124 Assert(pState->uOldPil != UINT32_MAX); 150 125 RT_ASSERT_PREEMPT_CPUID_DISABLE(pState); 151 126 } … … 155 130 { 156 131 AssertPtr(pState); 157 Assert(pState->u32Reserved == 42); 158 pState->u32Reserved = 0; 132 Assert(pState->uOldPil != UINT32_MAX); 159 133 RT_ASSERT_PREEMPT_CPUID_RESTORE(pState); 160 134 splx(pState->uOldPil); 161 135 kpreempt_enable(); 136 pState->uOldPil = UINT32_MAX; 162 137 } 163 138 -
trunk/src/VBox/Runtime/r0drv/solaris/vbi/thread-r0drv-solaris.c
r22566 r22614 116 116 { 117 117 AssertPtr(pState); 118 Assert(pState->u 32Reserved == 0);119 pState->u32Reserved = 42; 118 Assert(pState->uOldPil == UINT32_MAX); 119 120 120 vbi_preempt_disable(); 121 122 pState->uOldPil = splr(ipltospl(LOCK_LEVEL - 8)); 123 Assert(pState->uOldPil != UINT32_MAX); 121 124 RT_ASSERT_PREEMPT_CPUID_DISABLE(pState); 122 125 } … … 126 129 { 127 130 AssertPtr(pState); 128 Assert(pState->u32Reserved == 42);129 pState->u32Reserved = 0;130 131 RT_ASSERT_PREEMPT_CPUID_RESTORE(pState); 132 Assert(g_frtSolarisSplSetsEIF && pState->uOldPil != UINT32_MAX); 133 splx(pState->uOldPil); 134 131 135 vbi_preempt_enable(); 136 137 pState->uOldPil = UINT32_MAX; 132 138 } 133 139
Note:
See TracChangeset
for help on using the changeset viewer.

