[PATCH] bsps/arm: fix off-by-1 in gicv3 processor count
Gedare Bloom
gedare at rtems.org
Wed Aug 4 17:15:18 UTC 2021
---
bsps/shared/dev/irq/arm-gicv3.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/bsps/shared/dev/irq/arm-gicv3.c b/bsps/shared/dev/irq/arm-gicv3.c
index ea123d325e..95021f6ddf 100644
--- a/bsps/shared/dev/irq/arm-gicv3.c
+++ b/bsps/shared/dev/irq/arm-gicv3.c
@@ -551,11 +551,11 @@ uint32_t arm_gic_irq_processor_count(void)
for (i = 0; i < CPU_MAXIMUM_PROCESSORS; ++i) {
volatile gic_redist *redist = gicv3_get_redist(i);
+ ++cpu_count;
+
if ((redist->icrtyper & GIC_REDIST_ICRTYPER_LAST) != 0) {
break;
}
-
- ++cpu_count;
}
}
--
2.25.1
More information about the devel
mailing list