Changeset 438 for trunk/kernel/libk


Ignore:
Timestamp:
Apr 4, 2018, 2:49:02 PM (4 years ago)
Author:
alain
Message:

Fix a bug in scheduler related to RPC blocking.

Location:
trunk/kernel/libk
Files:
9 edited

Legend:

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

    r433 r438  
    201201                vfs_file_count_up( file_xp );
    202202
    203 #if CONFIG_DEBUG_ELF_LOAD
     203#if DEBUG_ELF_LOAD
    204204uint32_t cycle = (uint32_t)hal_get_cycles();
    205 if( CONFIG_DEBUG_ELF_LOAD < cycle )
     205if( DEBUG_ELF_LOAD < cycle )
    206206printk("\n[DBG] %s : found %s vseg / base %x / size %x\n"
    207207"  file_size %x / file_offset %x / mapper_xp %l / cycle %d\n",
     
    228228        error_t      error;
    229229
    230 #if CONFIG_DEBUG_ELF_LOAD
     230#if DEBUG_ELF_LOAD
    231231uint32_t cycle = (uint32_t)hal_get_cycles();
    232 if( CONFIG_DEBUG_ELF_LOAD < cycle )
     232if( DEBUG_ELF_LOAD < cycle )
    233233printk("\n[DBG] %s : thread %d enter for <%s> / cycle %d\n",
    234234__FUNCTION__, CURRENT_THREAD, pathname, cycle );
     
    252252        }
    253253
    254 #if (CONFIG_DEBUG_ELF_LOAD & 1)
    255 if( CONFIG_DEBUG_ELF_LOAD < cycle )
     254#if (DEBUG_ELF_LOAD & 1)
     255if( DEBUG_ELF_LOAD < cycle )
    256256printk("\n[DBG] %s : open file <%s>\n", __FUNCTION__, pathname );
    257257#endif
     
    268268        }
    269269
    270 #if (CONFIG_DEBUG_ELF_LOAD & 1)
    271 if( CONFIG_DEBUG_ELF_LOAD < cycle )
     270#if (DEBUG_ELF_LOAD & 1)
     271if( DEBUG_ELF_LOAD < cycle )
    272272printk("\n[DBG] %s : loaded elf header for %s\n", __FUNCTION__ , pathname );
    273273#endif
     
    308308        }
    309309
    310 #if (CONFIG_DEBUG_ELF_LOAD & 1)
    311 if( CONFIG_DEBUG_ELF_LOAD < cycle )
     310#if (DEBUG_ELF_LOAD & 1)
     311if( DEBUG_ELF_LOAD < cycle )
    312312printk("\n[DBG] %s : segments array allocated for %s\n", __FUNCTION__ , pathname );
    313313#endif
     
    328328        }
    329329
    330 #if (CONFIG_DEBUG_ELF_LOAD & 1)
    331 if( CONFIG_DEBUG_ELF_LOAD < cycle )
     330#if (DEBUG_ELF_LOAD & 1)
     331if( DEBUG_ELF_LOAD < cycle )
    332332printk("\n[DBG] %s loaded segments descriptors for %s \n", __FUNCTION__ , pathname );
    333333#endif
     
    356356        kmem_free(&req);
    357357
    358 #if CONFIG_DEBUG_ELF_LOAD
     358#if DEBUG_ELF_LOAD
    359359cycle = (uint32_t)hal_get_cycles();
    360 if( CONFIG_DEBUG_ELF_LOAD < cycle )
     360if( DEBUG_ELF_LOAD < cycle )
    361361printk("\n[DBG] %s : thread %d exit for <%s> / entry_point %x / cycle %d\n",
    362362__FUNCTION__, CURRENT_THREAD, pathname, header.e_entry, cycle );
  • trunk/kernel/libk/remote_rwlock.c

    r436 r438  
    4141    hal_remote_sw ( XPTR( lock_cxy , &lock_ptr->count )   , 0 );
    4242
    43 #if CONFIG_DEBUG_REMOTE_RWLOCKS
     43#if DEBUG_REMOTE_RWLOCKS
    4444hal_remote_swd( XPTR( lock_cxy , &lock_ptr->owner )   , XPTR_NULL );
    4545xlist_entry_init( XPTR( lock_cxy , &lock_ptr->list ) );
     
    8686    thread_ptr->remote_locks++;
    8787
    88 #if CONFIG_DEBUG_REMOTE_RWLOCKS
     88#if DEBUG_REMOTE_RWLOCKS
    8989xlist_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_DEBUG_REMOTE_RWLOCKS
     128#if DEBUG_REMOTE_RWLOCKS
    129129xlist_unlink( XPTR( lock_cxy , &lock_ptr->list ) );
    130130#endif
     
    176176    }
    177177
    178 #if CONFIG_DEBUG_REMOTE_RWLOCKS
     178#if DEBUG_REMOTE_RWLOCKS
    179179hal_remote_swd( XPTR( lock_cxy  , &lock_ptr->owner ) ,
    180180                XPTR( local_cxy , thread_ptr ) );
  • trunk/kernel/libk/remote_rwlock.h

    r436 r438  
    4848    uint32_t       count;           /*! current number of reader threads              */
    4949
    50 #if CONFIG_DEBUG_REMOTE_RWLOCKS
     50#if DEBUG_REMOTE_RWLOCKS
    5151    xptr_t         owner;           /*! extended pointer on writer thread             */
    5252    xlist_entry_t  list;            /*! member of list of remote locks taken by owner */
  • trunk/kernel/libk/remote_spinlock.c

    r436 r438  
    3838        hal_remote_sw ( XPTR( cxy , &ptr->taken ) , 0 );
    3939
    40 #if CONFIG_DEBUG_REMOTE_SPINLOCKS
     40#if DEBUG_REMOTE_SPINLOCKS
    4141hal_remote_swd( XPTR( cxy , &ptr->owner ) , XPTR_NULL );
    4242xlist_entry_init( XPTR( cxy , &ptr->list ) );
     
    7575                thread_ptr->remote_locks++;
    7676
    77 #if CONFIG_DEBUG_REMOTE_SPINLOCKS
     77#if DEBUG_REMOTE_SPINLOCKS
    7878hal_remote_swd( XPTR( lock_cxy , &lock_ptr->owner ) ,
    7979                XPTR( local_cxy , thread_ptr) );
     
    120120        thread_ptr->remote_locks++;
    121121
    122 #if CONFIG_DEBUG_REMOTE_SPINLOCKS
     122#if DEBUG_REMOTE_SPINLOCKS
    123123hal_remote_swd( XPTR( lock_cxy  , &lock_ptr->owner ) ,
    124124                XPTR( local_cxy , thread_ptr) );
     
    143143        thread_t          * thread_ptr = CURRENT_THREAD;
    144144
    145 #if CONFIG_DEBUG_REMOTE_SPINLOCKS
     145#if DEBUG_REMOTE_SPINLOCKS
    146146hal_remote_swd( XPTR( lock_cxy , &lock_ptr->owner ) , XPTR_NULL );
    147147xlist_unlink( XPTR( lock_cxy , &lock_ptr->list ) );
     
    196196        thread_ptr->remote_locks++;
    197197
    198 #if CONFIG_DEBUG_REMOTE_SPINLOCKS
     198#if DEBUG_REMOTE_SPINLOCKS
    199199hal_remote_swd( XPTR( lock_cxy  , &lock_ptr->owner ),
    200200                XPTR( local_cxy , thread_ptr) );
     
    222222        thread_t          * thread_ptr = CURRENT_THREAD;
    223223
    224 #if CONFIG_DEBUG_REMOTE_SPINLOCKS
     224#if DEBUG_REMOTE_SPINLOCKS
    225225hal_remote_swd( XPTR( lock_cxy , &lock_ptr->owner ) , XPTR_NULL );
    226226xlist_unlink( XPTR( lock_cxy , &lock_ptr->list ) );
  • trunk/kernel/libk/remote_spinlock.h

    r436 r438  
    4141    volatile uint32_t     taken;       /*! free if 0 / taken if non zero             */
    4242
    43 #if CONFIG_DEBUG_REMOTE_SPINLOCKS
     43#if DEBUG_REMOTE_SPINLOCKS
    4444    xptr_t                owner;       /*! extended pointer on the owner thread      */
    4545    xlist_entry_t         list;        /*! list of all remote_lock taken by owner    */
  • trunk/kernel/libk/rwlock.c

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

    r436 r438  
    5959    uint32_t            count;            /*! number of simultaneous readers threads      */
    6060
    61 #if CONFIG_DEBUG_RWLOCKS
     61#if DEBUG_RWLOCKS
    6262        struct thread_s   * owner;            /*! pointer on curent writer thread             */
    6363    list_entry_t        list;             /*! member of list of locks taken by owner      */
  • trunk/kernel/libk/spinlock.c

    r436 r438  
    3838    lock->taken = 0;
    3939
    40 #if CONFIG_DEBUG_SPINLOCKS
     40#if DEBUG_SPINLOCKS
    4141lock->owner = NULL;
    4242list_entry_init( &lock->list );
     
    7171    this->local_locks++;
    7272
    73 #if CONFIG_DEBUG_SPINLOCKS
     73#if DEBUG_SPINLOCKS
    7474lock->owner = this;
    7575list_add_first( &this->locks_root , &lock->list );
     
    8686    thread_t * this = CURRENT_THREAD;;
    8787
    88 #if CONFIG_DEBUG_SPINLOCKS
     88#if DEBUG_SPINLOCKS
    8989lock->owner = NULL;
    9090list_unlink( &lock->list );
     
    132132    this->local_locks++;
    133133
    134 #if CONFIG_DEBUG_SPINLOCKS
     134#if DEBUG_SPINLOCKS
    135135lock->owner = this;
    136136list_add_first( &this->locks_root , &lock->list );
     
    162162        this->local_locks++;
    163163
    164 #if CONFIG_DEBUG_SPINLOCKS
     164#if DEBUG_SPINLOCKS
    165165lock->owner = this;
    166166list_add_first( &this->locks_root , &lock->list );
     
    177177    thread_t * this = CURRENT_THREAD;
    178178
    179 #if CONFIG_DEBUG_SPINLOCKS
     179#if DEBUG_SPINLOCKS
    180180lock->owner = NULL;
    181181list_unlink( &lock->list );
  • trunk/kernel/libk/spinlock.h

    r436 r438  
    6262        uint32_t            taken;             /*! state : free if zero / taken if non zero  */
    6363
    64 #if CONFIG_DEBUG_SPINLOCKS
     64#if DEBUG_SPINLOCKS
    6565        struct thread_s   * owner;             /*! pointer on curent owner thread            */
    6666    list_entry_t        list;              /*! member of list of locks taken by owner    */
Note: See TracChangeset for help on using the changeset viewer.