Changeset 7032 in vbox for trunk/src/VBox/Runtime/r0drv
- Timestamp:
- Feb 20, 2008 12:26:22 PM (17 years ago)
- Location:
- trunk/src/VBox/Runtime/r0drv/linux
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r0drv/linux/semevent-r0drv-linux.c
r5999 r7032 24 24 * terms and conditions of either the GPL or the CDDL or both. 25 25 */ 26 27 26 28 27 … … 139 138 int rc = VINF_SUCCESS; 140 139 long lTimeout = cMillies == RT_INDEFINITE_WAIT ? MAX_SCHEDULE_TIMEOUT : msecs_to_jiffies(cMillies); 140 #ifdef IPRT_DEBUG_SEMS 141 snprintf(current->comm, TASK_COMM_LEN, "e%lx", IPRT_DEBUG_SEMS_ADDRESS(pEventInt)); 142 #endif 141 143 for (;;) 142 144 { … … 174 176 175 177 finish_wait(&pEventInt->Head, &Wait); 178 #ifdef IPRT_DEBUG_SEMS 179 snprintf(current->comm, TASK_COMM_LEN, "e%lx:%d", IPRT_DEBUG_SEMS_ADDRESS(pEventInt), rc); 180 #endif 176 181 return rc; 177 182 } -
trunk/src/VBox/Runtime/r0drv/linux/semeventmulti-r0drv-linux.c
r5999 r7032 24 24 * terms and conditions of either the GPL or the CDDL or both. 25 25 */ 26 27 26 28 27 … … 150 149 int rc = VINF_SUCCESS; 151 150 long lTimeout = cMillies == RT_INDEFINITE_WAIT ? MAX_SCHEDULE_TIMEOUT : msecs_to_jiffies(cMillies); 151 #ifdef IPRT_DEBUG_SEMS 152 snprintf(current->comm, TASK_COMM_LEN, "E%lx", IPRT_DEBUG_SEMS_ADDRESS(pThis)); 153 #endif 152 154 for (;;) 153 155 { … … 185 187 186 188 finish_wait(&pThis->Head, &Wait); 189 #ifdef IPRT_DEBUG_SEMS 190 snprintf(current->comm, TASK_COMM_LEN, "E%lx:%d", IPRT_DEBUG_SEMS_ADDRESS(pThis), rc); 191 #endif 187 192 return rc; 188 193 } -
trunk/src/VBox/Runtime/r0drv/linux/semfastmutex-r0drv-linux.c
r5999 r7032 36 36 #include <iprt/asm.h> 37 37 #include <iprt/err.h> 38 #ifdef IPRT_DEBUG_SEMS 39 # include <iprt/thread.h> 40 #endif 38 41 39 42 #include "internal/magics.h" … … 52 55 /** the linux semaphore. */ 53 56 struct semaphore Semaphore; 57 #ifdef IPRT_DEBUG_SEMS 58 /** For check. */ 59 RTNATIVETHREAD volatile Owner; 60 #endif 54 61 } RTSEMFASTMUTEXINTERNAL, *PRTSEMFASTMUTEXINTERNAL; 55 62 … … 70 77 pFastInt->u32Magic = RTSEMFASTMUTEX_MAGIC; 71 78 sema_init(&pFastInt->Semaphore, 1); 79 #ifdef IPRT_DEBUG_SEMS 80 pFastInt->Owner = NIL_RTNATIVETHREAD; 81 #endif 72 82 *pMutexSem = pFastInt; 73 83 return VINF_SUCCESS; … … 108 118 } 109 119 120 #ifdef IPRT_DEBUG_SEMS 121 snprintf(current->comm, TASK_COMM_LEN, "d%lx", IPRT_DEBUG_SEMS_ADDRESS(pFastInt)); 122 #endif 110 123 down(&pFastInt->Semaphore); 124 #ifdef IPRT_DEBUG_SEMS 125 snprintf(current->comm, TASK_COMM_LEN, "o%lx", IPRT_DEBUG_SEMS_ADDRESS(pFastInt)); 126 AssertRelease(pFastInt->Owner == NIL_RTNATIVETHREAD); 127 ASMAtomicUoWriteSize(&pFastInt->Owner, RTThreadNativeSelf()); 128 #endif 111 129 return VINF_SUCCESS; 112 130 } … … 126 144 } 127 145 146 #ifdef IPRT_DEBUG_SEMS 147 AssertRelease(pFastInt->Owner == RTThreadNativeSelf()); 148 ASMAtomicUoWriteSize(&pFastInt->Owner, NIL_RTNATIVETHREAD); 149 #endif 128 150 up(&pFastInt->Semaphore); 151 #ifdef IPRT_DEBUG_SEMS 152 snprintf(current->comm, TASK_COMM_LEN, "u%lx", IPRT_DEBUG_SEMS_ADDRESS(pFastInt)); 153 #endif 129 154 return VINF_SUCCESS; 130 155 } -
trunk/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h
r6846 r7032 242 242 #endif 243 243 244 #endif 245 244 /** 245 * Hack for shortening pointers on linux so we can stuff more stuff into the 246 * task_struct::comm field. This is used by the semaphore code but put here 247 * because we don't have any better place atm. Don't use outside IPRT, please. 248 */ 249 #ifdef RT_ARCH_AMD64 250 # define IPRT_DEBUG_SEMS_ADDRESS(addr) ( ((long)(addr) & (long)~UINT64_C(0xfffffff000000000)) ) 251 #else 252 # define IPRT_DEBUG_SEMS_ADDRESS(addr) ( (long)(addr) ) 253 #endif 254 255 #endif 256
Note:
See TracChangeset
for help on using the changeset viewer.