Changes in trunk/kernel/devices/dev_icu.h [1:3]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/devices/dev_icu.h
r1 r3 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 should berouted to the core that started the I/O operation.37 * operation. Each IRQ is 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 , centralized ordistributed41 * This component can be implemented as a dedicated hardware component 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 iby this ICU device:46 * ALMOS-MKH defines three types of IRQs, that are handled by 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 n extended pointer on the devicedescriptor that is the "source" of the interrupt.75 * This devicedescriptor contains a link to the ISR to be executed.74 * a pointer on the chdev descriptor that is the "source" of the interrupt. 75 * This chdev 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 another I/O operation.79 * Therefore, ALMOS-MKH does not use the iCU device waiting queue, but calls directly78 * dynamically configurable interrupt router for other I/O operations. 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 device_s;86 struct chdev_s; 87 87 88 88 /***************************************************************************************** … … 127 127 /***************************************************************************************** 128 128 * This function makes two initialisations: 129 * - It initialises the ICU specific fields of the devicedescriptor.129 * - It initialises the ICU specific fields of the chdev descriptor. 130 130 * - it initialises the implementation specific ICU hardware device and associated 131 131 * data structures if required. 132 * It must be executed once in the cluster containing the ICU device descriptor.133 ***************************************************************************************** 134 * @ icu _xp : extended pointer on ICU devicedescriptor.135 * @ hwi_nr 136 * @ wti_nr 137 * @ pti_nr 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 remotecluster.146 * This IRQ is identified by its type (HWI/WTI/PTI) and index in the remoteICU.132 * It must be called by a local thread. 133 ***************************************************************************************** 134 * @ icu : pointer on ICU chdev 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( struct chdev_s * icu, 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 the local cluster. 146 * This IRQ is identified by its type (HWI/WTI/PTI) and index in the local ICU. 147 147 * The target core is identified by its local index. 148 * As it uses remote accesses, it can be executed by any thread in any cluster.149 * - It unmask the selected IRQ in the remoteICU.150 * - It registers the extended pointer on the "source" devicedescriptor in the148 * 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" chdev descriptor in the 151 151 * relevant interrupt vector of the 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. 152 * - It register the IRQ type and index in the "source" chdev descriptor. 153 ***************************************************************************************** 154 * @ lid : local index of selected core. 156 155 * @ irq_type : HWI/WTI/PTI. 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. 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. 169 167 * The core is identified by its local index. 170 * As it uses remote accesses, it can be executed by any thread in any cluster.171 * - It mask the selected IRQ in the remoteICU.172 * - It removes the extended pointer on the "source" devicedescriptor from the168 * 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" chdev descriptor from the 173 171 * relevant interrupt vector of the selected core. 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). 172 * - The IRQ type and index fields are not modified in the "source" chdev descriptor. 173 ***************************************************************************************** 177 174 * @ lid : local index of selected core in remote cluster. 178 175 * @ irq_type : HWI/WTI/PTI. 179 176 * @ irq_id : IRQ index. 180 177 ****************************************************************************************/ 181 void dev_icu_disable_irq( cxy_t cxy, 182 lid_t lid, 178 void dev_icu_disable_irq( lid_t lid, 183 179 uint32_t irq_type, 184 180 uint32_t irq_id ); … … 187 183 * This function set the period value for a timer identified by the PTI index, 188 184 * in the local ICU device descriptor. 185 * It must be called by a local thread. 189 186 ***************************************************************************************** 190 187 * @ pti_id : PTI index. … … 197 194 * This function acknowledge a PTI IRQ for a timer identified by the PTI index, 198 195 * in the local ICU device descriptor. 196 * It must be called by a local thread. 199 197 ***************************************************************************************** 200 198 * @ pti_id : PTI index. … … 204 202 /***************************************************************************************** 205 203 * This function send an IPI (Inter Processor Interrupt) to a core identified by 206 * its cluster identifier and local index. 204 * its cluster identifier and local index. 205 * It can be called by any thread running in any cluster. 207 206 * This IPI force a context switch, and the handling of pending RPC(s). 208 207 ***************************************************************************************** … … 226 225 227 226 /***************************************************************************************** 228 * This function implements the WTI mailbox allocator. It is used by all I/O operations 229 * for completion signaling. 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. 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. 242 243 * It does not access the hardware device. 243 244 ***************************************************************************************** … … 247 248 248 249 /***************************************************************************************** 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 ); 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 ); 259 257 260 258 #endif /* _DEV_ICU_H_ */
Note: See TracChangeset
for help on using the changeset viewer.