Changes in trunk/kernel/devices/dev_icu.h [3:1]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/devices/dev_icu.h
r3 r1 35 35 * acting in all clusters containing cores. He is in charge of concentrating all IRQs 36 36 * (interrupt requests) generated by peripherals to signal the completion of an I/O 37 * operation. Each IRQ isrouted to the core that started the I/O operation.37 * operation. Each IRQ should be routed to the core that started the I/O operation. 38 38 * The ICU device must also help the kernel to select the ISR (Interrupt Service Routine) 39 39 * that must be executed by the target core. 40 40 * 41 * This component can be implemented as a dedicated hardware componentdistributed41 * This component can be implemented as a dedicated hardware, centralized or distributed 42 42 * in all clusters, or emulated in software, as long as it implements the specified API. 43 43 * For the TSAR architecture, this generic ICU device is implemented by the two hardware 44 44 * components soclib_xicu and and soclib_iopic, and their associated drivers. 45 45 * 46 * ALMOS-MKH defines three types of IRQs, that are handled by this ICU device:46 * ALMOS-MKH defines three types of IRQs, that are handled iby this ICU device: 47 47 * - HWI : The HardWare Interrupts are generated by local internal peripherals. 48 48 * They are connected to the local ICU, to be routed to a given local core. … … 72 72 * uses three interrupts vectors, implemented as three arrays (HWI/WTI/PTI), 73 73 * stored in the core descriptor. Each entry in one interrupt vector array contains 74 * a pointer on the chdevdescriptor that is the "source" of the interrupt.75 * This chdevdescriptor contains a link to the ISR to be executed.74 * an extended pointer on the device descriptor that is the "source" of the interrupt. 75 * This device descriptor contains a link to the ISR to be executed. 76 76 * 77 77 * The ICU peripheral does not execute I/O operations, but is just acting as a 78 * dynamically configurable interrupt router for other I/O operations.79 * Therefore, ALMOS-MKH does not use the ICU device waiting queue, but calls directly78 * dynamically configurable interrupt router for another I/O operation. 79 * Therefore, ALMOS-MKH does not use the iCU device waiting queue, but calls directly 80 80 * the ICU driver blocking functions, using the device lock to get exclusive access to 81 81 * the ICU device state. … … 84 84 /**** Forward declarations ****/ 85 85 86 struct chdev_s;86 struct device_s; 87 87 88 88 /***************************************************************************************** … … 127 127 /***************************************************************************************** 128 128 * This function makes two initialisations: 129 * - It initialises the ICU specific fields of the chdevdescriptor.129 * - It initialises the ICU specific fields of the device descriptor. 130 130 * - it initialises the implementation specific ICU hardware device and associated 131 131 * data structures if required. 132 * It must be called by a local thread.133 ***************************************************************************************** 134 * @ icu : pointer on ICU chdevdescriptor.135 * @ hwi_nr : number of HWI irqs.136 * @ wti_nr : number of WTI irqs.137 * @ pti_nr : number of PTI irqs.138 ****************************************************************************************/ 139 void dev_icu_init( struct chdev_s * icu,140 uint32_t 141 uint32_t 142 uint32_t 143 144 /***************************************************************************************** 145 * This function enables the routing of a given IRQ, to a given core in the localcluster.146 * This IRQ is identified by its type (HWI/WTI/PTI) and index in the localICU.132 * It must be executed once in the cluster containing the ICU device descriptor. 133 ***************************************************************************************** 134 * @ icu_xp : extended pointer on ICU device descriptor. 135 * @ hwi_nr : number of HWI irqs. 136 * @ wti_nr : number of WTI irqs. 137 * @ pti_nr : number of PTI irqs. 138 ****************************************************************************************/ 139 void dev_icu_init( xptr_t icu_xp, 140 uint32_t hwi_nr, 141 uint32_t wti_nr, 142 uint32_t pti_nr ); 143 144 /***************************************************************************************** 145 * This function enables the routing of a given IRQ, to a given core in a remote cluster. 146 * This IRQ is identified by its type (HWI/WTI/PTI) and index in the remote ICU. 147 147 * The target core is identified by its local index. 148 * It must be called by a local thread.149 * - It unmask the selected IRQ in the ICU.150 * - It registers the pointer on the "source" chdevdescriptor in the148 * As it uses remote accesses, it can be executed by any thread in any cluster. 149 * - It unmask the selected IRQ in the remote ICU. 150 * - It registers the extended pointer on the "source" device descriptor in the 151 151 * relevant interrupt vector of the selected core. 152 * - It register the IRQ type and index in the "source" chdev descriptor. 153 ***************************************************************************************** 154 * @ lid : local index of selected core. 152 * - It register the IRQ type and index in the "source" device descriptor. 153 ***************************************************************************************** 154 * @ cxy : remote cluster identifier (can be the local custer). 155 * @ lid : local index of selected core in remote cluster. 155 156 * @ irq_type : HWI/WTI/PTI. 156 * @ irq_id : IRQ index in ICU 157 * @ chdev : pointer on source chdev descriptor. 158 ****************************************************************************************/ 159 void dev_icu_enable_irq( lid_t lid, 160 uint32_t irq_type, 161 uint32_t irq_id, 162 struct chdev_s * chdev ); 163 164 /***************************************************************************************** 165 * This function disables one given IRQ for a given core in the local cluster. 166 * This IRQ is identified by its type (HWI/WTI/PTI) and index in the local ICU. 157 * @ irq_id : IRQ index in remote ICU 158 * @ src_dev_xp : extended pointer on device descriptor source of IRQ. 159 ****************************************************************************************/ 160 void dev_icu_enable_irq( cxy_t cxy, 161 lid_t lid, 162 uint32_t irq_type, 163 uint32_t irq_id, 164 xptr_t src_dev_xp ); 165 166 /***************************************************************************************** 167 * This function disables one given IRQ for a given core in a remote cluster. 168 * This IRQ is identified by its type (HWI/WTI/PTI) and index in the remote ICU. 167 169 * The core is identified by its local index. 168 * It must be called by a local thread.169 * - It mask the selected IRQ in the ICU.170 * - It removes the pointer on the "source" chdevdescriptor from the170 * As it uses remote accesses, it can be executed by any thread in any cluster. 171 * - It mask the selected IRQ in the remote ICU. 172 * - It removes the extended pointer on the "source" device descriptor from the 171 173 * relevant interrupt vector of the selected core. 172 * - The IRQ type and index fields are not modified in the "source" chdev descriptor. 173 ***************************************************************************************** 174 * - The IRQ type and index fields are not modified in the "source" device descriptor. 175 ***************************************************************************************** 176 * @ cxy : remote cluster identifier (can be the local custer). 174 177 * @ lid : local index of selected core in remote cluster. 175 178 * @ irq_type : HWI/WTI/PTI. 176 179 * @ irq_id : IRQ index. 177 180 ****************************************************************************************/ 178 void dev_icu_disable_irq( lid_t lid, 181 void dev_icu_disable_irq( cxy_t cxy, 182 lid_t lid, 179 183 uint32_t irq_type, 180 184 uint32_t irq_id ); … … 183 187 * This function set the period value for a timer identified by the PTI index, 184 188 * in the local ICU device descriptor. 185 * It must be called by a local thread.186 189 ***************************************************************************************** 187 190 * @ pti_id : PTI index. … … 194 197 * This function acknowledge a PTI IRQ for a timer identified by the PTI index, 195 198 * in the local ICU device descriptor. 196 * It must be called by a local thread.197 199 ***************************************************************************************** 198 200 * @ pti_id : PTI index. … … 202 204 /***************************************************************************************** 203 205 * This function send an IPI (Inter Processor Interrupt) to a core identified by 204 * its cluster identifier and local index. 205 * It can be called by any thread running in any cluster. 206 * its cluster identifier and local index. 206 207 * This IPI force a context switch, and the handling of pending RPC(s). 207 208 ***************************************************************************************** … … 225 226 226 227 /***************************************************************************************** 227 * This function implements the WTI mailbox allocator for the local ICU. 228 * These mailbox are used by I/O operations for completion signaling. 229 * It must be called by a thread running in the cluster containing the target ICU. 228 * This function implements the WTI mailbox allocator. It is used by all I/O operations 229 * for completion signaling. 230 230 * If there is no mailbox available, the client thread must deschedule and retry later. 231 231 * If N is the total number of WTI mailboxes in a cluster, and NC the number of cores, … … 240 240 /***************************************************************************************** 241 241 * This function releases a dynamically allocated WTI mailbox. 242 * It must be called by a thread running in the cluster containing the target ICU.243 242 * It does not access the hardware device. 244 243 ***************************************************************************************** … … 248 247 249 248 /***************************************************************************************** 250 * This function returns a pointer on the WTI mailbox identified by its index 251 * in the local ICU device. 252 ***************************************************************************************** 253 * @ wti_id : WTI mailbox index. 254 * @ returns pointer on mailbox register. 255 ****************************************************************************************/ 256 uint32_t * dev_icu_wti_ptr( uint32_t wti_id ); 249 * This function returns an extended pointer on a WTI mailbox identified by its 250 * cluster identifier and local index in ICU. 251 * WARNING: we assume that all ICU hardware devices have the same local base address. 252 ***************************************************************************************** 253 * @ cxy : mailbox cluster identifier 254 * @ wti_id : mailbox WTI index. 255 * @ returns extended pointer on mailbox register. 256 ****************************************************************************************/ 257 xptr_t dev_icu_wti_xptr( cxy_t cxy, 258 uint32_t wti_id ); 257 259 258 260 #endif /* _DEV_ICU_H_ */
Note: See TracChangeset
for help on using the changeset viewer.