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


##########
arch/arm/src/armv8-r/arm_gicv3.c:
##########
@@ -279,6 +279,68 @@ bool arm_gic_irq_is_enabled(unsigned int intid)
   return (val & mask) != 0;
 }
 
+#ifdef CONFIG_ARCH_HIPRI_INTERRUPT
+void arm_gic_set_group(unsigned int intid, unsigned int group)
+{
+  uint32_t mask = BIT(intid & (GIC_NUM_INTR_PER_REG - 1));
+  uint32_t idx  = intid / GIC_NUM_INTR_PER_REG;
+  unsigned long base = GET_DIST_BASE(intid);
+  uint32_t igroupr_val;
+  uint32_t igroupmodr_val;
+
+  igroupr_val = getreg32(IGROUPR(base, idx));
+  igroupmodr_val = getreg32(IGROUPMODR(base, idx));
+  if (group == 0)
+    {
+      igroupr_val &= ~mask;
+      igroupmodr_val &= ~mask;
+    }
+  else
+    {
+      igroupr_val |= mask;
+      igroupmodr_val |= mask;
+    }
+
+  putreg32(igroupr_val, IGROUPR(base, idx));
+  putreg32(igroupmodr_val, IGROUPMODR(base, idx));
+}
+
+unsigned int arm_gic_get_active_group0(void)

Review Comment:
   static



##########
arch/arm/src/armv8-r/arm_gicv3.c:
##########
@@ -279,6 +279,68 @@ bool arm_gic_irq_is_enabled(unsigned int intid)
   return (val & mask) != 0;
 }
 
+#ifdef CONFIG_ARCH_HIPRI_INTERRUPT
+void arm_gic_set_group(unsigned int intid, unsigned int group)
+{
+  uint32_t mask = BIT(intid & (GIC_NUM_INTR_PER_REG - 1));
+  uint32_t idx  = intid / GIC_NUM_INTR_PER_REG;
+  unsigned long base = GET_DIST_BASE(intid);
+  uint32_t igroupr_val;
+  uint32_t igroupmodr_val;
+
+  igroupr_val = getreg32(IGROUPR(base, idx));
+  igroupmodr_val = getreg32(IGROUPMODR(base, idx));
+  if (group == 0)
+    {
+      igroupr_val &= ~mask;
+      igroupmodr_val &= ~mask;
+    }
+  else
+    {
+      igroupr_val |= mask;
+      igroupmodr_val |= mask;
+    }
+
+  putreg32(igroupr_val, IGROUPR(base, idx));
+  putreg32(igroupmodr_val, IGROUPMODR(base, idx));
+}
+
+unsigned int arm_gic_get_active_group0(void)
+{
+  int intid;
+
+  /* (Pending -> Active / AP) or (AP -> AP)
+   * Read a Group 0 INTID on an interrupt acknowledge.
+   */
+
+  intid = CP15_GET(ICC_IAR0);
+
+  return intid;
+}
+
+void arm_gic_eoi_group0(unsigned int intid)

Review Comment:
   static



##########
arch/arm/src/armv8-r/arm_gicv3.c:
##########
@@ -676,11 +753,56 @@ void up_trigger_irq(int irq, cpu_set_t cpuset)
     }
 }
 
+#ifdef CONFIG_ARCH_HIPRI_INTERRUPT
+/***************************************************************************
+ * Name: arm_decodefiq
+ *
+ * Description:
+ *   This function is called from the FIQ vector handler in arm_vectors.S.
+ *   At this point, the interrupt has been taken and the registers have
+ *   been saved on the stack.  This function simply needs to determine the
+ *   the irq number of the interrupt and then to call arm_dofiq to dispatch
+ *   the interrupt.
+ *
+ *  Input Parameters:
+ *   regs - A pointer to the register save area on the stack.
+ ***************************************************************************/
+
+uint32_t * arm_decodefiq(uint32_t * regs)

Review Comment:
   ```suggestion
   uint32_t *arm_decodefiq(uint32_t *regs)
   ```



-- 
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