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_queuelock.c

    r629 r666  
    5656#if DEBUG_QUEUELOCK_TYPE
    5757thread_t * this = CURRENT_THREAD;
    58 if( (type     == DEBUG_QUEUELOCK_TYPE) &&
    59     (lock_ptr == DEBUG_QUEUELOCK_PTR ) &&
    60     (lock_cxy == DEBUG_QUEUELOCK_CXY ) )
    61 printk("\n[%s] thread[%x,%x] initialise lock %s [%x,%x]\n",
     58bool_t     cond = (type == DEBUG_QUEUELOCK_TYPE) &&
     59                  (((lock_cxy == (cxy_t)DEBUG_QUEUELOCK_CXY) &&
     60                    (lock_ptr == (remote_queuelock_t*)DEBUG_QUEUELOCK_PTR)) ||
     61                   ((DEBUG_QUEUELOCK_CXY == 0) &&
     62                    (DEBUG_QUEUELOCK_PTR == 0)));
     63if( cond )printk("\n[%s] thread[%x,%x] initialise lock %s [%x,%x]\n",
    6264__FUNCTION__, this->process->pid, this->trdid,
    6365lock_type_str[type], lock_cxy, lock_ptr );
     
    7072{
    7173    thread_t * this = CURRENT_THREAD;
    72 
    73     // check calling thread can yield
    74     thread_assert_can_yield( this , __FUNCTION__ );
    7574
    7675    // get lock cluster and local pointer
     
    7877    remote_queuelock_t * lock_ptr = GET_PTR( lock_xp );
    7978
    80 #if DEBUG_QUEUELOCK_TYPE
    81 uint32_t lock_type = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->lock.type ) );
     79    // check calling thread can yield
     80    thread_assert_can_yield( this , __FUNCTION__ );
     81
     82#if DEBUG_QUEUELOCK_TYPE
     83uint32_t   lock_type = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->lock.type ) );
     84bool_t     cond = (lock_type == DEBUG_QUEUELOCK_TYPE) &&
     85                  (((lock_cxy == (cxy_t)DEBUG_QUEUELOCK_CXY) &&
     86                    (lock_ptr == (remote_queuelock_t*)DEBUG_QUEUELOCK_PTR)) ||
     87                   ((DEBUG_QUEUELOCK_CXY == 0) &&
     88                    (DEBUG_QUEUELOCK_PTR == 0)));
    8289#endif
    8390
     
    93100
    94101#if DEBUG_QUEUELOCK_TYPE
    95 if( (lock_type == DEBUG_QUEUELOCK_TYPE) &&
    96     (lock_ptr  == DEBUG_QUEUELOCK_PTR ) &&
    97     (lock_cxy  == DEBUG_QUEUELOCK_CXY ) )
    98 printk("\n[%s] thread[%x,%x] BLOCK on q_lock %s [%x,%x]\n",
     102if( cond ) printk("\n[%s] thread[%x,%x] BLOCK on q_lock %s [%x,%x]\n",
    99103__FUNCTION__, this->process->pid, this->trdid,
    100104lock_type_str[lock_type], lock_cxy, lock_ptr );
     
    121125
    122126#if DEBUG_QUEUELOCK_TYPE
    123 if( (lock_type == DEBUG_QUEUELOCK_TYPE) &&
    124     (lock_ptr  == DEBUG_QUEUELOCK_PTR ) &&
    125     (lock_cxy  == DEBUG_QUEUELOCK_CXY ) )
    126 printk("\n[%s] thread[%x,%x] ACQUIRE q_lock %s [%x,%x]\n",
     127if( cond ) printk("\n[%s] thread[%x,%x] ACQUIRE q_lock %s [%x,%x]\n",
    127128__FUNCTION__, this->process->pid, this->trdid,
    128129lock_type_str[lock_type], lock_cxy, lock_ptr );
     
    149150    remote_queuelock_t * lock_ptr = GET_PTR( lock_xp );
    150151
     152#if DEBUG_QUEUELOCK_TYPE
     153thread_t * this      = CURRENT_THREAD;
     154uint32_t   lock_type = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->lock.type ) );
     155bool_t     cond = (lock_type == DEBUG_QUEUELOCK_TYPE) &&
     156                  (((lock_cxy == (cxy_t)DEBUG_QUEUELOCK_CXY) &&
     157                    (lock_ptr == (remote_queuelock_t*)DEBUG_QUEUELOCK_PTR)) ||
     158                   ((DEBUG_QUEUELOCK_CXY == 0) &&
     159                    (DEBUG_QUEUELOCK_PTR == 0)));
     160#endif
     161
    151162    // build extended pointer on busylock protecting queuelock
    152163    xptr_t busylock_xp = XPTR( lock_cxy , &lock_ptr->lock );
     
    156167
    157168#if DEBUG_QUEUELOCK_TYPE
    158 thread_t * this      = CURRENT_THREAD;
    159 uint32_t   lock_type = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->lock.type ) );
    160 if( (lock_type == DEBUG_QUEUELOCK_TYPE) &&
    161     (lock_ptr  == DEBUG_QUEUELOCK_PTR ) &&
    162     (lock_cxy  == DEBUG_QUEUELOCK_CXY ) )
    163 printk("\n[%s] thread[%x,%x] RELEASE q_lock %s (%x,%x)\n",
     169if( cond ) printk("\n[%s] thread[%x,%x] RELEASE q_lock %s [%x,%x]\n",
    164170__FUNCTION__, this->process->pid, this->trdid,
    165171lock_type_str[lock_type], lock_cxy, lock_ptr );
     
    179185
    180186#if DEBUG_QUEUELOCK_TYPE
    181 if( (lock_type == DEBUG_QUEUELOCK_TYPE) &&
    182     (lock_ptr  == DEBUG_QUEUELOCK_PTR ) &&
    183     (lock_cxy  == DEBUG_QUEUELOCK_CXY ) )
     187if( cond )
    184188{
    185189    trdid_t     trdid   = hal_remote_l32( XPTR( thread_cxy , &thread_ptr->trdid ) );
Note: See TracChangeset for help on using the changeset viewer.