Changeset 423
- Timestamp:
- Jan 29, 2018, 5:49:38 PM (7 years ago)
- Location:
- trunk/kernel/libk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/libk/barrier.h
r16 r423 10 10 * ALMOS-MKH is free software; you can redistribute it and/or modify it 11 11 * under the terms of the GNU General Public License as published by 12 err* the Free Software Foundation; version 2.0 of the License.12 * the Free Software Foundation; version 2.0 of the License. 13 13 * 14 14 * ALMOS-MKH is distributed in the hope that it will be useful, but … … 38 38 typedef struct barrier_s 39 39 { 40 uint32_t current; // number of arrived threads41 uint32_t sense; // barrier state (toggle)42 uint32_t pad[(CONFIG_CACHE_LINE_SIZE>>2)-2];40 uint32_t current; // number of arrived threads 41 volatile uint32_t sense; // barrier state (toggle) 42 uint32_t pad[(CONFIG_CACHE_LINE_SIZE>>2)-2]; 43 43 } 44 44 barrier_t; -
trunk/kernel/libk/grdxt.c
r406 r423 165 165 if( (key >> (w1 + w2 + w3)) != 0 ) 166 166 { 167 panic("key value %x exceed (%d + %d + %d) bits", key , w1 , w2 , w3 ); 167 assert( false , __FUNCTION__ , 168 "key value %x exceed (%d + %d + %d) bits", key , w1 , w2 , w3 ); 168 169 } 169 170 … … 236 237 if( (key >> (w1 + w2 + w3)) != 0 ) 237 238 { 238 panic("key value %x exceed (%d + %d + %d) bits", key , w1 , w2 , w3 ); 239 assert( false , __FUNCTION__ , 240 "key value %x exceed (%d + %d + %d) bits", key , w1 , w2 , w3 ); 239 241 } 240 242 … … 277 279 if( (key >> (w1 + w2 + w3)) != 0 ) 278 280 { 279 panic("key value %x exceed (%d + %d + %d) bits", key , w1 , w2 , w3 ); 281 assert( false , __FUNCTION__ , 282 "key value %x exceed (%d + %d + %d) bits", key , w1 , w2 , w3 ); 280 283 } 281 284 … … 319 322 if( (start_key >> (w1 + w2 + w3)) != 0 ) 320 323 { 321 panic("start_key value %x exceed (%d + %d + %d) bits", start_key , w1,322 324 assert( false , __FUNCTION__ , 325 "start_key value %x exceed (%d + %d + %d) bits", start_key , w1 , w2 , w3 ); 323 326 } 324 327 -
trunk/kernel/libk/htab.c
r396 r423 99 99 else 100 100 { 101 panic("undefined item type");101 assert( false , __FUNCTION__ , "undefined item type\n" ); 102 102 } 103 103 -
trunk/kernel/libk/remote_rwlock.c
r409 r423 34 34 void remote_rwlock_init( xptr_t lock_xp ) 35 35 { 36 remote_rwlock_t * lock_ptr = (remote_rwlock_t *)GET_PTR( lock_xp );36 remote_rwlock_t * lock_ptr = GET_PTR( lock_xp ); 37 37 cxy_t lock_cxy = GET_CXY( lock_xp ); 38 38 … … 55 55 56 56 // get cluster and local pointer on remote_rwlock 57 remote_rwlock_t * lock_ptr = (remote_rwlock_t *)GET_PTR( lock_xp );57 remote_rwlock_t * lock_ptr = GET_PTR( lock_xp ); 58 58 cxy_t lock_cxy = GET_CXY( lock_xp ); 59 59 … … 108 108 109 109 // get cluster and local pointer on remote_rwlock 110 remote_rwlock_t * lock_ptr = (remote_rwlock_t *)GET_PTR( lock_xp );110 remote_rwlock_t * lock_ptr = GET_PTR( lock_xp ); 111 111 cxy_t lock_cxy = GET_CXY( lock_xp ); 112 112 … … 127 127 128 128 #if CONFIG_LOCKS_DEBUG 129 xlist_unlink( XPTR( lock_cxy , &lock ->ptr->list ) );129 xlist_unlink( XPTR( lock_cxy , &lock_ptr->list ) ); 130 130 #endif 131 131 … … 145 145 146 146 // get cluster and local pointer on remote_rwlock 147 remote_rwlock_t * lock_ptr = (remote_rwlock_t *)GET_PTR( lock_xp );147 remote_rwlock_t * lock_ptr = GET_PTR( lock_xp ); 148 148 cxy_t lock_cxy = GET_CXY( lock_xp ); 149 149 … … 197 197 198 198 // get cluster and local pointer on remote_rwlock 199 remote_rwlock_t * lock_ptr = (remote_rwlock_t *)GET_PTR( lock_xp );199 remote_rwlock_t * lock_ptr = GET_PTR( lock_xp ); 200 200 cxy_t lock_cxy = GET_CXY( lock_xp ); 201 201 … … 237 237 238 238 // get cluster and local pointer on remote_rwlock 239 remote_rwlock_t * lock_ptr = (remote_rwlock_t *)GET_PTR( lock_xp );239 remote_rwlock_t * lock_ptr = GET_PTR( lock_xp ); 240 240 cxy_t lock_cxy = GET_CXY( lock_xp ); 241 241 -
trunk/kernel/libk/remote_spinlock.c
r409 r423 34 34 void remote_spinlock_init( xptr_t lock_xp ) 35 35 { 36 remote_spinlock_t * ptr = (remote_spinlock_t *)GET_PTR( lock_xp );36 remote_spinlock_t * ptr = GET_PTR( lock_xp ); 37 37 cxy_t cxy = GET_CXY( lock_xp ); 38 38 39 39 hal_remote_sw ( XPTR( cxy , &ptr->taken ) , 0 ); 40 40 41 #if CONFIG_LOCKS_ CONFIG41 #if CONFIG_LOCKS_DEBUG 42 42 hal_remote_swd( XPTR( cxy , &ptr->owner ) , XPTR_NULL ); 43 43 xlist_entry_init( XPTR( cxy , &ptr->list ) ); … … 53 53 54 54 // get cluster and local pointer on remote_spinlock 55 remote_spinlock_t * lock_ptr = (remote_spinlock_t *)GET_PTR( lock_xp );55 remote_spinlock_t * lock_ptr = GET_PTR( lock_xp ); 56 56 cxy_t lock_cxy = GET_CXY( lock_xp ); 57 57 … … 72 72 return 1; 73 73 } 74 else // success : register lock in thread74 else // success : register lock in local thread 75 75 { 76 76 thread_ptr->remote_locks++; … … 78 78 #if CONFIG_LOCKS_DEBUG 79 79 hal_remote_swd( XPTR( lock_cxy , &lock_ptr->owner ) , 80 XPTR( thread_cxy , thread_ptr) );80 XPTR( local_cxy , thread_ptr) ); 81 81 xlist_add_first( XPTR( local_cxy , &thread_ptr->xlocks_root ) , 82 82 XPTR( lock_cxy , &lock_ptr->list ) ); … … 97 97 98 98 // get cluster and local pointer on remote_spinlock 99 remote_spinlock_t * lock_ptr = (remote_spinlock_t *)GET_PTR( lock_xp );99 remote_spinlock_t * lock_ptr = GET_PTR( lock_xp ); 100 100 cxy_t lock_cxy = GET_CXY( lock_xp ); 101 101 … … 138 138 { 139 139 // get cluster and local pointer on remote_spinlock 140 remote_spinlock_t * lock_ptr = (remote_spinlock_t *)GET_PTR( lock_xp );140 remote_spinlock_t * lock_ptr = GET_PTR( lock_xp ); 141 141 cxy_t lock_cxy = GET_CXY( lock_xp ); 142 142 … … 167 167 168 168 // get cluster and local pointer on remote_spinlock 169 remote_spinlock_t * lock_ptr = (remote_spinlock_t *)GET_PTR( lock_xp );169 remote_spinlock_t * lock_ptr = GET_PTR( lock_xp ); 170 170 cxy_t lock_cxy = GET_CXY( lock_xp ); 171 171 … … 212 212 { 213 213 // get cluster and local pointer on remote_spinlock 214 remote_spinlock_t * lock_ptr = (remote_spinlock_t *)GET_PTR( lock_xp );214 remote_spinlock_t * lock_ptr = GET_PTR( lock_xp ); 215 215 cxy_t lock_cxy = GET_CXY( lock_xp ); 216 216 -
trunk/kernel/libk/rwlock.h
r409 r423 27 27 #include <kernel_config.h> 28 28 #include <hal_types.h> 29 #include <list.h> 29 30 30 31 /******************************************************************************************* -
trunk/kernel/libk/xhtab.c
r396 r423 139 139 else 140 140 { 141 panic("illegal item type");141 assert( false , __FUNCTION__ , "illegal item type\n" ); 142 142 } 143 143
Note: See TracChangeset
for help on using the changeset viewer.