1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 01:17:34 +00:00

Kernel: Add support for setting up a x86_64 GDT once in C++ land

This commit is contained in:
Gunnar Beutner 2021-06-25 14:34:04 +02:00 committed by Andreas Kling
parent 29d9666e02
commit f630299d49
5 changed files with 55 additions and 11 deletions

View file

@ -607,9 +607,13 @@ KResultOr<FlatPtr> Process::sys$allocate_tls(Userspace<const char*> initial_data
if (tsr_result.is_error())
return EFAULT;
#if ARCH(I386)
auto& tls_descriptor = Processor::current().get_gdt_entry(GDT_SELECTOR_TLS);
tls_descriptor.set_base(main_thread->thread_specific_data());
tls_descriptor.set_limit(main_thread->thread_specific_region_size());
#else
TODO();
#endif
return m_master_tls_region.unsafe_ptr()->vaddr().get();
}