12 | | There is three interrupt vectors per processor (stored in each processor's scheduler) for the three interrupts types: '''HWI''' (Hardware Interrupt), '''PTI''' (Programmable Timer Interrupt), and '''WTI''' (Write Triggered Interrupt). Each interrupt vector entry contains two fields: |
| 12 | There is three interrupt vectors per processor (stored in each processor's scheduler) for the three interrupts types: '''HWI''' (Hardware Interrupt), '''PTI''' (Programmable Timer Interrupt), and '''WTI''' (Write Triggered Interrupt). The WTI are actually hardware mailboxes, that are used by the GIET-VM to implement two mechanisms: |
| 13 | * they are used to implement software IPIs (Inter Processor Interrupt). |
| 14 | * they are used to dynamically route the external IRQs (generated by the external peripheral) to a given processor. |
| 15 | |
| 16 | Each interrupt vector entry contains two fields: |
27 | | 5. The '''WAKE-UP''' interrupt can be used in two situations: When the interrupted processor is in "wait state" (low-power mode), the processor exit the "wait state", but the ISR is not executed. When the processor is not in "wait state" the ISR is executed. If the interrupted processor is runing the idle_task, or if the value written in the WTI mailbox is non zero, the ISR force a context switch on the target processor. |
28 | | |
29 | | 6. The three '''EXT_IRQ_ONE''', '''EXT_IRQ_TWO''' and '''EXT_IRQ_TER''' interrupts are dynamically allocated to external IRQS generated by the external peripherals (through the IOPIC component), in order to route the external IRQ - via a WTI - to the processor that launched the I/O operation. |
30 | | |
31 | | The array below define the static allocation of WTI mailboxes to the local processors, defined by the GIET-VM, and implemented by the XCU masks: |
32 | | || '''WTI name''' || ''' WTI index''' || |
33 | | || WAKE_UP || lpid || |
34 | | || EXT_IRQ_ONE || NB_PROCS_MAX + lpid || |
35 | | || EXT_IRQ_TWO || 2*NB_PROCS_MAX + lpid || |
36 | | || EXT_IRQ_TER || 3*NB_PROCS_MAX + lpid || |
| 33 | 5. In each cluster, the other '''WTI''' mailboxes (XCU_NB_WTI - NB_PROCS_MAX) are dynamically allocated to a given external IRQ. This allocation can be for a long time (Network Controller RX or TX IRQs), or just for a single - user required - I/O operation (Disk Controller IRQ, or TTY channel IRQ). In each cluster, a specific lock protect exclusive access to the local WTI mailboxes allocator. This dynamic routing of external IRQs relies on the MASK registers in the XCUs and IOPIC components. |
44 | | * unsigned char '''_wti_alloc_one'''[X_SIZE][Y_SIZE][NB_PROCS_MAX]; |
45 | | * unsigned char '''_wti_alloc_two'''[X_SIZE][Y_SIZE][NB_PROCS_MAX]; |
46 | | * unsigned char '''_wti_alloc_ter'''[X_SIZE][Y_SIZE][NB_PROCS_MAX]; |
47 | | These three arrays define the WTI allocators for each processor: non zero value when the entry has been allocated to a given external IRQ. This allocation is dynamically done by the kernel. |
| 41 | * unsigned char '''_wti_alloc'''[X_SIZE][Y_SIZE][XCU_NB_WTI]; |
| 42 | This array describes the WTI mailboxes allocation status in each cluster. Boolean true if MTI mailbox allocated. |
| 43 | |
| 44 | * spin_lock_t '''_wti_lock'''[X_SIZE][Y_SIZE]; |
| 45 | This array contains the locks protecting the WTI mailbox allocators in each cluster. |
| 46 | |
| 47 | * unsigned int '''_ext_irq_wti'''[GIET_ISR_TYPE_MAX][GIET_ISR_CHANNEL_MAX]; |
| 48 | This array contains for each external IRQ, identified by the (is_type,channel) couple, the allocated WTI mailbox identifier. |
| 49 | This identifier has the following format (x / y / lpid / wti), with one byte per field. |