Changeset 433 for trunk/kernel/libk
- Timestamp:
- Feb 14, 2018, 3:40:19 PM (7 years ago)
- Location:
- trunk/kernel/libk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/libk/elf.c
r407 r433 201 201 vfs_file_count_up( file_xp ); 202 202 203 elf_dmsg("\n[DBG] %s : found %s vseg / base = %x / size = %x\n" 204 " file_size = %x / file_offset = %x / mapper_xp = %l\n", 205 __FUNCTION__ , vseg_type_str(vseg->type) , vseg->min , vseg->max - vseg->min , 206 vseg->file_size , vseg->file_offset , vseg->mapper_xp ); 203 #if CONFIG_DEBUG_ELF_LOAD 204 uint32_t cycle = (uint32_t)hal_get_cycles(); 205 if( CONFIG_DEBUG_ELF_LOAD < cycle ) 206 printk("\n[DBG] %s : found %s vseg / base %x / size %x\n" 207 " file_size %x / file_offset %x / mapper_xp %l / cycle %d\n", 208 __FUNCTION__ , vseg_type_str(vseg->type) , vseg->min , vseg->max - vseg->min , 209 vseg->file_size , vseg->file_offset , vseg->mapper_xp ); 210 #endif 211 207 212 } 208 213 … … 223 228 error_t error; 224 229 225 elf_dmsg("\n[DBG] %s : core[%x,%d] enter for <%s>\n", 226 __FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid , pathname ); 230 #if CONFIG_DEBUG_ELF_LOAD 231 uint32_t cycle = (uint32_t)hal_get_cycles(); 232 if( CONFIG_DEBUG_ELF_LOAD < cycle ) 233 printk("\n[DBG] %s : thread %d enter for <%s> / cycle %d\n", 234 __FUNCTION__, CURRENT_THREAD, pathname, cycle ); 235 #endif 227 236 228 237 // avoid GCC warning … … 243 252 } 244 253 245 elf_dmsg("\n[DBG] %s : open file <%s>\n", __FUNCTION__ , pathname ); 254 #if (CONFIG_DEBUG_ELF_LOAD & 1) 255 if( CONFIG_DEBUG_ELF_LOAD < cycle ) 256 printk("\n[DBG] %s : open file <%s>\n", __FUNCTION__, pathname ); 257 #endif 246 258 247 259 // load header in local buffer … … 256 268 } 257 269 258 elf_dmsg("\n[DBG] %s : loaded elf header for %s\n", __FUNCTION__ , pathname ); 270 #if (CONFIG_DEBUG_ELF_LOAD & 1) 271 if( CONFIG_DEBUG_ELF_LOAD < cycle ) 272 printk("\n[DBG] %s : loaded elf header for %s\n", __FUNCTION__ , pathname ); 273 #endif 259 274 260 275 if( header.e_phnum == 0 ) … … 293 308 } 294 309 295 elf_dmsg("\n[DBG] %s : segments array allocated for %s\n", __FUNCTION__ , pathname ); 310 #if (CONFIG_DEBUG_ELF_LOAD & 1) 311 if( CONFIG_DEBUG_ELF_LOAD < cycle ) 312 printk("\n[DBG] %s : segments array allocated for %s\n", __FUNCTION__ , pathname ); 313 #endif 296 314 297 315 // load seg descriptors array to local buffer … … 310 328 } 311 329 312 elf_dmsg("\n[DBG] %s loaded segments descriptors for %s \n", __FUNCTION__ , pathname ); 330 #if (CONFIG_DEBUG_ELF_LOAD & 1) 331 if( CONFIG_DEBUG_ELF_LOAD < cycle ) 332 printk("\n[DBG] %s loaded segments descriptors for %s \n", __FUNCTION__ , pathname ); 333 #endif 313 334 314 335 // register loadable segments in process VMM … … 335 356 kmem_free(&req); 336 357 337 elf_dmsg("\n[DBG] %s : core[%x,%d] exit for <%s> / entry_point = %x\n", 338 __FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid , pathname , header.e_entry ); 358 #if CONFIG_DEBUG_ELF_LOAD 359 cycle = (uint32_t)hal_get_cycles(); 360 if( CONFIG_DEBUG_ELF_LOAD < cycle ) 361 printk("\n[DBG] %s : thread %d exit for <%s> / entry_point %x / cycle %d\n", 362 __FUNCTION__, CURRENT_THREAD, pathname, header.e_entry, cycle ); 363 #endif 339 364 340 365 return 0; -
trunk/kernel/libk/remote_rwlock.c
r423 r433 41 41 hal_remote_sw ( XPTR( lock_cxy , &lock_ptr->count ) , 0 ); 42 42 43 #if CONFIG_ LOCKS_DEBUG43 #if CONFIG_DEBUG_LOCKS 44 44 hal_remote_swd( XPTR( lock_cxy , &lock_ptr->owner ) , XPTR_NULL ); 45 45 xlist_entry_init( XPTR( lock_cxy , &lock_ptr->list ) ); … … 86 86 thread_ptr->remote_locks++; 87 87 88 #if CONFIG_ LOCKS_DEBUG88 #if CONFIG_DEBUG_LOCKS 89 89 xlist_add_first( XPTR( local_cxy , &thread_ptr->xlocks_root ) , 90 90 XPTR( lock_cxy , &lock_ptr->list ) ); … … 126 126 thread_ptr->remote_locks--; 127 127 128 #if CONFIG_ LOCKS_DEBUG128 #if CONFIG_DEBUG_LOCKS 129 129 xlist_unlink( XPTR( lock_cxy , &lock_ptr->list ) ); 130 130 #endif … … 176 176 } 177 177 178 #if CONFIG_ LOCKS_DEBUG178 #if CONFIG_DEBUG_LOCKS 179 179 hal_remote_swd( XPTR( lock_cxy , &lock_ptr->owner ) , 180 180 XPTR( local_cxy , thread_ptr ) ); -
trunk/kernel/libk/remote_spinlock.c
r423 r433 39 39 hal_remote_sw ( XPTR( cxy , &ptr->taken ) , 0 ); 40 40 41 #if CONFIG_ LOCKS_DEBUG41 #if CONFIG_DEBUG_LOCKS 42 42 hal_remote_swd( XPTR( cxy , &ptr->owner ) , XPTR_NULL ); 43 43 xlist_entry_init( XPTR( cxy , &ptr->list ) ); … … 76 76 thread_ptr->remote_locks++; 77 77 78 #if CONFIG_ LOCKS_DEBUG78 #if CONFIG_DEBUG_LOCKS 79 79 hal_remote_swd( XPTR( lock_cxy , &lock_ptr->owner ) , 80 80 XPTR( local_cxy , thread_ptr) ); … … 121 121 thread_ptr->remote_locks++; 122 122 123 #if CONFIG_ LOCKS_DEBUG123 #if CONFIG_DEBUG_LOCKS 124 124 hal_remote_swd( XPTR( lock_cxy , &lock_ptr->owner ) , 125 125 XPTR( local_cxy , thread_ptr) ); … … 144 144 thread_t * thread_ptr = CURRENT_THREAD; 145 145 146 #if CONFIG_ LOCKS_DEBUG146 #if CONFIG_DEBUG_LOCKS 147 147 hal_remote_swd( XPTR( lock_cxy , &lock_ptr->owner ) , XPTR_NULL ); 148 148 xlist_unlink( XPTR( lock_cxy , &lock_ptr->list ) ); … … 197 197 thread_ptr->remote_locks++; 198 198 199 #if CONFIG_ LOCKS_DEBUG199 #if CONFIG_DEBUG_LOCKS 200 200 hal_remote_swd( XPTR( lock_cxy , &lock_ptr->owner ) , 201 201 XPTR( local_cxy , thread_ptr) ); … … 218 218 thread_t * thread_ptr = CURRENT_THREAD; 219 219 220 #if CONFIG_ LOCKS_DEBUG220 #if CONFIG_DEBUG_LOCKS 221 221 hal_remote_swd( XPTR( lock_cxy , &lock_ptr->owner ) , XPTR_NULL ); 222 222 xlist_unlink( XPTR( lock_cxy , &lock_ptr->list ) ); -
trunk/kernel/libk/remote_spinlock.h
r409 r433 72 72 * This function releases a remote busy_waiting spinlock. 73 73 * It restores the CPU SR state. 74 * It decrements the calling thread locks count. 74 75 ******************************************************************************************* 75 76 * @ lock_xp : extended pointer on remote spinlock. … … 100 101 /*************************************************************************************** 101 102 * This function releases a remote spinlock. 103 * It decrements the calling thread locks count. 102 104 *************************************************************************************** 103 105 * @ lock_xp : extended pointer on the remote spinlock -
trunk/kernel/libk/rwlock.c
r409 r433 38 38 lock->count = 0; 39 39 40 #if CONFIG_ LOCKS_DEBUG40 #if CONFIG_DEBUG_LOCKS 41 41 lock->owner = NULL; 42 42 list_entry_init( &lock->list ); … … 70 70 this->local_locks++; 71 71 72 #if CONFIG_ LOCKS_DEBUG72 #if CONFIG_DEBUG_LOCKS 73 73 list_add_first( &this->locks_root , &lock->list ); 74 74 #endif … … 98 98 this->local_locks--; 99 99 100 #if CONFIG_ LOCKS_DEBUG100 #if CONFIG_DEBUG_LOCKS 101 101 list_unlink( &lock->list ); 102 102 #endif … … 138 138 this->local_locks++; 139 139 140 #if CONFIG_ LOCKS_DEBUG140 #if CONFIG_DEBUG_LOCKS 141 141 lock->owner = this; 142 142 list_add_first( &this->locks_root , &lock->list ); … … 157 157 hal_disable_irq( &mode ); 158 158 159 #if CONFIG_ LOCKS_DEBUG159 #if CONFIG_DEBUG_LOCKS 160 160 lock->owner = NULL; 161 161 list_unlink( &lock->list ); -
trunk/kernel/libk/spinlock.c
r409 r433 38 38 lock->taken = 0; 39 39 40 #if CONFIG_ LOCKS_DEBUG40 #if CONFIG_DEBUG_LOCKS 41 41 lock->owner = NULL; 42 42 list_entry_init( &lock->list ); … … 71 71 this->local_locks++; 72 72 73 #if CONFIG_ LOCKS_DEBUG73 #if CONFIG_DEBUG_LOCKS 74 74 lock->owner = this; 75 75 list_add_first( &this->locks_root , &lock->list ); … … 86 86 thread_t * this = CURRENT_THREAD;; 87 87 88 #if CONFIG_ LOCKS_DEBUG88 #if CONFIG_DEBUG_LOCKS 89 89 lock->owner = NULL; 90 90 list_unlink( &lock->list ); … … 132 132 this->local_locks++; 133 133 134 #if CONFIG_ LOCKS_DEBUG134 #if CONFIG_DEBUG_LOCKS 135 135 lock->owner = this; 136 136 list_add_first( &this->locks_root , &lock->list ); … … 162 162 this->local_locks++; 163 163 164 #if CONFIG_ LOCKS_DEBUG164 #if CONFIG_DEBUG_LOCKS 165 165 lock->owner = this; 166 166 list_add_first( &this->locks_root , &lock->list ); … … 177 177 thread_t * this = CURRENT_THREAD; 178 178 179 #if CONFIG_ LOCKS_DEBUG179 #if CONFIG_DEBUG_LOCKS 180 180 lock->owner = NULL; 181 181 list_unlink( &lock->list );
Note: See TracChangeset
for help on using the changeset viewer.