Ignore:
Timestamp:
May 3, 2017, 1:23:24 PM (8 years ago)
Author:
alain
Message:

Bugs fix.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/drivers/soclib/soclib_xcu.c

    r4 r14  
    3636        uint32_t * base = (uint32_t *)GET_PTR( icu->base );
    3737
    38     // write into registers
     38    // disable all IRQs
    3939    base[XCU_MSK_HWI_DISABLE << 5 | lid] = 0xFFFFFFFF;
    4040    base[XCU_MSK_WTI_DISABLE << 5 | lid] = 0xFFFFFFFF;
     
    7070        else if( type == HWI_TYPE ) base[XCU_MSK_HWI_ENABLE << 5 | lid] = mask;
    7171        else                        base[XCU_MSK_PTI_ENABLE << 5 | lid] = mask;
     72}
     73
     74///////////////////////////////////////////
     75void soclib_xcu_get_masks( chdev_t   * icu,
     76                           lid_t       lid,
     77                           uint32_t  * hwi_mask,
     78                           uint32_t  * wti_mask,
     79                           uint32_t  * pti_mask )
     80{
     81    // get XCU segment base address
     82        uint32_t * base = (uint32_t *)GET_PTR( icu->base );
     83 
     84    // get values from registers
     85    *hwi_mask = base[XCU_MSK_HWI << 5 | lid];
     86    *wti_mask = base[XCU_MSK_WTI << 5 | lid];
     87    *pti_mask = base[XCU_MSK_PTI << 5 | lid];
    7288}
    7389
     
    108124        uint32_t prio = base[XCU_PRIO << 5 | lid];
    109125
    110     if( prio & 0x4 ) *wti_status = ((prio >> 24) & 0x1F) + 1;
    111     if( prio & 0x2 ) *hwi_status = ((prio >> 16) & 0x1F) + 1;
    112     if( prio & 0x1 ) *pti_status = ((prio >>  8) & 0x1F) + 1;
     126    *wti_status = (prio & 0x4) ? (((prio >> 24) & 0x1F) + 1) : 0;
     127    *hwi_status = (prio & 0x2) ? (((prio >> 16) & 0x1F) + 1) : 0;
     128    *pti_status = (prio & 0x1) ? (((prio >>  8) & 0x1F) + 1) : 0;
    113129}
    114130
Note: See TracChangeset for help on using the changeset viewer.