Ignore:
Timestamp:
Dec 27, 2018, 7:38:58 PM (5 years ago)
Author:
alain
Message:

Fix several bugs in VFS to support the following
ksh commandis : cp, mv, rm, mkdir, cd, pwd

File:
1 edited

Legend:

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

    r603 r610  
    5353    remote_busylock_init( XPTR( lock_cxy , &lock_ptr->lock ) , type );
    5454
    55 #if DEBUG_RWLOCK
     55#if DEBUG_RWLOCK_TYPE
    5656thread_t * this = CURRENT_THREAD;
    57 if( DEBUG_RWLOCK < (uint32_t)hal_get_cycles() )
     57if( type == DEBUG_RWLOCK_TYPE )
    5858printk("\n[%s] thread[%x,%x] initialise lock %s [%x,%x]\n",
    5959__FUNCTION__, this->process->pid, this->trdid,
     
    7575    cxy_t             lock_cxy = GET_CXY( lock_xp );
    7676
    77 #if DEBUG_RWLOCK
     77#if DEBUG_RWLOCK_TYPE
    7878uint32_t lock_type = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->lock.type ) );
    7979#endif
     
    9292    {
    9393
    94 #if DEBUG_RWLOCK
    95 if( DEBUG_RWLOCK < (uint32_t)hal_get_cycles() )
     94#if DEBUG_RWLOCK_TYPE
     95if( lock_type == DEBUG_RWLOCK_TYPE )
    9696printk("\n[%s] thread[%x,%x] READ BLOCK on rwlock %s [%x,%x] / taken %d / count %d\n",
    9797__FUNCTION__, this->process->pid, this->trdid,
     
    123123    hal_fence();
    124124
    125 #if DEBUG_RWLOCK
    126 if( DEBUG_RWLOCK < (uint32_t)hal_get_cycles() )
     125#if DEBUG_RWLOCK_TYPE
     126if( lock_type == DEBUG_RWLOCK_TYPE )
    127127printk("\n[%s] thread[%x,%x] READ ACQUIRE rwlock %s [%x,%x] / taken = %d / count = %d\n",
    128128__FUNCTION__, this->process->pid, this->trdid,
     
    148148    cxy_t             lock_cxy = GET_CXY( lock_xp );
    149149
    150 #if DEBUG_RWLOCK
     150#if DEBUG_RWLOCK_TYPE
    151151uint32_t lock_type = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->lock.type ) );
    152152#endif
     
    165165    {
    166166
    167 #if DEBUG_RWLOCK
    168 if( DEBUG_RWLOCK < (uint32_t)hal_get_cycles() )
     167#if DEBUG_RWLOCK_TYPE
     168if( lock_type == DEBUG_RWLOCK_TYPE )
    169169printk("\n[%s] thread[%x,%x] WRITE BLOCK on rwlock %s [%x,%x] / taken %d / count %d\n",
    170170__FUNCTION__, this->process->pid, this->trdid,
     
    195195    hal_remote_s32( taken_xp , 1 );
    196196
    197 #if DEBUG_RWLOCK
    198 if( DEBUG_RWLOCK < (uint32_t)hal_get_cycles() )
     197#if DEBUG_RWLOCK_TYPE
     198if( lock_type == DEBUG_RWLOCK_TYPE )
    199199printk("\n[%s] thread[%x,%x] WRITE ACQUIRE rwlock %s [%x,%x] / taken %d / count %d\n",
    200200__FUNCTION__, this->process->pid, this->trdid,
     
    231231    hal_remote_atomic_add( count_xp , -1 );
    232232
    233 #if DEBUG_RWLOCK
     233#if DEBUG_RWLOCK_TYPE
    234234thread_t * this      = CURRENT_THREAD;
    235235uint32_t   lock_type = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->lock.type ) );
    236236xptr_t     taken_xp  = XPTR( lock_cxy , &lock_ptr->taken );
    237 if( DEBUG_RWLOCK < (uint32_t)hal_get_cycles() )
     237if( lock_type == DEBUG_RWLOCK_TYPE )
    238238printk("\n[%s] thread[%x,%x] READ RELEASE rwlock %s [%x,%x] / taken %d / count %d\n",
    239239__FUNCTION__, this->process->pid, this->trdid,
     
    257257        thread_unblock( thread_xp , THREAD_BLOCKED_LOCK );
    258258
    259 #if DEBUG_RWLOCK
    260 if( (uint32_t)hal_get_cycles() > DEBUG_RWLOCK )
     259#if DEBUG_RWLOCK_TYPE
     260if( lock_type == DEBUG_RWLOCK_TYPE )
    261261{
    262262    trdid_t     trdid     = hal_remote_l32( XPTR( thread_cxy , &thread_ptr->trdid ) );
     
    288288            thread_unblock( thread_xp , THREAD_BLOCKED_LOCK );
    289289
    290 #if DEBUG_RWLOCK
    291 if( (uint32_t)hal_get_cycles() > DEBUG_RWLOCK )
     290#if DEBUG_RWLOCK_TYPE
     291if( lock_type == DEBUG_RWLOCK_TYPE )
    292292{
    293293    trdid_t     trdid     = hal_remote_l32( XPTR( thread_cxy , &thread_ptr->trdid ) );
     
    330330    hal_remote_s32( taken_xp , 0 );
    331331
    332 #if DEBUG_RWLOCK
     332#if DEBUG_RWLOCK_TYPE
    333333thread_t * this      = CURRENT_THREAD;
    334334uint32_t   lock_type = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->lock.type ) );
    335335xptr_t     count_xp  = XPTR( lock_cxy , &lock_ptr->count );
    336 if( DEBUG_RWLOCK < (uint32_t)hal_get_cycles() )
     336if( lock_type == DEBUG_RWLOCK_TYPE )
    337337printk("\n[%s] thread[%x,%x] WRITE RELEASE rwlock %s [%x,%x] / taken %d / count %d\n",
    338338__FUNCTION__, this->process->pid, this->trdid,
     
    355355        thread_unblock( thread_xp , THREAD_BLOCKED_LOCK );
    356356
    357 #if DEBUG_RWLOCK
    358 if( (uint32_t)hal_get_cycles() > DEBUG_RWLOCK )
     357#if DEBUG_RWLOCK_TYPE
     358if( lock_type == DEBUG_RWLOCK_TYPE )
    359359{
    360360    trdid_t     trdid     = hal_remote_l32( XPTR( thread_cxy , &thread_ptr->trdid ) );
     
    385385            thread_unblock( thread_xp , THREAD_BLOCKED_LOCK );
    386386
    387 #if DEBUG_RWLOCK
    388 if( (uint32_t)hal_get_cycles() > DEBUG_RWLOCK )
     387#if DEBUG_RWLOCK_TYPE
     388if( lock_type == DEBUG_RWLOCK_TYPE )
    389389{
    390390    trdid_t     trdid     = hal_remote_l32( XPTR( thread_cxy , &thread_ptr->trdid ) );
Note: See TracChangeset for help on using the changeset viewer.