arch: isr: Update z_isr_install for multi-level interrupts
z_isr_install is not suited to handle multi-level interrupt formats. This update allows z_isr_install to accept irq numbers in zephyr format and place them in the isr table appropriately. Fixes issue #22145 Signed-off-by: Jaron Kelleher <jkelleher@fb.com>
This commit is contained in:
parent
a06617b7e1
commit
0fb4382164
3 changed files with 132 additions and 3 deletions
|
@ -313,6 +313,21 @@ static inline unsigned int irq_to_level_2(unsigned int irq)
|
|||
{
|
||||
return (irq + 1) << 8;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Returns the parent IRQ of the level 2 raw IRQ number
|
||||
* @def irq_parent_level_2()
|
||||
*
|
||||
* The parent of a 2nd level interrupt is in the 1st byte
|
||||
*
|
||||
* @param irq IRQ number in its zephyr format
|
||||
*
|
||||
* @return 2nd level IRQ parent
|
||||
*/
|
||||
static inline unsigned int irq_parent_level_2(unsigned int irq)
|
||||
{
|
||||
return irq & 0xFF;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_3RD_LEVEL_INTERRUPTS
|
||||
|
@ -342,12 +357,27 @@ static inline unsigned int irq_from_level_3(unsigned int irq)
|
|||
*
|
||||
* @param irq IRQ number in its zephyr format
|
||||
*
|
||||
* @return 3nd level IRQ number
|
||||
* @return 3rd level IRQ number
|
||||
*/
|
||||
static inline unsigned int irq_to_level_3(unsigned int irq)
|
||||
{
|
||||
return (irq + 1) << 16;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Returns the parent IRQ of the level 3 raw IRQ number
|
||||
* @def irq_parent_level_3()
|
||||
*
|
||||
* The parent of a 3rd level interrupt is in the 2nd byte
|
||||
*
|
||||
* @param irq IRQ number in its zephyr format
|
||||
*
|
||||
* @return 3rd level IRQ parent
|
||||
*/
|
||||
static inline unsigned int irq_parent_level_3(unsigned int irq)
|
||||
{
|
||||
return (irq >> 8) & 0xFF;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue