wangchdo commented on code in PR #16892:
URL: https://github.com/apache/nuttx/pull/16892#discussion_r2297001218
##########
arch/arm/src/armv8-r/arm_doirq.c:
##########
@@ -113,14 +113,32 @@ 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
+ static volatile uint32_t gicd_ready = 0;
+
+ if (up_cpu_index() == 0)
+ {
+#endif
+ /* Initialize GICDăGICRD and GIC cpu interface for cpu0 */
+
+ arm_gic_initialize();
+#ifdef CONFIG_SMP
+ gicd_ready = 1;
+ }
+ else
+ {
+ /* For other CPUs, we will only initialize GICRD and
+ * GIC cpu interface.
+ */
- /* Initialize the Generic Interrupt Controller (GIC) for CPU0 */
+ while (gicd_ready == 0)
Review Comment:
Yes, for this general problem, I think, on the one hand, app should take
care of the app specific global variable and shared resource init sequence and
sync in multicore system.
On the other hand, for other global variables or shared resource in
multicore system, i would call them default one, not app specific, they should
be initialzed by system, before any app starts, like bss clear or data copy,
and it is the system that should take care of their initialzaiton sequence or
sync . I think GIC is this kind of shared resource
--
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]