xiaoxiang781216 commented on code in PR #16892:
URL: https://github.com/apache/nuttx/pull/16892#discussion_r2297450527


##########
arch/arm/src/armv8-r/arm_doirq.c:
##########
@@ -113,14 +113,25 @@ uint32_t *arm_doirq(int irq, uint32_t *regs)
 
 void up_irqinitialize(void)
 {
-  /* The following operations need to be atomic, but since this function is
-   * called early in the initialization sequence, we expect to have exclusive
-   * access to the GIC.
-   */
+#ifdef CONFIG_SMP
+  if (up_cpu_index() == 0)
+    {
+#endif
+      /* Initialize GICD、GICRD and GIC cpu interface for cpu0  */
 
-  /* Initialize the Generic Interrupt Controller (GIC) for CPU0 */
+      arm_gic_initialize();
+#ifdef CONFIG_SMP
+      gicd_ready = 1;
+    }
+  else
+    {
+      /* For other CPUs, we will only initialize GICRD and
+       * GIC cpu interface.
+       */
 
-  arm_gic_initialize();   /* Initialization common to all CPUs */
+      arm_gic_secondary_init();

Review Comment:
   but up_irqinitialize is designed to be called on primary cpu, other cpu 
should call arm_gic_secondary_init directly. Please search how 
arm64_gic_secondary_init get called.



-- 
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: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to