Changeset 436 for trunk/kernel/libk
- Timestamp:
- Mar 7, 2018, 9:02:03 AM (7 years ago)
- Location:
- trunk/kernel/libk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/libk/remote_barrier.c
r408 r436 273 273 274 274 // block & deschedule the calling thread 275 thread_block( thread_ptr, THREAD_BLOCKED_USERSYNC );275 thread_block( XPTR( local_cxy , thread_ptr ) , THREAD_BLOCKED_USERSYNC ); 276 276 sched_yield("blocked on barrier"); 277 277 -
trunk/kernel/libk/remote_condvar.c
r408 r436 188 188 189 189 // block the calling thread 190 thread_block( CURRENT_THREAD, THREAD_BLOCKED_USERSYNC );190 thread_block( XPTR( local_cxy , CURRENT_THREAD ) , THREAD_BLOCKED_USERSYNC ); 191 191 sched_yield("blocked on condvar"); 192 192 -
trunk/kernel/libk/remote_mutex.c
r408 r436 207 207 208 208 // block & deschedule the calling thread 209 thread_block( thread_ptr, THREAD_BLOCKED_USERSYNC );209 thread_block( XPTR( local_cxy , thread_ptr ) , THREAD_BLOCKED_USERSYNC ); 210 210 sched_yield("blocked on mutex"); 211 211 -
trunk/kernel/libk/remote_rwlock.c
r433 r436 2 2 * remote_rwlock.c - kernel remote rwlock implementation. 3 3 * 4 * Authors Alain Greiner (2016,2017 )4 * Authors Alain Greiner (2016,2017,2018) 5 5 * 6 6 * Copyright (c) UPMC Sorbonne Universites … … 41 41 hal_remote_sw ( XPTR( lock_cxy , &lock_ptr->count ) , 0 ); 42 42 43 #if CONFIG_DEBUG_ LOCKS44 45 43 #if CONFIG_DEBUG_REMOTE_RWLOCKS 44 hal_remote_swd( XPTR( lock_cxy , &lock_ptr->owner ) , XPTR_NULL ); 45 xlist_entry_init( XPTR( lock_cxy , &lock_ptr->list ) ); 46 46 #endif 47 47 … … 86 86 thread_ptr->remote_locks++; 87 87 88 #if CONFIG_DEBUG_ LOCKS89 90 88 #if CONFIG_DEBUG_REMOTE_RWLOCKS 89 xlist_add_first( XPTR( local_cxy , &thread_ptr->xlocks_root ) , 90 XPTR( lock_cxy , &lock_ptr->list ) ); 91 91 #endif 92 92 … … 126 126 thread_ptr->remote_locks--; 127 127 128 #if CONFIG_DEBUG_ LOCKS129 128 #if CONFIG_DEBUG_REMOTE_RWLOCKS 129 xlist_unlink( XPTR( lock_cxy , &lock_ptr->list ) ); 130 130 #endif 131 131 … … 176 176 } 177 177 178 #if CONFIG_DEBUG_ LOCKS179 180 181 182 178 #if CONFIG_DEBUG_REMOTE_RWLOCKS 179 hal_remote_swd( XPTR( lock_cxy , &lock_ptr->owner ) , 180 XPTR( local_cxy , thread_ptr ) ); 181 xlist_add_first( XPTR( local_cxy , &thread_ptr->xlocks_root ) , 182 XPTR( lock_cxy , &lock_ptr->list ) ); 183 183 #endif 184 184 … … 210 210 211 211 #if CONFIG_LOCKS_OWNER 212 213 212 hal_remote_swd( XPTR( lock_cxy , &lock_ptr->owner ) , XPTR_NULL ); 213 xlist_unlink( XPTR( lock_cxy , &lock_ptr->list ) ); 214 214 #endif 215 215 -
trunk/kernel/libk/remote_rwlock.h
r409 r436 2 2 * remote_rwlock.h - kernel remote_rwlock definition. 3 3 * 4 * Authors Alain Greiner (2016 )4 * Authors Alain Greiner (2016,2017,2018) 5 5 * 6 6 * Copyright (c) UPMC Sorbonne Universites … … 48 48 uint32_t count; /*! current number of reader threads */ 49 49 50 #if CONFIG_ LOCKS_DEBUG50 #if CONFIG_DEBUG_REMOTE_RWLOCKS 51 51 xptr_t owner; /*! extended pointer on writer thread */ 52 52 xlist_entry_t list; /*! member of list of remote locks taken by owner */ -
trunk/kernel/libk/remote_sem.c
r408 r436 218 218 219 219 // block and deschedule 220 thread_block( this, THREAD_BLOCKED_SEM );220 thread_block( XPTR( local_cxy , this ) , THREAD_BLOCKED_SEM ); 221 221 sched_yield("blocked on semaphore"); 222 222 } -
trunk/kernel/libk/remote_spinlock.c
r433 r436 2 2 * remote_spinlock.c - kernel remote spinlock implementation. 3 3 * 4 * Authors Mohamed Karaoui (2015) 5 * Alain Greiner (2016) 4 * Authors Alain Greiner (2016,2017,2018) 6 5 * 7 6 * Copyright (c) UPMC Sorbonne Universites … … 39 38 hal_remote_sw ( XPTR( cxy , &ptr->taken ) , 0 ); 40 39 41 #if CONFIG_DEBUG_ LOCKS42 43 40 #if CONFIG_DEBUG_REMOTE_SPINLOCKS 41 hal_remote_swd( XPTR( cxy , &ptr->owner ) , XPTR_NULL ); 42 xlist_entry_init( XPTR( cxy , &ptr->list ) ); 44 43 #endif 45 44 … … 76 75 thread_ptr->remote_locks++; 77 76 78 #if CONFIG_DEBUG_ LOCKS79 80 81 82 77 #if CONFIG_DEBUG_REMOTE_SPINLOCKS 78 hal_remote_swd( XPTR( lock_cxy , &lock_ptr->owner ) , 79 XPTR( local_cxy , thread_ptr) ); 80 xlist_add_first( XPTR( local_cxy , &thread_ptr->xlocks_root ) , 81 XPTR( lock_cxy , &lock_ptr->list ) ); 83 82 #endif 84 83 … … 121 120 thread_ptr->remote_locks++; 122 121 123 #if CONFIG_DEBUG_ LOCKS124 125 126 127 122 #if CONFIG_DEBUG_REMOTE_SPINLOCKS 123 hal_remote_swd( XPTR( lock_cxy , &lock_ptr->owner ) , 124 XPTR( local_cxy , thread_ptr) ); 125 xlist_add_first( XPTR( local_cxy , &thread_ptr->xlocks_root ) , 126 XPTR( lock_cxy , &lock_ptr->list ) ); 128 127 #endif 129 128 … … 144 143 thread_t * thread_ptr = CURRENT_THREAD; 145 144 146 #if CONFIG_DEBUG_ LOCKS147 148 145 #if CONFIG_DEBUG_REMOTE_SPINLOCKS 146 hal_remote_swd( XPTR( lock_cxy , &lock_ptr->owner ) , XPTR_NULL ); 147 xlist_unlink( XPTR( lock_cxy , &lock_ptr->list ) ); 149 148 #endif 150 149 … … 197 196 thread_ptr->remote_locks++; 198 197 199 #if CONFIG_DEBUG_LOCKS 200 hal_remote_swd( XPTR( lock_cxy , &lock_ptr->owner ) , 201 XPTR( local_cxy , thread_ptr) ); 202 xlist_add_first( XPTR( local_cxy , &thread_ptr->xlocks_root ) , 203 XPTR( lock_cxy , &lock_ptr->list ) ); 198 #if CONFIG_DEBUG_REMOTE_SPINLOCKS 199 hal_remote_swd( XPTR( lock_cxy , &lock_ptr->owner ), 200 XPTR( local_cxy , thread_ptr) ); 201 xlist_add_first( XPTR( local_cxy , &thread_ptr->xlocks_root ), 202 XPTR( lock_cxy , &lock_ptr->list ) ); 203 204 // if( (uint32_t)lock_ptr == 0x66788 ) 205 // printk("\n@@@ %s : thread %x takes remote_spinlock %x\n", 206 //__FUNCTION__, thread_ptr, lock_ptr ); 207 204 208 #endif 205 209 … … 218 222 thread_t * thread_ptr = CURRENT_THREAD; 219 223 220 #if CONFIG_DEBUG_LOCKS 221 hal_remote_swd( XPTR( lock_cxy , &lock_ptr->owner ) , XPTR_NULL ); 222 xlist_unlink( XPTR( lock_cxy , &lock_ptr->list ) ); 224 #if CONFIG_DEBUG_REMOTE_SPINLOCKS 225 hal_remote_swd( XPTR( lock_cxy , &lock_ptr->owner ) , XPTR_NULL ); 226 xlist_unlink( XPTR( lock_cxy , &lock_ptr->list ) ); 227 228 // if( (uint32_t)lock_ptr == 0x66788 ) 229 // printk("\n@@@ %s : thread %x releases remote_spinlock %x\n", 230 // __FUNCTION__, thread_ptr, lock_ptr ); 231 223 232 #endif 224 233 -
trunk/kernel/libk/remote_spinlock.h
r433 r436 2 2 * remote_spinlock.h - kernel remote spinlock definition. 3 3 * 4 * Authors Mohamed Karaoui (2016) 5 * Alain Greiner (2016) 4 * Author Alain Greiner (2016,2017,2018) 6 5 * 7 6 * Copyright (c) UPMC Sorbonne Universites … … 42 41 volatile uint32_t taken; /*! free if 0 / taken if non zero */ 43 42 44 #if CONFIG_ LOCKS_DEBUG43 #if CONFIG_DEBUG_REMOTE_SPINLOCKS 45 44 xptr_t owner; /*! extended pointer on the owner thread */ 46 45 xlist_entry_t list; /*! list of all remote_lock taken by owner */ -
trunk/kernel/libk/rwlock.c
r433 r436 2 2 * rwlock.c - kernel read/write lock synchronization. 3 3 * 4 * Author Alain Greiner (2016 }4 * Author Alain Greiner (2016,2017,2018) 5 5 * 6 6 * Copyright (c) UPMC Sorbonne Universites … … 38 38 lock->count = 0; 39 39 40 #if CONFIG_DEBUG_ LOCKS41 42 40 #if CONFIG_DEBUG_RWLOCKS 41 lock->owner = NULL; 42 list_entry_init( &lock->list ); 43 43 #endif 44 44 … … 70 70 this->local_locks++; 71 71 72 #if CONFIG_DEBUG_ LOCKS73 72 #if CONFIG_DEBUG_RWLOCKS 73 list_add_first( &this->locks_root , &lock->list ); 74 74 #endif 75 75 … … 98 98 this->local_locks--; 99 99 100 #if CONFIG_DEBUG_ LOCKS101 100 #if CONFIG_DEBUG_RWLOCKS 101 list_unlink( &lock->list ); 102 102 #endif 103 103 … … 138 138 this->local_locks++; 139 139 140 #if CONFIG_DEBUG_ LOCKS141 142 140 #if CONFIG_DEBUG_RWLOCKS 141 lock->owner = this; 142 list_add_first( &this->locks_root , &lock->list ); 143 143 #endif 144 144 … … 157 157 hal_disable_irq( &mode ); 158 158 159 #if CONFIG_DEBUG_ LOCKS160 161 159 #if CONFIG_DEBUG_RWLOCKS 160 lock->owner = NULL; 161 list_unlink( &lock->list ); 162 162 #endif 163 163 -
trunk/kernel/libk/rwlock.h
r423 r436 2 2 * rwlock.h - kernel read/write lock definition. 3 3 * 4 * Author Alain Greiner (2016 )4 * Author Alain Greiner (2016,2017,2018) 5 5 * 6 6 * Copyright (c) UPMC Sorbonne Universites … … 59 59 uint32_t count; /*! number of simultaneous readers threads */ 60 60 61 #if CONFIG_ LOCKS_DEBUG61 #if CONFIG_DEBUG_RWLOCKS 62 62 struct thread_s * owner; /*! pointer on curent writer thread */ 63 63 list_entry_t list; /*! member of list of locks taken by owner */ -
trunk/kernel/libk/spinlock.c
r433 r436 38 38 lock->taken = 0; 39 39 40 #if CONFIG_DEBUG_ LOCKS41 42 40 #if CONFIG_DEBUG_SPINLOCKS 41 lock->owner = NULL; 42 list_entry_init( &lock->list ); 43 43 #endif 44 44 … … 71 71 this->local_locks++; 72 72 73 #if CONFIG_DEBUG_ LOCKS74 75 73 #if CONFIG_DEBUG_SPINLOCKS 74 lock->owner = this; 75 list_add_first( &this->locks_root , &lock->list ); 76 76 #endif 77 77 … … 86 86 thread_t * this = CURRENT_THREAD;; 87 87 88 #if CONFIG_DEBUG_ LOCKS89 90 88 #if CONFIG_DEBUG_SPINLOCKS 89 lock->owner = NULL; 90 list_unlink( &lock->list ); 91 91 #endif 92 92 … … 132 132 this->local_locks++; 133 133 134 #if CONFIG_DEBUG_ LOCKS135 136 134 #if CONFIG_DEBUG_SPINLOCKS 135 lock->owner = this; 136 list_add_first( &this->locks_root , &lock->list ); 137 137 #endif 138 138 … … 162 162 this->local_locks++; 163 163 164 #if CONFIG_DEBUG_ LOCKS165 166 164 #if CONFIG_DEBUG_SPINLOCKS 165 lock->owner = this; 166 list_add_first( &this->locks_root , &lock->list ); 167 167 #endif 168 168 … … 177 177 thread_t * this = CURRENT_THREAD; 178 178 179 #if CONFIG_DEBUG_ LOCKS180 181 179 #if CONFIG_DEBUG_SPINLOCKS 180 lock->owner = NULL; 181 list_unlink( &lock->list ); 182 182 #endif 183 183 -
trunk/kernel/libk/spinlock.h
r409 r436 2 2 * spinlock.h: kernel spinlock definition 3 3 * 4 * Authors Ghassan Almaless (2008,2009,2010,2011,2012) 5 * Alain Greiner (2016) 4 * Authors Alain Greiner (2016,2017,2018) 6 5 * 7 6 * Copyright (c) UPMC Sorbonne Universites … … 63 62 uint32_t taken; /*! state : free if zero / taken if non zero */ 64 63 65 #if CONFIG_ LOCKS_DEBUG64 #if CONFIG_DEBUG_SPINLOCKS 66 65 struct thread_s * owner; /*! pointer on curent owner thread */ 67 66 list_entry_t list; /*! member of list of locks taken by owner */
Note: See TracChangeset
for help on using the changeset viewer.