Changeset 666 for trunk/kernel/libk/remote_queuelock.c
- Timestamp:
- Oct 10, 2020, 5:27:12 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/libk/remote_queuelock.c
r629 r666 56 56 #if DEBUG_QUEUELOCK_TYPE 57 57 thread_t * this = CURRENT_THREAD; 58 if( (type == DEBUG_QUEUELOCK_TYPE) && 59 (lock_ptr == DEBUG_QUEUELOCK_PTR ) && 60 (lock_cxy == DEBUG_QUEUELOCK_CXY ) ) 61 printk("\n[%s] thread[%x,%x] initialise lock %s [%x,%x]\n", 58 bool_t cond = (type == DEBUG_QUEUELOCK_TYPE) && 59 (((lock_cxy == (cxy_t)DEBUG_QUEUELOCK_CXY) && 60 (lock_ptr == (remote_queuelock_t*)DEBUG_QUEUELOCK_PTR)) || 61 ((DEBUG_QUEUELOCK_CXY == 0) && 62 (DEBUG_QUEUELOCK_PTR == 0))); 63 if( cond )printk("\n[%s] thread[%x,%x] initialise lock %s [%x,%x]\n", 62 64 __FUNCTION__, this->process->pid, this->trdid, 63 65 lock_type_str[type], lock_cxy, lock_ptr ); … … 70 72 { 71 73 thread_t * this = CURRENT_THREAD; 72 73 // check calling thread can yield74 thread_assert_can_yield( this , __FUNCTION__ );75 74 76 75 // get lock cluster and local pointer … … 78 77 remote_queuelock_t * lock_ptr = GET_PTR( lock_xp ); 79 78 80 #if DEBUG_QUEUELOCK_TYPE 81 uint32_t lock_type = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->lock.type ) ); 79 // check calling thread can yield 80 thread_assert_can_yield( this , __FUNCTION__ ); 81 82 #if DEBUG_QUEUELOCK_TYPE 83 uint32_t lock_type = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->lock.type ) ); 84 bool_t cond = (lock_type == DEBUG_QUEUELOCK_TYPE) && 85 (((lock_cxy == (cxy_t)DEBUG_QUEUELOCK_CXY) && 86 (lock_ptr == (remote_queuelock_t*)DEBUG_QUEUELOCK_PTR)) || 87 ((DEBUG_QUEUELOCK_CXY == 0) && 88 (DEBUG_QUEUELOCK_PTR == 0))); 82 89 #endif 83 90 … … 93 100 94 101 #if DEBUG_QUEUELOCK_TYPE 95 if( (lock_type == DEBUG_QUEUELOCK_TYPE) && 96 (lock_ptr == DEBUG_QUEUELOCK_PTR ) && 97 (lock_cxy == DEBUG_QUEUELOCK_CXY ) ) 98 printk("\n[%s] thread[%x,%x] BLOCK on q_lock %s [%x,%x]\n", 102 if( cond ) printk("\n[%s] thread[%x,%x] BLOCK on q_lock %s [%x,%x]\n", 99 103 __FUNCTION__, this->process->pid, this->trdid, 100 104 lock_type_str[lock_type], lock_cxy, lock_ptr ); … … 121 125 122 126 #if DEBUG_QUEUELOCK_TYPE 123 if( (lock_type == DEBUG_QUEUELOCK_TYPE) && 124 (lock_ptr == DEBUG_QUEUELOCK_PTR ) && 125 (lock_cxy == DEBUG_QUEUELOCK_CXY ) ) 126 printk("\n[%s] thread[%x,%x] ACQUIRE q_lock %s [%x,%x]\n", 127 if( cond ) printk("\n[%s] thread[%x,%x] ACQUIRE q_lock %s [%x,%x]\n", 127 128 __FUNCTION__, this->process->pid, this->trdid, 128 129 lock_type_str[lock_type], lock_cxy, lock_ptr ); … … 149 150 remote_queuelock_t * lock_ptr = GET_PTR( lock_xp ); 150 151 152 #if DEBUG_QUEUELOCK_TYPE 153 thread_t * this = CURRENT_THREAD; 154 uint32_t lock_type = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->lock.type ) ); 155 bool_t cond = (lock_type == DEBUG_QUEUELOCK_TYPE) && 156 (((lock_cxy == (cxy_t)DEBUG_QUEUELOCK_CXY) && 157 (lock_ptr == (remote_queuelock_t*)DEBUG_QUEUELOCK_PTR)) || 158 ((DEBUG_QUEUELOCK_CXY == 0) && 159 (DEBUG_QUEUELOCK_PTR == 0))); 160 #endif 161 151 162 // build extended pointer on busylock protecting queuelock 152 163 xptr_t busylock_xp = XPTR( lock_cxy , &lock_ptr->lock ); … … 156 167 157 168 #if DEBUG_QUEUELOCK_TYPE 158 thread_t * this = CURRENT_THREAD; 159 uint32_t lock_type = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->lock.type ) ); 160 if( (lock_type == DEBUG_QUEUELOCK_TYPE) && 161 (lock_ptr == DEBUG_QUEUELOCK_PTR ) && 162 (lock_cxy == DEBUG_QUEUELOCK_CXY ) ) 163 printk("\n[%s] thread[%x,%x] RELEASE q_lock %s (%x,%x)\n", 169 if( cond ) printk("\n[%s] thread[%x,%x] RELEASE q_lock %s [%x,%x]\n", 164 170 __FUNCTION__, this->process->pid, this->trdid, 165 171 lock_type_str[lock_type], lock_cxy, lock_ptr ); … … 179 185 180 186 #if DEBUG_QUEUELOCK_TYPE 181 if( (lock_type == DEBUG_QUEUELOCK_TYPE) && 182 (lock_ptr == DEBUG_QUEUELOCK_PTR ) && 183 (lock_cxy == DEBUG_QUEUELOCK_CXY ) ) 187 if( cond ) 184 188 { 185 189 trdid_t trdid = hal_remote_l32( XPTR( thread_cxy , &thread_ptr->trdid ) );
Note: See TracChangeset
for help on using the changeset viewer.