Ignore:
Timestamp:
Oct 10, 2020, 5:27:12 PM (4 years ago)
Author:
alain
Message:

Cosmetic.

File:
1 edited

Legend:

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

    r629 r666  
    5555#if DEBUG_RWLOCK_TYPE
    5656thread_t * this = CURRENT_THREAD;
    57 if( (type               == DEBUG_RWLOCK_TYPE) &&
    58     ((intptr_t)lock_ptr == DEBUG_RWLOCK_PTR ) &&
    59     (lock_cxy           == DEBUG_RWLOCK_CXY ) )
     57bool_t     cond = (type == DEBUG_RWLOCK_TYPE) &&
     58                  (((lock_cxy == (cxt_t)DEBUG_RWLOCK_CXY) &&
     59                    (lock_ptr == (remote_queuelock_t*)DEBUG_RWLOCK_PTR)) ||
     60                   ((DEBUG_RWLOCK_CXY == 0) &&
     61                    (DEBUG_RWLOCK_PTR == 0)));
     62if( cond )
    6063printk("\n[%s] thread[%x,%x] initialise lock %s [%x,%x]\n",
    6164__FUNCTION__, this->process->pid, this->trdid,
     
    7881
    7982#if DEBUG_RWLOCK_TYPE
    80 uint32_t lock_type = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->lock.type ) );
     83uint32_t lock_type   = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->lock.type ) );
     84bool_t   cond        = (type == DEBUG_RWLOCK_TYPE) &&
     85                       (((lock_cxy == (cxt_t)DEBUG_RWLOCK_CXY) &&
     86                         (lock_ptr == (remote_queuelock_t*)DEBUG_RWLOCK_PTR)) ||
     87                        ((DEBUG_RWLOCK_CXY == 0) &&
     88                         (DEBUG_RWLOCK_PTR == 0)));
     89xptr_t   wr_root_xp  = XPTR( lock_cxy , &lock_ptr->wr_xroot );
    8190#endif
    8291
     
    95104
    96105#if DEBUG_RWLOCK_TYPE
    97 if( (lock_type          == DEBUG_RWLOCK_TYPE) &&
    98     ((intptr_t)lock_ptr == DEBUG_RWLOCK_PTR ) &&
    99     (lock_cxy           == DEBUG_RWLOCK_CXY ) )
    100 printk("\n[%s] thread[%x,%x] READ BLOCK on rwlock %s [%x,%x] / taken %d / count %d\n",
     106if( cond )
     107printk("\n[%s] thread[%x,%x] READ BLOCK on %s [%x,%x]\n"
     108"     taken %d / count %d / wr_empty %d / rd_empty %d\n",
    101109__FUNCTION__, this->process->pid, this->trdid,
    102110lock_type_str[lock_type], lock_cxy, lock_ptr,
    103 hal_remote_l32( taken_xp ), hal_remote_l32( count_xp ) );
     111hal_remote_l32( taken_xp ), hal_remote_l32( count_xp ),
     112xlist_is_empty( wr_root_xp ), xlist_is_empty( rd_root_xp ) );
    104113#endif
    105114        // get pointer on calling thread
     
    128137
    129138#if DEBUG_RWLOCK_TYPE
    130 if( (lock_type          == DEBUG_RWLOCK_TYPE) &&
    131     ((intptr_t)lock_ptr == DEBUG_RWLOCK_PTR ) &&
    132     (lock_cxy           == DEBUG_RWLOCK_CXY ) )
    133 printk("\n[%s] thread[%x,%x] READ ACQUIRE rwlock %s [%x,%x] / taken %d / count %d\n",
     139if( cond )
     140printk("\n[%s] thread[%x,%x] READ ACQUIRE %s [%x,%x]\n"
     141"     taken %d / count %d / wr_empty %d / rd_empty %d\n",
    134142__FUNCTION__, this->process->pid, this->trdid,
    135143lock_type_str[lock_type], lock_cxy, lock_ptr,
    136 hal_remote_l32( taken_xp ), hal_remote_l32( count_xp ) );
     144hal_remote_l32( taken_xp ), hal_remote_l32( count_xp ),
     145xlist_is_empty( wr_root_xp ), xlist_is_empty( rd_root_xp ) );
    137146#endif
    138147
     
    155164
    156165#if DEBUG_RWLOCK_TYPE
    157 uint32_t lock_type = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->lock.type ) );
     166uint32_t lock_type   = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->lock.type ) );
     167bool_t   cond        = (type == DEBUG_RWLOCK_TYPE) &&
     168                       (((lock_cxy == (cxt_t)DEBUG_RWLOCK_CXY) &&
     169                         (lock_ptr == (remote_queuelock_t*)DEBUG_RWLOCK_PTR)) ||
     170                        ((DEBUG_RWLOCK_CXY == 0) &&
     171                         (DEBUG_RWLOCK_PTR == 0)));
     172xptr_t   rd_root_xp  = XPTR( lock_cxy , &lock_ptr->rd_xroot );
    158173#endif
    159174
     
    172187
    173188#if DEBUG_RWLOCK_TYPE
    174 if( (lock_type          == DEBUG_RWLOCK_TYPE) &&
    175     ((intptr_t)lock_ptr == DEBUG_RWLOCK_PTR ) &&
    176     (lock_cxy           == DEBUG_RWLOCK_CXY ) )
    177 printk("\n[%s] thread[%x,%x] WRITE BLOCK on rwlock %s [%x,%x] / taken %d / count %d\n",
     189if( cond )
     190printk("\n[%s] thread[%x,%x] WRITE BLOCK on %s [%x,%x]\n"
     191"     taken %d / count %d / wr_empty %d / rd_empty %d\n",
    178192__FUNCTION__, this->process->pid, this->trdid,
    179193lock_type_str[lock_type], lock_cxy, lock_ptr,
    180 hal_remote_l32( taken_xp ), hal_remote_l32( count_xp ) );
     194hal_remote_l32( taken_xp ), hal_remote_l32( count_xp ),
     195xlist_is_empty( wr_root_xp ), xlist_is_empty( rd_root_xp ) );
    181196#endif
    182197
     
    204219
    205220#if DEBUG_RWLOCK_TYPE
    206 if( (lock_type          == DEBUG_RWLOCK_TYPE) &&
    207     ((intptr_t)lock_ptr == DEBUG_RWLOCK_PTR ) &&
    208     (lock_cxy           == DEBUG_RWLOCK_CXY ) )
    209 printk("\n[%s] thread[%x,%x] WRITE ACQUIRE rwlock %s [%x,%x] / taken %d / count %d\n",
     221if( cond )
     222printk("\n[%s] thread[%x,%x] WRITE ACQUIRE %s [%x,%x]\n"
     223"     taken %d / count %d / wr_empty %d / rd_empty %d\n",
    210224__FUNCTION__, this->process->pid, this->trdid,
    211225lock_type_str[lock_type], lock_cxy, lock_ptr,
    212 hal_remote_l32( taken_xp ), hal_remote_l32( count_xp ) );
     226hal_remote_l32( taken_xp ), hal_remote_l32( count_xp ),
     227xlist_is_empty( wr_root_xp ), xlist_is_empty( rd_root_xp ) );
    213228#endif
    214229
     
    244259thread_t * this      = CURRENT_THREAD;
    245260uint32_t   lock_type = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->lock.type ) );
     261bool_t     cond      = (type == DEBUG_RWLOCK_TYPE) &&
     262                       (((lock_cxy == (cxt_t)DEBUG_RWLOCK_CXY) &&
     263                         (lock_ptr == (remote_queuelock_t*)DEBUG_RWLOCK_PTR)) ||
     264                        ((DEBUG_RWLOCK_CXY == 0) &&
     265                         (DEBUG_RWLOCK_PTR == 0)));
    246266xptr_t     taken_xp  = XPTR( lock_cxy , &lock_ptr->taken );
    247 if( (lock_type          == DEBUG_RWLOCK_TYPE) &&
    248     ((intptr_t)lock_ptr == DEBUG_RWLOCK_PTR ) &&
    249     (lock_cxy           == DEBUG_RWLOCK_CXY ) )
    250 printk("\n[%s] thread[%x,%x] READ RELEASE rwlock %s [%x,%x] / taken %d / count %d\n",
     267#endif
     268
     269#if DEBUG_RWLOCK_TYPE
     270if( cond )
     271printk("\n[%s] thread[%x,%x] READ RELEASE %s [%x,%x]\n"
     272"     taken %d / count %d / wr_empty %d / rd_empty %d\n",
    251273__FUNCTION__, this->process->pid, this->trdid,
    252274lock_type_str[lock_type], lock_cxy, lock_ptr,
    253 hal_remote_l32( taken_xp ), hal_remote_l32( count_xp ) );
     275hal_remote_l32( taken_xp ), hal_remote_l32( count_xp ),
     276xlist_is_empty( wr_root_xp ), xlist_is_empty( rd_root_xp ) );
    254277#endif
    255278
     
    270293
    271294#if DEBUG_RWLOCK_TYPE
    272 if( (lock_type          == DEBUG_RWLOCK_TYPE) &&
    273     ((intptr_t)lock_ptr == DEBUG_RWLOCK_PTR ) &&
    274     (lock_cxy           == DEBUG_RWLOCK_CXY ) )
     295if( cond )
    275296{
    276297    trdid_t     trdid     = hal_remote_l32( XPTR( thread_cxy , &thread_ptr->trdid ) );
     
    303324
    304325#if DEBUG_RWLOCK_TYPE
    305 if( (lock_type          == DEBUG_RWLOCK_TYPE) &&
    306     ((intptr_t)lock_ptr == DEBUG_RWLOCK_PTR ) &&
    307     (lock_cxy           == DEBUG_RWLOCK_CXY ) )
     326if( cond )
    308327{
    309328    trdid_t     trdid     = hal_remote_l32( XPTR( thread_cxy , &thread_ptr->trdid ) );
     
    349368thread_t * this      = CURRENT_THREAD;
    350369uint32_t   lock_type = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->lock.type ) );
     370bool_t     cond      = (type == DEBUG_RWLOCK_TYPE) &&
     371                       (((lock_cxy == (cxt_t)DEBUG_RWLOCK_CXY) &&
     372                         (lock_ptr == (remote_queuelock_t*)DEBUG_RWLOCK_PTR)) ||
     373                        ((DEBUG_RWLOCK_CXY == 0) &&
     374                         (DEBUG_RWLOCK_PTR == 0)));
    351375xptr_t     count_xp  = XPTR( lock_cxy , &lock_ptr->count );
    352 if( (lock_type          == DEBUG_RWLOCK_TYPE) &&
    353     ((intptr_t)lock_ptr == DEBUG_RWLOCK_PTR ) &&
    354     (lock_cxy           == DEBUG_RWLOCK_CXY ) )
    355 printk("\n[%s] thread[%x,%x] WRITE RELEASE rwlock %s [%x,%x] / taken %d / count %d\n",
     376#endif
     377
     378#if DEBUG_RWLOCK_TYPE
     379if( cond )
     380printk("\n[%s] thread[%x,%x] WRITE RELEASE %s [%x,%x]\n"
     381"     taken %d / count %d / wr_empty %d / rd_empty %d\n",
    356382__FUNCTION__, this->process->pid, this->trdid,
    357383lock_type_str[lock_type], lock_cxy, lock_ptr,
    358 hal_remote_l32( taken_xp ), hal_remote_l32( count_xp ) );
     384hal_remote_l32( taken_xp ), hal_remote_l32( count_xp ),
     385xlist_is_empty( wr_root_xp ), xlist_is_empty( rd_root_xp ) );
    359386#endif
    360387
     
    374401
    375402#if DEBUG_RWLOCK_TYPE
    376 if( (lock_type          == DEBUG_RWLOCK_TYPE) &&
    377     ((intptr_t)lock_ptr == DEBUG_RWLOCK_PTR ) &&
    378     (lock_cxy           == DEBUG_RWLOCK_CXY ) )
     403if( cond )
    379404{
    380405    trdid_t     trdid     = hal_remote_l32( XPTR( thread_cxy , &thread_ptr->trdid ) );
     
    406431
    407432#if DEBUG_RWLOCK_TYPE
    408 if( (lock_type          == DEBUG_RWLOCK_TYPE) &&
    409     ((intptr_t)lock_ptr == DEBUG_RWLOCK_PTR ) &&
    410     (lock_cxy           == DEBUG_RWLOCK_CXY ) )
     433if( cond )
    411434{
    412435    trdid_t     trdid     = hal_remote_l32( XPTR( thread_cxy , &thread_ptr->trdid ) );
Note: See TracChangeset for help on using the changeset viewer.