zhangyu-duck commented on code in PR #21504:
URL: https://github.com/apache/nuttx/pull/21504#discussion_r4510053955


##########
arch/tricore/src/common/tricore_irq.c:
##########
@@ -105,36 +120,23 @@ static int g_irqmap_count = 1;
 
 static void tricore_gpsrinitialize(void)
 {
-  volatile Ifx_SRC_SRCR *src;
-  int cpu_idx;
+  int cpu = up_cpu_index();
   int i;
 
-  cpu_idx = up_cpu_index();
-  src = &SRC_GPSR00 + cpu_idx;
-
   /* Cpux gpsr init */
 
   for (i = 0; i < 6; i++)
     {
-#ifdef CONFIG_ARCH_CHIP_TC3XX
-      IfxSrc_init(src, g_tricore_tos[cpu_idx],
-                  IRQ_TO_NDX(TRICORE_SRC2IRQ(src)));
-#else
-      IfxSrc_init(src, g_tricore_tos[cpu_idx],
-                  IRQ_TO_NDX(TRICORE_SRC2IRQ(src)),
-                  IfxSrc_VmId_none);
-#endif
+      int irq = TRICORE_GPSR_IRQNUM(i, cpu);
 
-      src += TRICORE_SRCNUM_PER_GPSR;
+      tricore_src_init(TRICORE_SRC(irq), cpu, IRQ_TO_NDX(irq));

Review Comment:
   TRICORE_SRC_TOS_CPU, but you have not use them, does it right?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to