Changeset 44535 in vbox for trunk/src/VBox/Runtime/r0drv/linux
- Timestamp:
- Feb 5, 2013 8:41:50 AM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 83582
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r0drv/linux/spinlock-r0drv-linux.c
r44528 r44535 95 95 #endif 96 96 97 /* 98 PLEASE DO NOT MODIFY THE NEXT FOUR LINES OF CODE! 99 100 We use this approach in order to split RTSPINLOCK_FLAGS_INTERRUPT_UNSAFE and 101 RTSPINLOCK_FLAGS_INTERRUPT_SAFE spinlocks into separated locking classes when 102 CONFIG_PROVE_LOCKING kernel option is enabled. Using single spin_lock_init() 103 call will trigger kernel warning regarding to incorrect spinlock usage. 104 */ 105 if (fFlags == RTSPINLOCK_FLAGS_INTERRUPT_UNSAFE) 106 spin_lock_init(&pThis->Spinlock); 107 else 108 spin_lock_init(&pThis->Spinlock); 97 spin_lock_init(&pThis->Spinlock); 109 98 110 99 *pSpinlock = pThis; … … 142 131 ("pThis=%p u32Magic=%08x\n", pThis, pThis ? (int)pThis->u32Magic : 0)); 143 132 133 #ifdef CONFIG_PROVE_LOCKING 134 lockdep_off(); 135 #endif 144 136 if (pThis->fFlags & RTSPINLOCK_FLAGS_INTERRUPT_SAFE) 145 137 { … … 150 142 else 151 143 spin_lock(&pThis->Spinlock); 144 #ifdef CONFIG_PROVE_LOCKING 145 lockdep_on(); 146 #endif 152 147 153 148 RT_ASSERT_PREEMPT_CPUID_SPIN_ACQUIRED(pThis); … … 164 159 RT_ASSERT_PREEMPT_CPUID_SPIN_RELEASE(pThis); 165 160 161 #ifdef CONFIG_PROVE_LOCKING 162 lockdep_off(); 163 #endif 166 164 if (pThis->fFlags & RTSPINLOCK_FLAGS_INTERRUPT_SAFE) 167 165 { … … 172 170 else 173 171 spin_unlock(&pThis->Spinlock); 172 #ifdef CONFIG_PROVE_LOCKING 173 lockdep_on(); 174 #endif 174 175 175 176 RT_ASSERT_PREEMPT_CPUID();
Note:
See TracChangeset
for help on using the changeset viewer.