summaryrefslogtreecommitdiff
path: root/src/arch/arm64/cpu.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/arm64/cpu.c')
-rw-r--r--src/arch/arm64/cpu.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/arch/arm64/cpu.c b/src/arch/arm64/cpu.c
index eb08735292..cd8dd3820a 100644
--- a/src/arch/arm64/cpu.c
+++ b/src/arch/arm64/cpu.c
@@ -32,6 +32,19 @@ struct cpu_info *cpu_info(void)
return cpu_info_for_cpu(smp_processor_id());
}
+size_t cpus_online(void)
+{
+ int i;
+ size_t num = 0;
+
+ for (i = 0; i < ARRAY_SIZE(cpu_infos); i++) {
+ if (cpu_online(cpu_info_for_cpu(i)))
+ num++;
+ }
+
+ return num;
+}
+
static inline int action_queue_empty(struct cpu_action_queue *q)
{
return load_acquire_exclusive(&q->todo) == NULL;