From 8927c0f8e72a12ee9e325033c0770adc1eed879d Mon Sep 17 00:00:00 2001 From: Martin Aberg Date: Tue, 11 Apr 2017 13:55:02 +0200 Subject: leon, gptimer: offset intnum with subtimer index If separate interrupts are not available, then do not add the timer hardware index number when configuring interrupt affinity. --- c/src/lib/libbsp/sparc/shared/timer/gptimer.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/c/src/lib/libbsp/sparc/shared/timer/gptimer.c b/c/src/lib/libbsp/sparc/shared/timer/gptimer.c index 229e90666d..014bd7cd68 100644 --- a/c/src/lib/libbsp/sparc/shared/timer/gptimer.c +++ b/c/src/lib/libbsp/sparc/shared/timer/gptimer.c @@ -444,7 +444,13 @@ static void gptimer_tlib_irq_reg(struct tlib_dev *hand, tlib_isr_t func, void *d #if RTEMS_SMP if (flags & TLIB_FLAGS_BROADCAST) { - drvmgr_interrupt_set_affinity(priv->dev, timer->tindex, + int tindex = 0; + + if (priv->separate_interrupt) { + /* Offset interrupt number with HW subtimer index */ + tindex = timer->tindex; + } + drvmgr_interrupt_set_affinity(priv->dev, tindex, _SMP_Online_processors); } #endif -- cgit v1.2.3