Kernel/aarch64: Add implementation of Processor::for_each

This commit is contained in:
Timon Kruiper 2023-04-13 18:47:46 +02:00 committed by Linus Groh
parent 4927eb5396
commit 9ed04bdb33
Notes: sideshowbarker 2024-07-17 00:23:42 +09:00

View File

@ -230,15 +230,20 @@ public:
}
template<IteratorFunction<Processor&> 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<VoidFunction<Processor&> 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()