mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
Kernel/aarch64: Store a pointer to the current Thread on Processor
And also implemented and update the related functions.
This commit is contained in:
parent
8fe3c50b30
commit
a998bba73b
Notes:
sideshowbarker
2024-07-17 07:25:39 +09:00
Author: https://github.com/FireFox317 Commit: https://github.com/SerenityOS/serenity/commit/a998bba73b Pull-request: https://github.com/SerenityOS/serenity/pull/15714 Reviewed-by: https://github.com/gunnarbeutner
1 changed files with 4 additions and 7 deletions
|
@ -111,11 +111,9 @@ public:
|
|||
m_idle_thread = &idle_thread;
|
||||
}
|
||||
|
||||
// FIXME: Actually return the current thread once aarch64 supports threading.
|
||||
ALWAYS_INLINE static Thread* current_thread()
|
||||
{
|
||||
static Thread* current_thread { nullptr };
|
||||
return current_thread;
|
||||
return current().m_current_thread;
|
||||
}
|
||||
|
||||
ALWAYS_INLINE bool has_nx() const
|
||||
|
@ -204,14 +202,12 @@ public:
|
|||
|
||||
ALWAYS_INLINE static void set_current_thread(Thread& current_thread)
|
||||
{
|
||||
(void)current_thread;
|
||||
TODO_AARCH64();
|
||||
current().m_current_thread = ¤t_thread;
|
||||
}
|
||||
|
||||
// FIXME: Actually return the idle thread once aarch64 supports threading.
|
||||
ALWAYS_INLINE static Thread* idle_thread()
|
||||
{
|
||||
return nullptr;
|
||||
return current().m_idle_thread;
|
||||
}
|
||||
|
||||
ALWAYS_INLINE static Processor& current()
|
||||
|
@ -241,6 +237,7 @@ public:
|
|||
static ErrorOr<Vector<FlatPtr, 32>> capture_stack_trace(Thread& thread, size_t max_frames = 0);
|
||||
|
||||
private:
|
||||
Thread* m_current_thread;
|
||||
Thread* m_idle_thread;
|
||||
u32 m_in_critical { 0 };
|
||||
|
||||
|
|
Loading…
Reference in a new issue