ladybird/Kernel/Arch
Sönke Holz 243d7003a2 Kernel+LibC+LibELF: Move TLS handling to userspace
This removes the allocate_tls syscall and adds an archctl option to set
the fs_base for the current thread on x86-64, since you can't set that
register from userspace. enter_thread_context loads the fs_base for the
next thread on each context switch.
This also moves tpidr_el0 (the thread pointer register on AArch64) to
the register state, so it gets properly saved/restored on context
switches.

The userspace TLS allocation code is kept pretty similar to the original
kernel TLS code, aside from a couple of style changes.

We also have to add a new argument "tls_pointer" to
SC_create_thread_params, as we otherwise can't prevent race conditions
between setting the thread pointer register and signal handling code
that might be triggered before the thread pointer was set, which could
use TLS.
2024-04-19 16:46:47 -06:00
..
aarch64 Kernel+LibC+LibELF: Move TLS handling to userspace 2024-04-19 16:46:47 -06:00
riscv64 Kernel+LibC+LibELF: Move TLS handling to userspace 2024-04-19 16:46:47 -06:00
x86_64 Kernel+LibC+LibELF: Move TLS handling to userspace 2024-04-19 16:46:47 -06:00
ArchSpecificThreadData.h Kernel: Add a Thread member for arch-specific data 2024-04-19 16:46:47 -06:00
CPU.h Kernel/riscv64: Make the kernel compile 2023-11-10 15:51:31 -07:00
CPUID.h Kernel/riscv64: Add RISC-V Processor class 2023-10-28 10:36:06 -06:00
CurrentTime.h Kernel: Abstract platform-specific current time methods from Scheduler 2022-10-14 14:13:51 +02:00
DebugOutput.h Kernel: Abstract platform-specific serial port access from kprintf 2022-09-20 18:43:05 +01:00
DeferredCallEntry.h Kernel: Extract DeferredCallEntry from Arch/Processor.h 2021-12-11 13:23:27 -08:00
DeferredCallPool.cpp Kernel: Move deferred call code into separate DeferredCallPool class 2023-04-03 20:01:28 -06:00
DeferredCallPool.h Kernel: Move deferred call code into separate DeferredCallPool class 2023-04-03 20:01:28 -06:00
Delay.h Kernel: Move IO delay code to x86 architecture subdirectory 2022-09-20 18:43:05 +01:00
FPUState.h Kernel/riscv64: Add register state related headers 2023-10-28 10:36:06 -06:00
init.cpp Kernel: Exclude individual functions from coverage instrumentation 2024-04-15 21:16:22 -06:00
InterruptManagement.h Kernel/riscv64: Make the kernel compile 2023-11-10 15:51:31 -07:00
Interrupts.h Kernel/riscv64: Make the kernel compile 2023-11-10 15:51:31 -07:00
IRQController.h Kernel/riscv64: Make the kernel compile 2023-11-10 15:51:31 -07:00
mcontext.h Toolchain: Add (basic) support for riscv64 2023-08-11 09:20:08 +02:00
PageDirectory.h Kernel/riscv64: Make the kernel compile 2023-11-10 15:51:31 -07:00
PageFault.cpp Kernel/riscv64: Don't hard-code the page fault reason on RISC-V 2024-03-25 14:18:38 -06:00
PageFault.h Kernel/riscv64: Don't hard-code the page fault reason on RISC-V 2024-03-25 14:18:38 -06:00
PCIMSI.h Kernel/riscv64: Make the kernel compile 2023-11-10 15:51:31 -07:00
PowerState.h Kernel: Simplify reboot & poweroff code flow a bit 2023-06-27 20:04:42 +02:00
Processor.cpp Kernel: Share Processor class (and others) across architectures 2023-10-03 16:08:29 -06:00
Processor.h Kernel+LibC+LibELF: Move TLS handling to userspace 2024-04-19 16:46:47 -06:00
ProcessorFunctions.include Kernel+LibC+LibELF: Move TLS handling to userspace 2024-04-19 16:46:47 -06:00
ProcessorSpecificDataID.h Kernel: Extract ProcessorSpecificDataID from from Arch/Processor.h 2021-12-11 13:23:27 -08:00
RegisterState.h Kernel/riscv64: Add register state related headers 2023-10-28 10:36:06 -06:00
SafeMem.h Everywhere: Fix order of includes and #pragma once 2022-09-18 18:30:05 -07:00
SmapDisabler.h Everywhere: Use east const in more places 2024-04-19 06:31:19 -04:00
ThreadRegisters.h Kernel/riscv64: Add register state related headers 2023-10-28 10:36:06 -06:00
TrapFrame.cpp Kernel: Share Processor class (and others) across architectures 2023-10-03 16:08:29 -06:00
TrapFrame.h Kernel/riscv64: Add register state related headers 2023-10-28 10:36:06 -06:00