Changeset 22150 in vbox for trunk/src/VBox/Runtime/r0drv/linux
- Timestamp:
- Aug 11, 2009 9:41:58 AM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 50921
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r0drv/linux/thread-r0drv-linux.c
r22057 r22150 35 35 #include "the-linux-kernel.h" 36 36 #include "internal/iprt.h" 37 38 37 #include <iprt/thread.h> 38 39 39 #include <iprt/asm.h> 40 40 #include <iprt/assert.h> 41 41 #include <iprt/err.h> 42 #include <iprt/mp.h> 42 43 43 44 … … 160 161 #ifdef CONFIG_PREEMPT 161 162 AssertPtr(pState); 162 Assert(pState->u chDummy != 42);163 pState->u chDummy= 42;163 Assert(pState->u32Reserved == 0); 164 pState->u32Reserved = 42; 164 165 preempt_disable(); 166 RT_ASSERT_PREEMPT_CPUID_DISABLE(pState); 165 167 166 168 #else /* !CONFIG_PREEMPT */ 167 169 int32_t c; 168 170 AssertPtr(pState); 171 Assert(pState->u32Reserved == 0); 169 172 170 173 /* Do our own accounting. */ 171 174 c = ASMAtomicIncS32(&g_acPreemptDisabled[smp_processor_id()]); 172 175 AssertMsg(c > 0 && c < 32, ("%d\n", c)); 173 pState->uchDummy = (unsigned char )c; 176 pState->u32Reserved = c; 177 RT_ASSERT_PREEMPT_CPUID_DISABLE(pState); 174 178 #endif 175 179 } … … 181 185 #ifdef CONFIG_PREEMPT 182 186 AssertPtr(pState); 183 Assert(pState->u chDummy== 42);184 pState->uchDummy = 0;187 Assert(pState->u32Reserved == 42); 188 RT_ASSERT_PREEMPT_CPUID_RESTORE(pState); 185 189 preempt_enable(); 186 190 … … 188 192 int32_t volatile *pc; 189 193 AssertPtr(pState); 190 AssertMsg(pState->uchDummy > 0 && pState->uchDummy < 32, ("%d\n", pState->uchDummy)); 194 AssertMsg(pState->u32Reserved > 0 && pState->u32Reserved < 32, ("%d\n", pState->u32Reserved)); 195 RT_ASSERT_PREEMPT_CPUID_RESTORE(pState); 191 196 192 197 /* Do our own accounting. */ 193 198 pc = &g_acPreemptDisabled[smp_processor_id()]; 194 AssertMsg(pState->uchDummy == (uint32_t)*pc, ("uchDummy=%d *pc=%d \n", pState->uchDummy, *pc)); 195 ASMAtomicUoWriteS32(pc, pState->uchDummy - 1); 196 #endif 199 AssertMsg(pState->u32Reserved == (uint32_t)*pc, ("u32Reserved=%d *pc=%d \n", pState->u32Reserved, *pc)); 200 ASMAtomicUoWriteS32(pc, pState->u32Reserved - 1); 201 #endif 202 pState->u32Reserved = 0; 197 203 } 198 204 RT_EXPORT_SYMBOL(RTThreadPreemptRestore);
Note:
See TracChangeset
for help on using the changeset viewer.