Changeset 50 for trunk/kernel/libk
- Timestamp:
- Jun 26, 2017, 3:15:11 PM (7 years ago)
- Location:
- trunk/kernel/libk
- Files:
-
- 3 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 -
trunk/kernel/libk/remote_rwlock.h
r23 r50 92 92 void remote_rwlock_wr_unlock( xptr_t lock_xp ); 93 93 94 /*************************************************************************************** 95 * Display the lock state on kernel TTY. 96 *************************************************************************************** 97 * @ lock_xp : extended pointer on the remote rwlock 98 * @ comment : comment to be printed. 99 **************************************************************************************/ 100 void remote_rwlock_print( xptr_t lock_xp, 101 char * comment ); 102 94 103 #endif -
trunk/kernel/libk/xhtab.c
r23 r50 143 143 xptr_t xlist_xp ) 144 144 { 145 146 printk("\n @@@ xhtab_insert : 0 / name = %s / xhtab_xp = %l / xlist_xp = %l\n",147 key , xhtab_xp , xlist_xp );148 149 145 // get xhtab cluster and local pointer 150 146 cxy_t xhtab_cxy = GET_CXY( xhtab_xp ); … … 154 150 uint32_t index = xhtab_ptr->index( key ); 155 151 156 printk("\n @@@ xhtab_insert : 1 / name = %s / index = %d\n",157 key , index );158 159 152 // take the lock protecting hash table 160 153 remote_rwlock_wr_lock( XPTR( xhtab_cxy , &xhtab_ptr->lock ) ); … … 168 161 remote_rwlock_wr_unlock( XPTR( xhtab_cxy , &xhtab_ptr->lock ) ); 169 162 170 printk("\n @@@ xhtab_insert : 2 / name = %s / item_xp = %l\n",171 key , item_xp );172 173 163 return EINVAL; 174 164 } … … 183 173 // release the lock protecting hash table 184 174 remote_rwlock_wr_unlock( XPTR( xhtab_cxy , &xhtab_ptr->lock ) ); 185 186 printk("\n @@@ xhtab_insert : 3 / name = %s / item_xp = %l\n",187 key , xhtab_ptr->scan( xhtab_xp , index , key ) );188 175 189 176 return 0;
Note: See TracChangeset
for help on using the changeset viewer.