interrupt: add a macro to distinguish DSP interrupts

Until now cavs/interrupt.c used to call interrupt_get_parent() where
it had to verify whether an interrupt was a DSP interrupt or a
cascaded one. That function is rather heavy - it takes a spin-lock,
scans a list of all cascading interrupt controllers and checks their
interrupt numbers. Whereas that check can be performed much easier
and faster by simply checking the "level" field of the IRQ token.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
This commit is contained in:
Guennadi Liakhovetski 2019-03-18 15:28:22 +01:00 committed by Liam Girdwood
parent 9d4307fb5a
commit ffc14323f3
2 changed files with 8 additions and 2 deletions

View File

@ -212,13 +212,13 @@ void platform_interrupt_unmask(uint32_t irq)
void platform_interrupt_set(uint32_t irq)
{
if (!platform_irq_get_parent(irq))
if (interrupt_is_dsp_direct(irq))
arch_interrupt_set(SOF_IRQ_NUMBER(irq));
}
void platform_interrupt_clear(uint32_t irq, uint32_t mask)
{
if (!platform_irq_get_parent(irq))
if (interrupt_is_dsp_direct(irq))
arch_interrupt_clear(SOF_IRQ_NUMBER(irq));
}

View File

@ -69,6 +69,12 @@ uint32_t platform_interrupt_get_enabled(void);
void platform_interrupt_mask(uint32_t irq);
void platform_interrupt_unmask(uint32_t irq);
/*
* On platforms, supporting cascading interrupts cascaded interrupt numbers
* have SOF_IRQ_LEVEL(irq) != 0.
*/
#define interrupt_is_dsp_direct(irq) (!SOF_IRQ_LEVEL(irq))
static inline void interrupt_set(int irq)
{
platform_interrupt_set(irq);