mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 19:38:12 +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
|
@ -566,10 +566,7 @@ ErrorOr<FlatPtr> Process::sys$allocate_tls(Userspace<char const*> initial_data,
|
|||
|
||||
TRY(main_thread->make_thread_specific_region({}));
|
||||
|
||||
#if ARCH(X86_64)
|
||||
MSR fs_base_msr(MSR_FS_BASE);
|
||||
fs_base_msr.set(main_thread->thread_specific_data().get());
|
||||
#endif
|
||||
Processor::set_thread_specific_data(main_thread->thread_specific_data());
|
||||
|
||||
return m_master_tls_region.unsafe_ptr()->vaddr().get();
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue