Changeset 610 for trunk/kernel/libk/remote_rwlock.c
- Timestamp:
- Dec 27, 2018, 7:38:58 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/libk/remote_rwlock.c
r603 r610 53 53 remote_busylock_init( XPTR( lock_cxy , &lock_ptr->lock ) , type ); 54 54 55 #if DEBUG_RWLOCK 55 #if DEBUG_RWLOCK_TYPE 56 56 thread_t * this = CURRENT_THREAD; 57 if( DEBUG_RWLOCK < (uint32_t)hal_get_cycles())57 if( type == DEBUG_RWLOCK_TYPE ) 58 58 printk("\n[%s] thread[%x,%x] initialise lock %s [%x,%x]\n", 59 59 __FUNCTION__, this->process->pid, this->trdid, … … 75 75 cxy_t lock_cxy = GET_CXY( lock_xp ); 76 76 77 #if DEBUG_RWLOCK 77 #if DEBUG_RWLOCK_TYPE 78 78 uint32_t lock_type = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->lock.type ) ); 79 79 #endif … … 92 92 { 93 93 94 #if DEBUG_RWLOCK 95 if( DEBUG_RWLOCK < (uint32_t)hal_get_cycles())94 #if DEBUG_RWLOCK_TYPE 95 if( lock_type == DEBUG_RWLOCK_TYPE ) 96 96 printk("\n[%s] thread[%x,%x] READ BLOCK on rwlock %s [%x,%x] / taken %d / count %d\n", 97 97 __FUNCTION__, this->process->pid, this->trdid, … … 123 123 hal_fence(); 124 124 125 #if DEBUG_RWLOCK 126 if( DEBUG_RWLOCK < (uint32_t)hal_get_cycles())125 #if DEBUG_RWLOCK_TYPE 126 if( lock_type == DEBUG_RWLOCK_TYPE ) 127 127 printk("\n[%s] thread[%x,%x] READ ACQUIRE rwlock %s [%x,%x] / taken = %d / count = %d\n", 128 128 __FUNCTION__, this->process->pid, this->trdid, … … 148 148 cxy_t lock_cxy = GET_CXY( lock_xp ); 149 149 150 #if DEBUG_RWLOCK 150 #if DEBUG_RWLOCK_TYPE 151 151 uint32_t lock_type = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->lock.type ) ); 152 152 #endif … … 165 165 { 166 166 167 #if DEBUG_RWLOCK 168 if( DEBUG_RWLOCK < (uint32_t)hal_get_cycles())167 #if DEBUG_RWLOCK_TYPE 168 if( lock_type == DEBUG_RWLOCK_TYPE ) 169 169 printk("\n[%s] thread[%x,%x] WRITE BLOCK on rwlock %s [%x,%x] / taken %d / count %d\n", 170 170 __FUNCTION__, this->process->pid, this->trdid, … … 195 195 hal_remote_s32( taken_xp , 1 ); 196 196 197 #if DEBUG_RWLOCK 198 if( DEBUG_RWLOCK < (uint32_t)hal_get_cycles())197 #if DEBUG_RWLOCK_TYPE 198 if( lock_type == DEBUG_RWLOCK_TYPE ) 199 199 printk("\n[%s] thread[%x,%x] WRITE ACQUIRE rwlock %s [%x,%x] / taken %d / count %d\n", 200 200 __FUNCTION__, this->process->pid, this->trdid, … … 231 231 hal_remote_atomic_add( count_xp , -1 ); 232 232 233 #if DEBUG_RWLOCK 233 #if DEBUG_RWLOCK_TYPE 234 234 thread_t * this = CURRENT_THREAD; 235 235 uint32_t lock_type = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->lock.type ) ); 236 236 xptr_t taken_xp = XPTR( lock_cxy , &lock_ptr->taken ); 237 if( DEBUG_RWLOCK < (uint32_t)hal_get_cycles())237 if( lock_type == DEBUG_RWLOCK_TYPE ) 238 238 printk("\n[%s] thread[%x,%x] READ RELEASE rwlock %s [%x,%x] / taken %d / count %d\n", 239 239 __FUNCTION__, this->process->pid, this->trdid, … … 257 257 thread_unblock( thread_xp , THREAD_BLOCKED_LOCK ); 258 258 259 #if DEBUG_RWLOCK 260 if( (uint32_t)hal_get_cycles() > DEBUG_RWLOCK)259 #if DEBUG_RWLOCK_TYPE 260 if( lock_type == DEBUG_RWLOCK_TYPE ) 261 261 { 262 262 trdid_t trdid = hal_remote_l32( XPTR( thread_cxy , &thread_ptr->trdid ) ); … … 288 288 thread_unblock( thread_xp , THREAD_BLOCKED_LOCK ); 289 289 290 #if DEBUG_RWLOCK 291 if( (uint32_t)hal_get_cycles() > DEBUG_RWLOCK)290 #if DEBUG_RWLOCK_TYPE 291 if( lock_type == DEBUG_RWLOCK_TYPE ) 292 292 { 293 293 trdid_t trdid = hal_remote_l32( XPTR( thread_cxy , &thread_ptr->trdid ) ); … … 330 330 hal_remote_s32( taken_xp , 0 ); 331 331 332 #if DEBUG_RWLOCK 332 #if DEBUG_RWLOCK_TYPE 333 333 thread_t * this = CURRENT_THREAD; 334 334 uint32_t lock_type = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->lock.type ) ); 335 335 xptr_t count_xp = XPTR( lock_cxy , &lock_ptr->count ); 336 if( DEBUG_RWLOCK < (uint32_t)hal_get_cycles())336 if( lock_type == DEBUG_RWLOCK_TYPE ) 337 337 printk("\n[%s] thread[%x,%x] WRITE RELEASE rwlock %s [%x,%x] / taken %d / count %d\n", 338 338 __FUNCTION__, this->process->pid, this->trdid, … … 355 355 thread_unblock( thread_xp , THREAD_BLOCKED_LOCK ); 356 356 357 #if DEBUG_RWLOCK 358 if( (uint32_t)hal_get_cycles() > DEBUG_RWLOCK)357 #if DEBUG_RWLOCK_TYPE 358 if( lock_type == DEBUG_RWLOCK_TYPE ) 359 359 { 360 360 trdid_t trdid = hal_remote_l32( XPTR( thread_cxy , &thread_ptr->trdid ) ); … … 385 385 thread_unblock( thread_xp , THREAD_BLOCKED_LOCK ); 386 386 387 #if DEBUG_RWLOCK 388 if( (uint32_t)hal_get_cycles() > DEBUG_RWLOCK)387 #if DEBUG_RWLOCK_TYPE 388 if( lock_type == DEBUG_RWLOCK_TYPE ) 389 389 { 390 390 trdid_t trdid = hal_remote_l32( XPTR( thread_cxy , &thread_ptr->trdid ) );
Note: See TracChangeset
for help on using the changeset viewer.