Changeset 205 for trunk/hal


Ignore:
Timestamp:
Jul 17, 2017, 11:41:25 AM (7 years ago)
Author:
alain
Message:

Change dev_pic_enable_irq() and dev_pic_disable_irq() prototypes
to handle remote IRQs.

Location:
trunk/hal/tsar_mips32/drivers
Files:
2 edited

Legend:

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

    r204 r205  
    6868inline uint32_t * soclib_pic_xcu_base()
    6969{
    70     return ((soclib_pic_cluster_t *)LOCAL_CLUSTER->pic_extend)->xcu_base;
    71 
    72 }  // end soclib_pic_xcu_base()
     70    return ((soclib_pic_cluster_t *)(LOCAL_CLUSTER->pic_extend))->xcu_base;
     71}
     72
     73/////////////////////////////////////////////////////////
     74inline uint32_t * soclib_pic_remote_xcu_base( cxy_t cxy )
     75{
     76    soclib_pic_cluster_t * extend;
     77
     78    // get extended pointer on PIC extension in remote cluster
     79    extend = hal_remote_lpt( XPTR( cxy , &cluster_manager.pic_extend ) );
     80
     81        return (uint32_t *)hal_remote_lpt( XPTR( cxy , &extend->xcu_base ) );
     82                 
     83}
    7384
    7485
     
    397408}  // end soclib_pic_bind_irq();
    398409
    399 //////////////////////////////////////////
    400 void soclib_pic_enable_irq( lid_t     lid,
    401                             chdev_t * src_chdev )
    402 {
    403     // get local pointer on XCU segment base
    404     uint32_t * seg_xcu_ptr = soclib_pic_xcu_base();
     410///////////////////////////////////////
     411void soclib_pic_enable_irq( lid_t  lid,
     412                            xptr_t src_chdev_xp )
     413{
     414    // get cluster and local pointer on remote src_chdev
     415    cxy_t     src_chdev_cxy = GET_CXY( src_chdev_xp );
     416    chdev_t * src_chdev_ptr = (chdev_t *)GET_PTR( src_chdev_xp );
     417
     418    // get local pointer on remote XCU segment base
     419    uint32_t * seg_xcu_ptr = soclib_pic_remote_xcu_base( src_chdev_cxy );
    405420
    406421    // get the source chdev IRQ type and index
    407     uint32_t irq_type = src_chdev->irq_type;
    408     uint32_t irq_id   = src_chdev->irq_id;
     422    uint32_t irq_type = hal_remote_lw( XPTR( src_chdev_cxy , &src_chdev_ptr->irq_type ) );
     423    uint32_t irq_id   = hal_remote_lw( XPTR( src_chdev_cxy , &src_chdev_ptr->irq_id ) );
    409424
    410425    if( irq_type == SOCLIB_TYPE_HWI )
    411426    {
    412          // enable this HWI in local XCU controller
    413         seg_xcu_ptr[(XCU_MSK_HWI_ENABLE << 5) | lid] = (1 << irq_id);
     427        // enable this HWI in remote XCU controller
     428        hal_remote_sw( XPTR( src_chdev_cxy ,
     429                       &seg_xcu_ptr[(XCU_MSK_HWI_ENABLE << 5) | lid] ) , (1 << irq_id) );
    414430    }
    415431    else if( irq_type == SOCLIB_TYPE_WTI )
    416432    {
    417          // enable this WTI in local XCU controller
    418         seg_xcu_ptr[(XCU_MSK_WTI_ENABLE << 5) | lid] = 1 << irq_id;
     433        // enable this WTI in local XCU controller
     434        hal_remote_sw( XPTR( src_chdev_cxy ,
     435                       &seg_xcu_ptr[(XCU_MSK_WTI_ENABLE << 5) | lid] ) , (1 << irq_id) );
    419436    }
    420437    else
     
    424441} // end soclib_pic_enable_irq()
    425442
    426 ///////////////////////////////////////////
    427 void soclib_pic_disable_irq( lid_t     lid,
    428                              chdev_t * src_chdev )
    429 {
    430     // get local pointer on XCU segment base
    431     uint32_t * seg_xcu_ptr = soclib_pic_xcu_base();
     443////////////////////////////////////////
     444void soclib_pic_disable_irq( lid_t  lid,
     445                             xptr_t src_chdev_xp )
     446{
     447    // get cluster and local pointer on remote src_chdev
     448    cxy_t     src_chdev_cxy = GET_CXY( src_chdev_xp );
     449    chdev_t * src_chdev_ptr = (chdev_t *)GET_PTR( src_chdev_xp );
     450
     451    // get local pointer on remote XCU segment base
     452    uint32_t * seg_xcu_ptr = soclib_pic_remote_xcu_base( src_chdev_cxy );
    432453
    433454    // get the source chdev IRQ type and index
    434     uint32_t irq_type = src_chdev->irq_type;
    435     uint32_t irq_id   = src_chdev->irq_id;
     455    uint32_t irq_type = hal_remote_lw( XPTR( src_chdev_cxy , &src_chdev_ptr->irq_type ) );
     456    uint32_t irq_id   = hal_remote_lw( XPTR( src_chdev_cxy , &src_chdev_ptr->irq_id ) );
    436457
    437458    if( irq_type == SOCLIB_TYPE_HWI )
    438459    {
    439          // disable this HWI in local XCU controller
    440         seg_xcu_ptr[(XCU_MSK_HWI_DISABLE << 5) | lid] = 1 << irq_id;
     460        // enable this HWI in remote XCU controller
     461        hal_remote_sw( XPTR( src_chdev_cxy ,
     462                       &seg_xcu_ptr[(XCU_MSK_HWI_DISABLE << 5) | lid] ) , (1 << irq_id) );
    441463    }
    442464    else if( irq_type == SOCLIB_TYPE_WTI )
    443465    {
    444          // disable this WTI in local XCU controller
    445         seg_xcu_ptr[(XCU_MSK_WTI_DISABLE << 5) | lid] = 1 << irq_id;
     466        // enable this WTI in local XCU controller
     467        hal_remote_sw( XPTR( src_chdev_cxy ,
     468                       &seg_xcu_ptr[(XCU_MSK_WTI_DISABLE << 5) | lid] ) , (1 << irq_id) );
    446469    }
    447470    else
  • trunk/hal/tsar_mips32/drivers/soclib_pic.h

    r188 r205  
    206206
    207207/******************************************************************************************
    208  * This function enable a HWI/WTI IRQ identified by the <src_chdev> argument,
     208 * This function enables a remote HWI/WTI IRQ, identified by the <src_chdev_xp> argument,
    209209 * that contains information on the IRQ type (HWI/WTI), and IRQ index.
    210  * It access the relevant XCU mask register, but does not access IOPIC.
    211  ******************************************************************************************
    212  * @ lid        : target core local index.
    213  * @ src_chdev  : local pointer on source chdev descriptor.
    214  *****************************************************************************************/
    215 void soclib_pic_enable_irq( lid_t     lid,
    216                             chdev_t * src_chdev );
    217 
    218 /******************************************************************************************
    219  * This function disable a HWI/WTI IRQ identified by the <src_chdev> argument,
     210 * It access the remote XCU mask register, but does not access IOPIC.
     211 ******************************************************************************************
     212 * @ lid           : target core local index (in cluster containing the source chdev).
     213 * @ src_chdev_xp  : extended pointer on source chdev descriptor.
     214 *****************************************************************************************/
     215void soclib_pic_enable_irq( lid_t   lid,
     216                            xptr_t  src_chdev_xp );
     217
     218/******************************************************************************************
     219 * This function disables a remote HWI/WTI IRQ, identified by the <src_chdev_xp> argument,
    220220 * that contains information on the IRQ type (HWI/WTI), and IRQ index.
    221  * It access the relevant XCU mask register, but does not access IOPIC.
    222  ******************************************************************************************
    223  * @ lid        : target core local index.
    224  * @ src_chdev  : local pointer on source chdev descriptor.
    225  *****************************************************************************************/
    226 void soclib_pic_disable_irq( lid_t     lid,
    227                              chdev_t * src_chdev );
     221 * It access the remote XCU mask register, but does not access IOPIC.
     222 ******************************************************************************************
     223 * @ lid           : target core local index (in cluster containing the source chdev).
     224 * @ src_chdev_xp  : extended pointer on source chdev descriptor.
     225 *****************************************************************************************/
     226void soclib_pic_disable_irq( lid_t   lid,
     227                             xptr_t  src_chdev_xp );
    228228
    229229/******************************************************************************************
     
    266266
    267267/******************************************************************************************
    268  * This function returns a local pointer on the local XCU base segment.
     268 * This function returns the local pointer on the local XCU base segment.
    269269 *****************************************************************************************/
    270270uint32_t * soclib_pic_xcu_base();
     271
     272/******************************************************************************************
     273 * This function returns the local pointer on a remote XCU base segment.
     274 * It is used by the soclip_pic_enable_irq() and soclib_pic_disable_irq() functions.
     275 ******************************************************************************************
     276 * @ cxy  : target cluster identifier.
     277 *****************************************************************************************/
     278uint32_t * soclib_pic_remote_xcu_base( cxy_t cxy );
    271279
    272280/******************************************************************************************
Note: See TracChangeset for help on using the changeset viewer.