mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:37:35 +00:00
Kernel/aarch64: Implement Thread Local Storage
This commit adds Processor::set_thread_specific_data, and this function is used to factor out architecture specific implementation of setting the thread specific data. This function is implemented for aarch64 and x86_64, and the callsites are changed to use this function instead.
This commit is contained in:
parent
7d0917f50b
commit
cfd73e5d9f
6 changed files with 24 additions and 6 deletions
|
@ -454,6 +454,8 @@ extern "C" void enter_thread_context(Thread* from_thread, Thread* to_thread)
|
|||
|
||||
to_thread->set_cpu(Processor::current().id());
|
||||
|
||||
Processor::set_thread_specific_data(to_thread->thread_specific_data());
|
||||
|
||||
auto in_critical = to_thread->saved_critical();
|
||||
VERIFY(in_critical > 0);
|
||||
Processor::restore_critical(in_critical);
|
||||
|
@ -466,4 +468,9 @@ StringView Processor::platform_string()
|
|||
return "aarch64"sv;
|
||||
}
|
||||
|
||||
void Processor::set_thread_specific_data(VirtualAddress thread_specific_data)
|
||||
{
|
||||
Aarch64::Asm::set_tpidr_el0(thread_specific_data.get());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue