summaryrefslogtreecommitdiff
path: root/Kernel/Arch/aarch64
diff options
context:
space:
mode:
authorTimon Kruiper <timonkruiper@gmail.com>2023-04-13 18:47:46 +0200
committerLinus Groh <mail@linusgroh.de>2023-04-13 20:24:25 +0200
commit9ed04bdb33e338d7b3262b7bb41108d2420e20a8 (patch)
tree3bb591dd358923f9453dadc57254c42ced2d7440 /Kernel/Arch/aarch64
parent4927eb53968c637651459e29c198d6d194f14952 (diff)
downloadserenity-9ed04bdb33e338d7b3262b7bb41108d2420e20a8.zip
Kernel/aarch64: Add implementation of Processor::for_each
Diffstat (limited to 'Kernel/Arch/aarch64')
-rw-r--r--Kernel/Arch/aarch64/Processor.h13
1 files changed, 9 insertions, 4 deletions
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<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()