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:
parent
4d475588bb
commit
984348ed0d
1 changed files with 3 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue