Changeset 14 for trunk/kernel/drivers
- Timestamp:
- May 3, 2017, 1:23:24 PM (8 years ago)
- Location:
- trunk/kernel/drivers/soclib
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/drivers/soclib/soclib_iob.c
r4 r14 22 22 */ 23 23 24 #include < almos_config.h>24 #include <kernel_config.h> 25 25 #include <hal_types.h> 26 26 #include <hal_remote.h> -
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 -
trunk/kernel/drivers/soclib/soclib_xcu.h
r4 r14 94 94 95 95 /****************************************************************************************** 96 * This function returns the values contained in the HWI/WTI/PTI mask registers for 97 * a given core. It must be called by a local thread. 98 ****************************************************************************************** 99 * @ icu : pointer on local XCU chdev descriptor 100 * @ lid : local core index == output IRQ index 101 * @ hwi_mask : [out] HWI mask for selected core 102 * @ wti_mask : [out] WTI mask for selected core 103 * @ pti_mask : [out] PTI mask for selected core 104 *****************************************************************************************/ 105 void soclib_xcu_get_masks( chdev_t * icu, 106 lid_t lid, 107 uint32_t * hwi_mask, 108 uint32_t * wti_mask, 109 uint32_t * pti_mask ); 110 111 /****************************************************************************************** 96 112 * This function set the period value for a local XCU timer. 97 113 ******************************************************************************************
Note: See TracChangeset
for help on using the changeset viewer.