arch/armv7[a|r]: Implement up_affinity_irq
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
17ac85eb0a
commit
079a6fa6cc
@ -504,6 +504,33 @@ int up_prioritize_irq(int irq, int priority)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_affinity_irq
|
||||
*
|
||||
* Description:
|
||||
* Set an IRQ affinity by software.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_affinity_irq(int irq, cpu_set_t cpuset)
|
||||
{
|
||||
if (irq >= GIC_IRQ_SPI && irq < NR_IRQS)
|
||||
{
|
||||
uintptr_t regaddr;
|
||||
uint32_t regval;
|
||||
|
||||
/* Write the new cpuset to the corresponding field in the in the
|
||||
* distributor Interrupt Processor Target Register (GIC_ICDIPTR).
|
||||
*/
|
||||
|
||||
regaddr = GIC_ICDIPTR(irq);
|
||||
regval = getreg32(regaddr);
|
||||
regval &= ~GIC_ICDIPTR_ID_MASK(irq);
|
||||
regval |= GIC_ICDIPTR_ID(irq, cpuset);
|
||||
putreg32(regval, regaddr);
|
||||
}
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_trigger_irq
|
||||
*
|
||||
|
@ -503,6 +503,33 @@ int up_prioritize_irq(int irq, int priority)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_affinity_irq
|
||||
*
|
||||
* Description:
|
||||
* Set an IRQ affinity by software.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_affinity_irq(int irq, cpu_set_t cpuset)
|
||||
{
|
||||
if (irq >= GIC_IRQ_SPI && irq < NR_IRQS)
|
||||
{
|
||||
uintptr_t regaddr;
|
||||
uint32_t regval;
|
||||
|
||||
/* Write the new cpuset to the corresponding field in the in the
|
||||
* distributor Interrupt Processor Target Register (GIC_ICDIPTR).
|
||||
*/
|
||||
|
||||
regaddr = GIC_ICDIPTR(irq);
|
||||
regval = getreg32(regaddr);
|
||||
regval &= ~GIC_ICDIPTR_ID_MASK(irq);
|
||||
regval |= GIC_ICDIPTR_ID(irq, cpuset);
|
||||
putreg32(regval, regaddr);
|
||||
}
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_trigger_irq
|
||||
*
|
||||
|
@ -1489,6 +1489,18 @@ void up_enable_irq(int irq);
|
||||
void up_disable_irq(int irq);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_affinity_irq
|
||||
*
|
||||
* Description:
|
||||
* Set an IRQ affinity by software.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
void up_affinity_irq(int irq, cpu_set_t cpuset);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_trigger_irq
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user