Changeset 14 for trunk/kernel/drivers/soclib/soclib_xcu.c
- Timestamp:
- May 3, 2017, 1:23:24 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/drivers/soclib/soclib_xcu.c
r4 r14 36 36 uint32_t * base = (uint32_t *)GET_PTR( icu->base ); 37 37 38 // write into registers38 // disable all IRQs 39 39 base[XCU_MSK_HWI_DISABLE << 5 | lid] = 0xFFFFFFFF; 40 40 base[XCU_MSK_WTI_DISABLE << 5 | lid] = 0xFFFFFFFF; … … 70 70 else if( type == HWI_TYPE ) base[XCU_MSK_HWI_ENABLE << 5 | lid] = mask; 71 71 else base[XCU_MSK_PTI_ENABLE << 5 | lid] = mask; 72 } 73 74 /////////////////////////////////////////// 75 void 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]; 72 88 } 73 89 … … 108 124 uint32_t prio = base[XCU_PRIO << 5 | lid]; 109 125 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; 113 129 } 114 130
Note: See TracChangeset
for help on using the changeset viewer.