Ignore:
Timestamp:
Feb 20, 2018, 5:32:17 PM (4 years ago)
Author:
alain
Message:

Fix a bad bug in scheduler...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/hal/tsar_mips32/drivers/soclib_pic.c

    r432 r435  
    130130                           &pti_status );
    131131
    132     irq_dmsg("\n[DBG] %s : core[%x,%d] enter / WTI = %x / HWI = %x / PTI = %x\n",
    133              __FUNCTION__ , local_cxy , core->lid , wti_status , hwi_status , pti_status );
     132#if CONFIG_DEBUG_HAL_IRQS
     133uint32_t cycle = (uint32_t)hal_get_cycles();
     134if (CONFIG_DEBUG_HAL_IRQS < cycle )
     135printk("\n[DBG] %s : core[%x,%d] enter / WTI = %x / HWI = %x / PTI = %x / cycle %d\n",
     136__FUNCTION__ , local_cxy , core->lid , wti_status , hwi_status , pti_status, cycle );
     137#endif
    134138
    135139    // analyse status and handle up to 3 pending IRQ (one WTI, one HWI, one PTI)
     
    143147            assert( (index == core->lid) , __FUNCTION__ , "illegal IPI index" );
    144148
    145             irq_dmsg("\n[DBG] %s : core[%x,%d] received an IPI / cycle %d\n",
    146              __FUNCTION__ , local_cxy , core->lid , hal_time_stamp() );
    147 
     149#if CONFIG_DEBUG_HAL_IRQS
     150if (CONFIG_DEBUG_HAL_IRQS < cycle )
     151printk("\n[DBG] %s : core[%x,%d] received an IPI\n", __FUNCTION__ , local_cxy , core->lid );
     152#endif
    148153            // acknowledge WTI (this require an XCU read)
    149154            uint32_t   ack  = xcu_base[(XCU_WTI_REG << 5) | core->lid];
     
    171176            else                                 // call relevant ISR
    172177            {
    173                 irq_dmsg("\n[DBG] %s : core[%x,%d] received external WTI %d / cycle %d\n",
    174                 __FUNCTION__ , local_cxy , core->lid , index , hal_time_stamp() );
    175 
     178
     179#if CONFIG_DEBUG_HAL_IRQS
     180if (CONFIG_DEBUG_HAL_IRQS < cycle )
     181printk("\n[DBG] %s : core[%x,%d] received external WTI %d\n",
     182__FUNCTION__ , local_cxy , core->lid , index );
     183#endif
    176184                // call ISR
    177185                    src_chdev->isr( src_chdev );
     
    199207        else                    // call relevant ISR
    200208        {
    201             irq_dmsg("\n[DBG] %s : core[%x,%d] received HWI %d / cycle %d\n",
    202             __FUNCTION__ , local_cxy , core->lid , index , hal_time_stamp() );
    203 
     209
     210#if CONFIG_DEBUG_HAL_IRQS
     211if (CONFIG_DEBUG_HAL_IRQS < cycle )
     212printk("\n[DBG] %s : core[%x,%d] received HWI %d\n",
     213__FUNCTION__ , local_cxy , core->lid , index );
     214#endif
    204215            // call ISR
    205216                    src_chdev->isr( src_chdev );
     
    211222        index = pti_status - 1;
    212223
    213         irq_dmsg("\n[DBG] %s : core[%x,%d] received PTI %d / cycle %d\n",
    214         __FUNCTION__ , core->lid , local_cxy , index , hal_time_stamp() );
    215 
    216224        assert( (index == core->lid) , __FUNCTION__ , "unconsistent PTI index\n");
    217225
     226#if CONFIG_DEBUG_HAL_IRQS
     227if (CONFIG_DEBUG_HAL_IRQS < cycle )
     228printk("\n[DBG] %s : core[%x,%d] received PTI %d\n",
     229__FUNCTION__ , core->lid , local_cxy , index );
     230#endif
    218231        // acknowledge PTI (this require a read access to XCU)
    219232        uint32_t   ack  = xcu_base[(XCU_PTI_ACK << 5) | core->lid];
     
    345358                          chdev_t * src_chdev )
    346359{
     360
     361#if CONFIG_DEBUG_HAL_IRQS
     362uint32_t cycle = (uint32_t)hal_get_cycles();
     363if( CONFIG_DEBUG_HAL_IRQS < cycle )
     364printk("\n[DBG] %s : thread %x enter for core[%x,%d] / cycle %d\n",
     365__FUNCTION__ , CURRENT_THREAD , local_cxy , lid , cycle );
     366#endif
     367
    347368    // get extended & local pointers on PIC chdev descriptor
    348369    xptr_t     pic_xp  = chdev_dir.pic;
     
    401422        ((soclib_pic_core_t *)core->pic_extend)->wti_vector[wti_id] = src_chdev;
    402423
    403 pic_dmsg("\n[DBG] %s : %s / channel = %d / rx = %d / hwi_id = %d / wti_id = %d / cluster = %x\n",
     424#if CONFIG_DEBUG_HAL_IRQS
     425if( CONFIG_DEBUG_HAL_IRQS < cycle )
     426printk("\n[DBG] %s : %s / channel = %d / rx = %d / hwi_id = %d / wti_id = %d / cluster = %x\n",
    404427__FUNCTION__ , chdev_func_str( func ) , channel , is_rx , hwi_id , wti_id , local_cxy );
     428#endif
    405429
    406430    }
     
    420444        ((soclib_pic_core_t *)core->pic_extend)->wti_vector[hwi_id] = src_chdev;
    421445
    422 pic_dmsg("\n[DBG] %s : %s / channel = %d / hwi_id = %d / cluster = %x\n",
     446#if CONFIG_DEBUG_HAL_IRQS
     447if( CONFIG_DEBUG_HAL_IRQS < cycle )
     448printk("\n[DBG] %s : %s / channel = %d / hwi_id = %d / cluster = %x\n",
    423449__FUNCTION__ , chdev_func_str( func ) , channel , hwi_id , local_cxy );
     450#endif
    424451
    425452    }
Note: See TracChangeset for help on using the changeset viewer.