1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 04:17:34 +00:00

Kernel/aarch64: Implement Processor::pause and Processor::wait_check

For pause we use isb sy which will put the processor to sleep while the
pipeline is being flushed. This instruction is also used by Rust in spin
loops and found to be more efficient, as well as being a rough
equivalent to the x86 pause instruction which we also use here.

For wait_check we use yield, which is a hinted nop that is faster to
execute, and I leave a FIXME for processing SMP messages once we support
SMP.

These two changes probably make spin loops work on aarch64 :^)
This commit is contained in:
kleines Filmröllchen 2022-12-30 13:38:42 +01:00 committed by Andrew Kaster
parent 4d475588bb
commit 984348ed0d

View file

@ -73,11 +73,12 @@ public:
ALWAYS_INLINE static void pause()
{
TODO_AARCH64();
asm volatile("isb sy");
}
ALWAYS_INLINE static void wait_check()
{
TODO_AARCH64();
asm volatile("yield");
// FIXME: Process SMP messages once we support SMP on aarch64; cf. x86_64
}
ALWAYS_INLINE u8 physical_address_bit_width() const