Changeset 433 for trunk/kernel/libk


Ignore:
Timestamp:
Feb 14, 2018, 3:40:19 PM (4 years ago)
Author:
alain
Message:

blip

Location:
trunk/kernel/libk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/libk/elf.c

    r407 r433  
    201201                vfs_file_count_up( file_xp );
    202202
    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
     204uint32_t cycle = (uint32_t)hal_get_cycles();
     205if( CONFIG_DEBUG_ELF_LOAD < cycle )
     206printk("\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 ,
     209vseg->file_size , vseg->file_offset , vseg->mapper_xp );
     210#endif
     211
    207212        }
    208213
     
    223228        error_t      error;
    224229
    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
     231uint32_t cycle = (uint32_t)hal_get_cycles();
     232if( CONFIG_DEBUG_ELF_LOAD < cycle )
     233printk("\n[DBG] %s : thread %d enter for <%s> / cycle %d\n",
     234__FUNCTION__, CURRENT_THREAD, pathname, cycle );
     235#endif
    227236
    228237    // avoid GCC warning
     
    243252        }
    244253
    245     elf_dmsg("\n[DBG] %s : open file <%s>\n", __FUNCTION__ , pathname );
     254#if (CONFIG_DEBUG_ELF_LOAD & 1)
     255if( CONFIG_DEBUG_ELF_LOAD < cycle )
     256printk("\n[DBG] %s : open file <%s>\n", __FUNCTION__, pathname );
     257#endif
    246258
    247259        // load header in local buffer
     
    256268        }
    257269
    258         elf_dmsg("\n[DBG] %s : loaded elf header for %s\n", __FUNCTION__ , pathname );
     270#if (CONFIG_DEBUG_ELF_LOAD & 1)
     271if( CONFIG_DEBUG_ELF_LOAD < cycle )
     272printk("\n[DBG] %s : loaded elf header for %s\n", __FUNCTION__ , pathname );
     273#endif
    259274
    260275        if( header.e_phnum == 0 )
     
    293308        }
    294309
    295         elf_dmsg("\n[DBG] %s : segments array allocated for %s\n", __FUNCTION__ , pathname );
     310#if (CONFIG_DEBUG_ELF_LOAD & 1)
     311if( CONFIG_DEBUG_ELF_LOAD < cycle )
     312printk("\n[DBG] %s : segments array allocated for %s\n", __FUNCTION__ , pathname );
     313#endif
    296314
    297315        // load seg descriptors array to local buffer
     
    310328        }
    311329
    312         elf_dmsg("\n[DBG] %s loaded segments descriptors for %s \n", __FUNCTION__ , pathname );
     330#if (CONFIG_DEBUG_ELF_LOAD & 1)
     331if( CONFIG_DEBUG_ELF_LOAD < cycle )
     332printk("\n[DBG] %s loaded segments descriptors for %s \n", __FUNCTION__ , pathname );
     333#endif
    313334
    314335        // register loadable segments in process VMM
     
    335356        kmem_free(&req);
    336357
    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
     359cycle = (uint32_t)hal_get_cycles();
     360if( CONFIG_DEBUG_ELF_LOAD < cycle )
     361printk("\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
    339364
    340365        return 0;
  • trunk/kernel/libk/remote_rwlock.c

    r423 r433  
    4141    hal_remote_sw ( XPTR( lock_cxy , &lock_ptr->count )   , 0 );
    4242
    43 #if CONFIG_LOCKS_DEBUG
     43#if CONFIG_DEBUG_LOCKS
    4444    hal_remote_swd( XPTR( lock_cxy , &lock_ptr->owner )   , XPTR_NULL );
    4545    xlist_entry_init( XPTR( lock_cxy , &lock_ptr->list ) );
     
    8686    thread_ptr->remote_locks++;
    8787
    88 #if CONFIG_LOCKS_DEBUG
     88#if CONFIG_DEBUG_LOCKS
    8989    xlist_add_first( XPTR( local_cxy , &thread_ptr->xlocks_root ) ,
    9090                     XPTR( lock_cxy ,  &lock_ptr->list ) );
     
    126126        thread_ptr->remote_locks--;
    127127
    128 #if CONFIG_LOCKS_DEBUG
     128#if CONFIG_DEBUG_LOCKS
    129129    xlist_unlink( XPTR( lock_cxy , &lock_ptr->list ) );
    130130#endif
     
    176176    }
    177177
    178 #if CONFIG_LOCKS_DEBUG
     178#if CONFIG_DEBUG_LOCKS
    179179    hal_remote_swd( XPTR( lock_cxy  , &lock_ptr->owner ) ,
    180180                    XPTR( local_cxy , thread_ptr ) );
  • trunk/kernel/libk/remote_spinlock.c

    r423 r433  
    3939        hal_remote_sw ( XPTR( cxy , &ptr->taken ) , 0 );
    4040
    41 #if CONFIG_LOCKS_DEBUG
     41#if CONFIG_DEBUG_LOCKS
    4242        hal_remote_swd( XPTR( cxy , &ptr->owner ) , XPTR_NULL );
    4343        xlist_entry_init( XPTR( cxy , &ptr->list ) );
     
    7676                thread_ptr->remote_locks++;
    7777
    78 #if CONFIG_LOCKS_DEBUG
     78#if CONFIG_DEBUG_LOCKS
    7979                hal_remote_swd( XPTR( lock_cxy , &lock_ptr->owner ) ,
    8080                                XPTR( local_cxy , thread_ptr) );
     
    121121        thread_ptr->remote_locks++;
    122122
    123 #if CONFIG_LOCKS_DEBUG
     123#if CONFIG_DEBUG_LOCKS
    124124        hal_remote_swd( XPTR( lock_cxy  , &lock_ptr->owner ) ,
    125125                        XPTR( local_cxy , thread_ptr) );
     
    144144        thread_t          * thread_ptr = CURRENT_THREAD;
    145145
    146 #if CONFIG_LOCKS_DEBUG
     146#if CONFIG_DEBUG_LOCKS
    147147        hal_remote_swd( XPTR( lock_cxy , &lock_ptr->owner ) , XPTR_NULL );
    148148        xlist_unlink( XPTR( lock_cxy , &lock_ptr->list ) );
     
    197197        thread_ptr->remote_locks++;
    198198
    199 #if CONFIG_LOCKS_DEBUG
     199#if CONFIG_DEBUG_LOCKS
    200200        hal_remote_swd( XPTR( lock_cxy  , &lock_ptr->owner ) ,
    201201                        XPTR( local_cxy , thread_ptr) );
     
    218218        thread_t          * thread_ptr = CURRENT_THREAD;
    219219
    220 #if CONFIG_LOCKS_DEBUG
     220#if CONFIG_DEBUG_LOCKS
    221221        hal_remote_swd( XPTR( lock_cxy , &lock_ptr->owner ) , XPTR_NULL );
    222222        xlist_unlink( XPTR( lock_cxy , &lock_ptr->list ) );
  • trunk/kernel/libk/remote_spinlock.h

    r409 r433  
    7272 * This function releases a remote busy_waiting spinlock.
    7373 * It restores the CPU SR state.
     74 * It decrements the calling thread locks count.
    7475 *******************************************************************************************
    7576 * @ lock_xp    : extended pointer on remote spinlock.
     
    100101/***************************************************************************************
    101102 * This function releases a remote spinlock.
     103 * It decrements the calling thread locks count.
    102104 ***************************************************************************************
    103105 * @ lock_xp    : extended pointer on the remote spinlock
  • trunk/kernel/libk/rwlock.c

    r409 r433  
    3838    lock->count   = 0;
    3939
    40 #if CONFIG_LOCKS_DEBUG
     40#if CONFIG_DEBUG_LOCKS
    4141        lock->owner   = NULL;
    4242    list_entry_init( &lock->list );
     
    7070    this->local_locks++;
    7171
    72 #if CONFIG_LOCKS_DEBUG
     72#if CONFIG_DEBUG_LOCKS
    7373    list_add_first( &this->locks_root , &lock->list );
    7474#endif
     
    9898    this->local_locks--;
    9999
    100 #if CONFIG_LOCKS_DEBUG
     100#if CONFIG_DEBUG_LOCKS
    101101    list_unlink( &lock->list );
    102102#endif
     
    138138    this->local_locks++;
    139139
    140 #if CONFIG_LOCKS_DEBUG
     140#if CONFIG_DEBUG_LOCKS
    141141    lock->owner = this;
    142142    list_add_first( &this->locks_root , &lock->list );
     
    157157        hal_disable_irq( &mode );
    158158 
    159 #if CONFIG_LOCKS_DEBUG
     159#if CONFIG_DEBUG_LOCKS
    160160    lock->owner = NULL;
    161161    list_unlink( &lock->list );
  • trunk/kernel/libk/spinlock.c

    r409 r433  
    3838    lock->taken = 0;
    3939
    40 #if CONFIG_LOCKS_DEBUG
     40#if CONFIG_DEBUG_LOCKS
    4141    lock->owner = NULL;
    4242    list_entry_init( &lock->list );
     
    7171    this->local_locks++;
    7272
    73 #if CONFIG_LOCKS_DEBUG
     73#if CONFIG_DEBUG_LOCKS
    7474    lock->owner = this;
    7575    list_add_first( &this->locks_root , &lock->list );
     
    8686    thread_t * this = CURRENT_THREAD;;
    8787
    88 #if CONFIG_LOCKS_DEBUG
     88#if CONFIG_DEBUG_LOCKS
    8989    lock->owner = NULL;
    9090    list_unlink( &lock->list );
     
    132132    this->local_locks++;
    133133
    134 #if CONFIG_LOCKS_DEBUG
     134#if CONFIG_DEBUG_LOCKS
    135135    lock->owner = this;
    136136    list_add_first( &this->locks_root , &lock->list );
     
    162162        this->local_locks++;
    163163
    164 #if CONFIG_LOCKS_DEBUG
     164#if CONFIG_DEBUG_LOCKS
    165165        lock->owner = this;
    166166        list_add_first( &this->locks_root , &lock->list );
     
    177177    thread_t * this = CURRENT_THREAD;
    178178
    179 #if CONFIG_LOCKS_DEBUG
     179#if CONFIG_DEBUG_LOCKS
    180180    lock->owner = NULL;
    181181    list_unlink( &lock->list );
Note: See TracChangeset for help on using the changeset viewer.