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:
Jaron Kelleher 2020-03-20 11:24:39 -07:00 committed by Andrew Boie
commit 0fb4382164
3 changed files with 132 additions and 3 deletions

View file

@ -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
/**