| | 38 | == __Global variables used for external IRQs routing__ == |
| | 39 | |
| | 40 | * unsigned char '''_ext_irq_index'''[GIET_ISR_TYPE_MAX][GIET_ISR_CHANNEL_MAX]; |
| | 41 | This array contains the external IRQ indexes (IOPIC input index) for each (isr/channel) couple. |
| | 42 | This is an hardware feature defined in the mapping. |
| | 43 | |
| | 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. |
| | 48 | |
| | 49 | |
| | 50 | == __Functions used for dynamic allocation of external IRQs__ == |
| | 51 | |
| | 52 | === void '''_ext_irq_init'''() === |
| | 53 | This function is only used when the architecture contains an external IOPIC component. It initializes the ''_ext_irq_index[isr][channel]'' kernel array. This array defines the IRQ index (i.e. the IOPIC input index) associated to an (isr_type / isr_channel) couple, as specified in the mapping. It is used by the kernel for dynamic routing of external IRQs. |
| | 54 | |
| | 55 | === void '''_ext_irq_alloc( unsigned int isr_type , unsigned int isr_channel , unsigned int* wti_index ) === |
| | 56 | This function is used when the architecture contains an external IOPIC component. It dynamically allocates an external IRQ signaling completion of an I/O operation to the processor P[x,y,p] running the calling task. The two (isr_type / isr_channel) arguments define actually the external IRQ to be routed. |
| | 57 | * '''isr_type''' : type of ISR |
| | 58 | * '''isr_channel''' : ISR channel (for multi-channels peripherals) |
| | 59 | * '''wti_index''' : return value defining the index of the WTI mailbox allocated to P[x,y,p] |
| | 60 | This function does three things: |
| | 61 | 1. it allocates a WTI mailbox in the XCU of cluster[x,y] to the requesting processor ( index is in [4*p+1, 4*p+2, 4*p+3] ) ; |
| | 62 | 2. it initialises the IOPIC entry associated to the (isr_type/isr_channel) IRQ. |
| | 63 | 3. it initializes the proper entry in the WTI interrupt vector associated to processor P[x,y,p]. |
| | 64 | |
| | 65 | === void '''_ext_irq_release( unsigned int isr_type , unsigned int isr_channel , unsigned int wti_index ) === |
| | 66 | This function is used when the architecture contains an external IOPIC component. It desallocates the ressources allocated by the previous _ext_irq_alloc() function to the calling processor. The two (isr_type, isr_channel) arguments define actually the external IRQ to be released. |
| | 67 | * '''isr_type''' : type of ISR |
| | 68 | * '''isr_channel''' : ISR channel (for multi-channels peripherals) |
| | 69 | * '''wti_index''' : index of the WTI mailbox allocated to P[x,y,p] to be released. |
| | 70 | This function does only two things: |
| | 71 | 1. it desactivates the PIC entry associated to the (isr_type/isr_channel) IRQ. |
| | 72 | 2. it releases the WTI mailbox allocated to P[x,y,p]. |
| | 73 | 3. The WTI interrupt vector is NOT modified |
| | 74 | |
| | 75 | |
| 64 | | |
| 65 | | == __Functions used for dynamic allocation of external IRQs__ == |
| 66 | | |
| 67 | | === void '''_ext_irq_init'''() === |
| 68 | | This function is only used when the architecture contains an external IOPIC component. It initializes the ''_ext_irq_index[isr][channel]'' kernel array. This array defines the IRQ index (i.e. the IOPIC input index) associated to an (isr_type / isr_channel) couple, as specified in the mapping. It is used by the kernel for dynamic routing of external IRQs. |
| 69 | | |
| 70 | | === void '''_ext_irq_alloc( unsigned int isr_type , unsigned int isr_channel , unsigned int* wti_index ) === |
| 71 | | This function is used when the architecture contains an external IOPIC component. It dynamically allocates an external IRQ signaling completion of an I/O operation to the processor P[x,y,p] running the calling task. The two (isr_type / isr_channel) arguments define actually the external IRQ to be routed. |
| 72 | | * '''isr_type''' : type of ISR |
| 73 | | * '''isr_channel''' : ISR channel (for multi-channels peripherals) |
| 74 | | * '''wti_index''' : return value defining the index of the WTI mailbox allocated to P[x,y,p] |
| 75 | | This function does three things: |
| 76 | | 1. it allocates a WTI mailbox in the XCU of cluster[x,y] to the requesting processor ( index is in [4*p+1, 4*p+2, 4*p+3] ) ; |
| 77 | | 2. it initialises the IOPIC entry associated to the (isr_type/isr_channel) IRQ. |
| 78 | | 3. it initializes the proper entry in the WTI interrupt vector associated to processor P[x,y,p]. |
| 79 | | |
| 80 | | === void '''_ext_irq_release( unsigned int isr_type , unsigned int isr_channel , unsigned int wti_index ) === |
| 81 | | This function is used when the architecture contains an external IOPIC component. It desallocates the ressources allocated by the previous _ext_irq_alloc() function to the calling processor. The two (isr_type, isr_channel) arguments define actually the external IRQ to be released. |
| 82 | | * '''isr_type''' : type of ISR |
| 83 | | * '''isr_channel''' : ISR channel (for multi-channels peripherals) |
| 84 | | * '''wti_index''' : index of the WTI mailbox allocated to P[x,y,p] to be released. |
| 85 | | This function does only two things: |
| 86 | | 1. it desactivates the PIC entry associated to the (isr_type/isr_channel) IRQ. |
| 87 | | 2. it releases the WTI mailbox allocated to P[x,y,p]. |
| 88 | | 3. The WTI interrupt vector is NOT modified |
| 89 | | |