Changeset 50 for trunk/kernel/libk/remote_rwlock.c
- Timestamp:
- Jun 26, 2017, 3:15:11 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/libk/remote_rwlock.c
r23 r50 26 26 #include <hal_irqmask.h> 27 27 #include <thread.h> 28 #include <printk.h> 28 29 #include <cluster.h> 29 30 #include <scheduler.h> … … 185 186 186 187 // compute extended pointers on lock->ticket, lock->owner and thread->remote_locks 187 xptr_t current_xp = XPTR( lock_cxy , &lock_ptr-> ticket );188 xptr_t current_xp = XPTR( lock_cxy , &lock_ptr->current ); 188 189 xptr_t owner_xp = XPTR( lock_cxy , &lock_ptr->owner ); 189 190 xptr_t locks_xp = XPTR( thread_cxy , &thread_ptr->remote_locks ); … … 202 203 } // end remote_rwlock_wr_unlock() 203 204 204 205 /////////////////////////////////////////// 206 void remote_rwlock_print( xptr_t lock_xp, 207 char * comment ) 208 { 209 uint32_t ticket; // first free ticket index 210 uint32_t current; // ticket index of current owner 211 uint32_t count; // current number of reader threads 212 xptr_t owner; // extended pointer on writer thread 213 214 // get cluster and local pointer on remote_rwlock 215 remote_rwlock_t * lock_ptr = (remote_rwlock_t *)GET_PTR( lock_xp ); 216 cxy_t lock_cxy = GET_CXY( lock_xp ); 217 218 ticket = hal_remote_lw ( XPTR( lock_cxy , &lock_ptr->ticket ) ); 219 current = hal_remote_lw ( XPTR( lock_cxy , &lock_ptr->current ) ); 220 count = hal_remote_lw ( XPTR( lock_cxy , &lock_ptr->count ) ); 221 owner = hal_remote_lwd( XPTR( lock_cxy , &lock_ptr->owner ) ); 222 223 printk("\n*** rwlock <%l> %s : ticket = %d / current = %d / count = %d / owner = %l\n", 224 lock_xp , comment , ticket , current , count , owner ); 225 226 } // end remote_rwlock_print() 227
Note: See TracChangeset
for help on using the changeset viewer.