From 9ed04bdb33e338d7b3262b7bb41108d2420e20a8 Mon Sep 17 00:00:00 2001 From: Timon Kruiper Date: Thu, 13 Apr 2023 18:47:46 +0200 Subject: Kernel/aarch64: Add implementation of Processor::for_each --- Kernel/Arch/aarch64/Processor.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'Kernel/Arch/aarch64') diff --git a/Kernel/Arch/aarch64/Processor.h b/Kernel/Arch/aarch64/Processor.h index d51b063394..b011411320 100644 --- a/Kernel/Arch/aarch64/Processor.h +++ b/Kernel/Arch/aarch64/Processor.h @@ -230,15 +230,20 @@ public: } template Callback> - static inline IterationDecision for_each(Callback) + static inline IterationDecision for_each(Callback callback) { - TODO_AARCH64(); + // FIXME: Once we support SMP for aarch64, make sure to call the callback for every processor. + if (callback(*g_current_processor) == IterationDecision::Break) + return IterationDecision::Break; + return IterationDecision::Continue; } template Callback> - static inline IterationDecision for_each(Callback) + static inline IterationDecision for_each(Callback callback) { - TODO_AARCH64(); + // FIXME: Once we support SMP for aarch64, make sure to call the callback for every processor. + callback(*g_current_processor); + return IterationDecision::Continue; } static u32 count() -- cgit v1.2.3