Changeset 666 for trunk/kernel/libk/remote_rwlock.c
- Timestamp:
- Oct 10, 2020, 5:27:12 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/libk/remote_rwlock.c
r629 r666 55 55 #if DEBUG_RWLOCK_TYPE 56 56 thread_t * this = CURRENT_THREAD; 57 if( (type == DEBUG_RWLOCK_TYPE) && 58 ((intptr_t)lock_ptr == DEBUG_RWLOCK_PTR ) && 59 (lock_cxy == DEBUG_RWLOCK_CXY ) ) 57 bool_t cond = (type == DEBUG_RWLOCK_TYPE) && 58 (((lock_cxy == (cxt_t)DEBUG_RWLOCK_CXY) && 59 (lock_ptr == (remote_queuelock_t*)DEBUG_RWLOCK_PTR)) || 60 ((DEBUG_RWLOCK_CXY == 0) && 61 (DEBUG_RWLOCK_PTR == 0))); 62 if( cond ) 60 63 printk("\n[%s] thread[%x,%x] initialise lock %s [%x,%x]\n", 61 64 __FUNCTION__, this->process->pid, this->trdid, … … 78 81 79 82 #if DEBUG_RWLOCK_TYPE 80 uint32_t lock_type = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->lock.type ) ); 83 uint32_t lock_type = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->lock.type ) ); 84 bool_t cond = (type == DEBUG_RWLOCK_TYPE) && 85 (((lock_cxy == (cxt_t)DEBUG_RWLOCK_CXY) && 86 (lock_ptr == (remote_queuelock_t*)DEBUG_RWLOCK_PTR)) || 87 ((DEBUG_RWLOCK_CXY == 0) && 88 (DEBUG_RWLOCK_PTR == 0))); 89 xptr_t wr_root_xp = XPTR( lock_cxy , &lock_ptr->wr_xroot ); 81 90 #endif 82 91 … … 95 104 96 105 #if DEBUG_RWLOCK_TYPE 97 if( (lock_type == DEBUG_RWLOCK_TYPE) && 98 ((intptr_t)lock_ptr == DEBUG_RWLOCK_PTR ) && 99 (lock_cxy == DEBUG_RWLOCK_CXY ) ) 100 printk("\n[%s] thread[%x,%x] READ BLOCK on rwlock %s [%x,%x] / taken %d / count %d\n", 106 if( cond ) 107 printk("\n[%s] thread[%x,%x] READ BLOCK on %s [%x,%x]\n" 108 " taken %d / count %d / wr_empty %d / rd_empty %d\n", 101 109 __FUNCTION__, this->process->pid, this->trdid, 102 110 lock_type_str[lock_type], lock_cxy, lock_ptr, 103 hal_remote_l32( taken_xp ), hal_remote_l32( count_xp ) ); 111 hal_remote_l32( taken_xp ), hal_remote_l32( count_xp ), 112 xlist_is_empty( wr_root_xp ), xlist_is_empty( rd_root_xp ) ); 104 113 #endif 105 114 // get pointer on calling thread … … 128 137 129 138 #if DEBUG_RWLOCK_TYPE 130 if( (lock_type == DEBUG_RWLOCK_TYPE) && 131 ((intptr_t)lock_ptr == DEBUG_RWLOCK_PTR ) && 132 (lock_cxy == DEBUG_RWLOCK_CXY ) ) 133 printk("\n[%s] thread[%x,%x] READ ACQUIRE rwlock %s [%x,%x] / taken %d / count %d\n", 139 if( cond ) 140 printk("\n[%s] thread[%x,%x] READ ACQUIRE %s [%x,%x]\n" 141 " taken %d / count %d / wr_empty %d / rd_empty %d\n", 134 142 __FUNCTION__, this->process->pid, this->trdid, 135 143 lock_type_str[lock_type], lock_cxy, lock_ptr, 136 hal_remote_l32( taken_xp ), hal_remote_l32( count_xp ) ); 144 hal_remote_l32( taken_xp ), hal_remote_l32( count_xp ), 145 xlist_is_empty( wr_root_xp ), xlist_is_empty( rd_root_xp ) ); 137 146 #endif 138 147 … … 155 164 156 165 #if DEBUG_RWLOCK_TYPE 157 uint32_t lock_type = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->lock.type ) ); 166 uint32_t lock_type = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->lock.type ) ); 167 bool_t cond = (type == DEBUG_RWLOCK_TYPE) && 168 (((lock_cxy == (cxt_t)DEBUG_RWLOCK_CXY) && 169 (lock_ptr == (remote_queuelock_t*)DEBUG_RWLOCK_PTR)) || 170 ((DEBUG_RWLOCK_CXY == 0) && 171 (DEBUG_RWLOCK_PTR == 0))); 172 xptr_t rd_root_xp = XPTR( lock_cxy , &lock_ptr->rd_xroot ); 158 173 #endif 159 174 … … 172 187 173 188 #if DEBUG_RWLOCK_TYPE 174 if( (lock_type == DEBUG_RWLOCK_TYPE) && 175 ((intptr_t)lock_ptr == DEBUG_RWLOCK_PTR ) && 176 (lock_cxy == DEBUG_RWLOCK_CXY ) ) 177 printk("\n[%s] thread[%x,%x] WRITE BLOCK on rwlock %s [%x,%x] / taken %d / count %d\n", 189 if( cond ) 190 printk("\n[%s] thread[%x,%x] WRITE BLOCK on %s [%x,%x]\n" 191 " taken %d / count %d / wr_empty %d / rd_empty %d\n", 178 192 __FUNCTION__, this->process->pid, this->trdid, 179 193 lock_type_str[lock_type], lock_cxy, lock_ptr, 180 hal_remote_l32( taken_xp ), hal_remote_l32( count_xp ) ); 194 hal_remote_l32( taken_xp ), hal_remote_l32( count_xp ), 195 xlist_is_empty( wr_root_xp ), xlist_is_empty( rd_root_xp ) ); 181 196 #endif 182 197 … … 204 219 205 220 #if DEBUG_RWLOCK_TYPE 206 if( (lock_type == DEBUG_RWLOCK_TYPE) && 207 ((intptr_t)lock_ptr == DEBUG_RWLOCK_PTR ) && 208 (lock_cxy == DEBUG_RWLOCK_CXY ) ) 209 printk("\n[%s] thread[%x,%x] WRITE ACQUIRE rwlock %s [%x,%x] / taken %d / count %d\n", 221 if( cond ) 222 printk("\n[%s] thread[%x,%x] WRITE ACQUIRE %s [%x,%x]\n" 223 " taken %d / count %d / wr_empty %d / rd_empty %d\n", 210 224 __FUNCTION__, this->process->pid, this->trdid, 211 225 lock_type_str[lock_type], lock_cxy, lock_ptr, 212 hal_remote_l32( taken_xp ), hal_remote_l32( count_xp ) ); 226 hal_remote_l32( taken_xp ), hal_remote_l32( count_xp ), 227 xlist_is_empty( wr_root_xp ), xlist_is_empty( rd_root_xp ) ); 213 228 #endif 214 229 … … 244 259 thread_t * this = CURRENT_THREAD; 245 260 uint32_t lock_type = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->lock.type ) ); 261 bool_t cond = (type == DEBUG_RWLOCK_TYPE) && 262 (((lock_cxy == (cxt_t)DEBUG_RWLOCK_CXY) && 263 (lock_ptr == (remote_queuelock_t*)DEBUG_RWLOCK_PTR)) || 264 ((DEBUG_RWLOCK_CXY == 0) && 265 (DEBUG_RWLOCK_PTR == 0))); 246 266 xptr_t taken_xp = XPTR( lock_cxy , &lock_ptr->taken ); 247 if( (lock_type == DEBUG_RWLOCK_TYPE) && 248 ((intptr_t)lock_ptr == DEBUG_RWLOCK_PTR ) && 249 (lock_cxy == DEBUG_RWLOCK_CXY ) ) 250 printk("\n[%s] thread[%x,%x] READ RELEASE rwlock %s [%x,%x] / taken %d / count %d\n", 267 #endif 268 269 #if DEBUG_RWLOCK_TYPE 270 if( cond ) 271 printk("\n[%s] thread[%x,%x] READ RELEASE %s [%x,%x]\n" 272 " taken %d / count %d / wr_empty %d / rd_empty %d\n", 251 273 __FUNCTION__, this->process->pid, this->trdid, 252 274 lock_type_str[lock_type], lock_cxy, lock_ptr, 253 hal_remote_l32( taken_xp ), hal_remote_l32( count_xp ) ); 275 hal_remote_l32( taken_xp ), hal_remote_l32( count_xp ), 276 xlist_is_empty( wr_root_xp ), xlist_is_empty( rd_root_xp ) ); 254 277 #endif 255 278 … … 270 293 271 294 #if DEBUG_RWLOCK_TYPE 272 if( (lock_type == DEBUG_RWLOCK_TYPE) && 273 ((intptr_t)lock_ptr == DEBUG_RWLOCK_PTR ) && 274 (lock_cxy == DEBUG_RWLOCK_CXY ) ) 295 if( cond ) 275 296 { 276 297 trdid_t trdid = hal_remote_l32( XPTR( thread_cxy , &thread_ptr->trdid ) ); … … 303 324 304 325 #if DEBUG_RWLOCK_TYPE 305 if( (lock_type == DEBUG_RWLOCK_TYPE) && 306 ((intptr_t)lock_ptr == DEBUG_RWLOCK_PTR ) && 307 (lock_cxy == DEBUG_RWLOCK_CXY ) ) 326 if( cond ) 308 327 { 309 328 trdid_t trdid = hal_remote_l32( XPTR( thread_cxy , &thread_ptr->trdid ) ); … … 349 368 thread_t * this = CURRENT_THREAD; 350 369 uint32_t lock_type = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->lock.type ) ); 370 bool_t cond = (type == DEBUG_RWLOCK_TYPE) && 371 (((lock_cxy == (cxt_t)DEBUG_RWLOCK_CXY) && 372 (lock_ptr == (remote_queuelock_t*)DEBUG_RWLOCK_PTR)) || 373 ((DEBUG_RWLOCK_CXY == 0) && 374 (DEBUG_RWLOCK_PTR == 0))); 351 375 xptr_t count_xp = XPTR( lock_cxy , &lock_ptr->count ); 352 if( (lock_type == DEBUG_RWLOCK_TYPE) && 353 ((intptr_t)lock_ptr == DEBUG_RWLOCK_PTR ) && 354 (lock_cxy == DEBUG_RWLOCK_CXY ) ) 355 printk("\n[%s] thread[%x,%x] WRITE RELEASE rwlock %s [%x,%x] / taken %d / count %d\n", 376 #endif 377 378 #if DEBUG_RWLOCK_TYPE 379 if( cond ) 380 printk("\n[%s] thread[%x,%x] WRITE RELEASE %s [%x,%x]\n" 381 " taken %d / count %d / wr_empty %d / rd_empty %d\n", 356 382 __FUNCTION__, this->process->pid, this->trdid, 357 383 lock_type_str[lock_type], lock_cxy, lock_ptr, 358 hal_remote_l32( taken_xp ), hal_remote_l32( count_xp ) ); 384 hal_remote_l32( taken_xp ), hal_remote_l32( count_xp ), 385 xlist_is_empty( wr_root_xp ), xlist_is_empty( rd_root_xp ) ); 359 386 #endif 360 387 … … 374 401 375 402 #if DEBUG_RWLOCK_TYPE 376 if( (lock_type == DEBUG_RWLOCK_TYPE) && 377 ((intptr_t)lock_ptr == DEBUG_RWLOCK_PTR ) && 378 (lock_cxy == DEBUG_RWLOCK_CXY ) ) 403 if( cond ) 379 404 { 380 405 trdid_t trdid = hal_remote_l32( XPTR( thread_cxy , &thread_ptr->trdid ) ); … … 406 431 407 432 #if DEBUG_RWLOCK_TYPE 408 if( (lock_type == DEBUG_RWLOCK_TYPE) && 409 ((intptr_t)lock_ptr == DEBUG_RWLOCK_PTR ) && 410 (lock_cxy == DEBUG_RWLOCK_CXY ) ) 433 if( cond ) 411 434 { 412 435 trdid_t trdid = hal_remote_l32( XPTR( thread_cxy , &thread_ptr->trdid ) );
Note: See TracChangeset
for help on using the changeset viewer.