mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 22:47:45 +00:00
Kernel: Add initial implementation of Processor in aarch64
Instead of storing the current Processor into a core local register, we currently just store it into a global, since we don't support SMP for aarch64 anyway. This simplifies the initial implementation.
This commit is contained in:
parent
ed4bfaed12
commit
c515e1341a
4 changed files with 57 additions and 14 deletions
|
@ -22,6 +22,7 @@ class PageDirectory;
|
|||
};
|
||||
|
||||
class Thread;
|
||||
class Processor;
|
||||
|
||||
// FIXME This needs to go behind some sort of platform abstraction
|
||||
// it is used between Thread and Processor.
|
||||
|
@ -30,8 +31,13 @@ struct [[gnu::aligned(16)]] FPUState
|
|||
u8 buffer[512];
|
||||
};
|
||||
|
||||
// FIXME: Remove this once we support SMP in aarch64
|
||||
extern Processor* g_current_processor;
|
||||
|
||||
class Processor {
|
||||
public:
|
||||
void initialize(u32 cpu);
|
||||
|
||||
void set_specific(ProcessorSpecificDataID /*specific_id*/, void* /*ptr*/)
|
||||
{
|
||||
VERIFY_NOT_REACHED();
|
||||
|
@ -79,9 +85,9 @@ public:
|
|||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
// FIXME: When aarch64 supports multiple cores, return the correct core id here.
|
||||
ALWAYS_INLINE static u32 current_id()
|
||||
{
|
||||
VERIFY_NOT_REACHED();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -127,7 +133,10 @@ public:
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
ALWAYS_INLINE static Processor& current() { VERIFY_NOT_REACHED(); }
|
||||
ALWAYS_INLINE static Processor& current()
|
||||
{
|
||||
return *g_current_processor;
|
||||
}
|
||||
|
||||
static void deferred_call_queue(Function<void()> /* callback */)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue