[rtems commit] leon, gptimer: offset intnum with subtimer index

Daniel Hellstrom danielh at rtems.org
Tue May 2 10:38:43 UTC 2017


Module:    rtems
Branch:    master
Commit:    8927c0f8e72a12ee9e325033c0770adc1eed879d
Changeset: http://git.rtems.org/rtems/commit/?id=8927c0f8e72a12ee9e325033c0770adc1eed879d

Author:    Martin Aberg <maberg at gaisler.com>
Date:      Tue Apr 11 13:55:02 2017 +0200

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 229e906..014bd7c 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




More information about the vc mailing list