mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 04:39:06 +00:00
Kernel: Add ability to load interpreter instead of main program
When the main executable needs an interpreter, we load the requested interpreter program, and pass to it an open file decsriptor to the main executable via the auxiliary vector. Note that we do not allocate a TLS region for the interpreter.
This commit is contained in:
parent
711c42e25e
commit
5b87904ab5
Notes:
sideshowbarker
2024-07-19 00:52:06 +09:00
Author: https://github.com/itamar8910
Commit: 5b87904ab5
Pull-request: https://github.com/SerenityOS/serenity/pull/3738
Reviewed-by: https://github.com/ADKaster
Reviewed-by: https://github.com/alimpfard
Reviewed-by: https://github.com/awesomekling
6 changed files with 219 additions and 151 deletions
|
@ -1105,6 +1105,10 @@ Vector<FlatPtr> Thread::raw_backtrace(FlatPtr ebp, FlatPtr eip) const
|
|||
|
||||
KResult Thread::make_thread_specific_region(Badge<Process>)
|
||||
{
|
||||
// The process may not require a TLS region
|
||||
if (!process().m_master_tls_region)
|
||||
return KSuccess;
|
||||
|
||||
size_t thread_specific_region_alignment = max(process().m_master_tls_alignment, alignof(ThreadSpecificData));
|
||||
m_thread_specific_region_size = align_up_to(process().m_master_tls_size, thread_specific_region_alignment) + sizeof(ThreadSpecificData);
|
||||
auto* region = process().allocate_region({}, m_thread_specific_region_size, "Thread-specific", PROT_READ | PROT_WRITE, true);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue