mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 13:36:13 +03:00
Kernel: Disable __thread and TLS on x86_64 for now
They're not yet properly supported.
This commit is contained in:
parent
c0bd2c0691
commit
fe2716df21
Notes:
sideshowbarker
2024-07-18 11:12:22 +09:00
Author: https://github.com/gunnarbeutner Commit: https://github.com/SerenityOS/serenity/commit/fe2716df216 Pull-request: https://github.com/SerenityOS/serenity/pull/8333
@ -93,6 +93,11 @@ set(CMAKE_CXX_STANDARD 20)
|
|||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||||
|
|
||||||
|
if("${SERENITY_ARCH}" STREQUAL "x86_64")
|
||||||
|
# FIXME: Implement TLS support and get rid of this
|
||||||
|
add_compile_definitions(NO_TLS X86_64_NO_TLS)
|
||||||
|
endif()
|
||||||
|
|
||||||
add_compile_options(-Wno-literal-suffix)
|
add_compile_options(-Wno-literal-suffix)
|
||||||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||||
add_compile_options(-fconcepts)
|
add_compile_options(-fconcepts)
|
||||||
|
@ -612,7 +612,7 @@ KResultOr<FlatPtr> Process::sys$allocate_tls(Userspace<const char*> initial_data
|
|||||||
tls_descriptor.set_base(main_thread->thread_specific_data());
|
tls_descriptor.set_base(main_thread->thread_specific_data());
|
||||||
tls_descriptor.set_limit(main_thread->thread_specific_region_size());
|
tls_descriptor.set_limit(main_thread->thread_specific_region_size());
|
||||||
#else
|
#else
|
||||||
TODO();
|
dbgln("FIXME: Not setting FS_BASE for process.");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return m_master_tls_region.unsafe_ptr()->vaddr().get();
|
return m_master_tls_region.unsafe_ptr()->vaddr().get();
|
||||||
|
@ -26,7 +26,10 @@ struct SpecificTable {
|
|||||||
|
|
||||||
static KeyTable s_keys;
|
static KeyTable s_keys;
|
||||||
|
|
||||||
__thread SpecificTable t_specifics;
|
# ifndef X86_64_NO_TLS
|
||||||
|
__thread
|
||||||
|
# endif
|
||||||
|
SpecificTable t_specifics;
|
||||||
|
|
||||||
int __pthread_key_create(pthread_key_t* key, KeyDestructor destructor)
|
int __pthread_key_create(pthread_key_t* key, KeyDestructor destructor)
|
||||||
{
|
{
|
||||||
|
@ -11,8 +11,16 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
// FIXME: use thread_local and a String once TLS works
|
// FIXME: use thread_local and a String once TLS works
|
||||||
__thread char* s_dlerror_text = NULL;
|
#ifndef X86_64_NO_TLS
|
||||||
__thread bool s_dlerror_retrieved = false;
|
__thread
|
||||||
|
#endif
|
||||||
|
char* s_dlerror_text
|
||||||
|
= NULL;
|
||||||
|
#ifndef X86_64_NO_TLS
|
||||||
|
__thread
|
||||||
|
#endif
|
||||||
|
bool s_dlerror_retrieved
|
||||||
|
= false;
|
||||||
|
|
||||||
static void store_error(const String& error)
|
static void store_error(const String& error)
|
||||||
{
|
{
|
||||||
|
@ -33,8 +33,14 @@ static constexpr size_t required_stack_alignment = 4 * MiB;
|
|||||||
static constexpr size_t highest_reasonable_guard_size = 32 * PAGE_SIZE;
|
static constexpr size_t highest_reasonable_guard_size = 32 * PAGE_SIZE;
|
||||||
static constexpr size_t highest_reasonable_stack_size = 8 * MiB; // That's the default in Ubuntu?
|
static constexpr size_t highest_reasonable_stack_size = 8 * MiB; // That's the default in Ubuntu?
|
||||||
|
|
||||||
__thread void* s_stack_location;
|
#ifndef X86_64_NO_TLS
|
||||||
__thread size_t s_stack_size;
|
__thread
|
||||||
|
#endif
|
||||||
|
void* s_stack_location;
|
||||||
|
#ifndef X86_64_NO_TLS
|
||||||
|
__thread
|
||||||
|
#endif
|
||||||
|
size_t s_stack_size;
|
||||||
|
|
||||||
#define __RETURN_PTHREAD_ERROR(rc) \
|
#define __RETURN_PTHREAD_ERROR(rc) \
|
||||||
return ((rc) < 0 ? -(rc) : 0)
|
return ((rc) < 0 ? -(rc) : 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user