mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 20:29:18 +00:00
Kernel+LibPthread: Add support for usermode threads on x86_64
This commit is contained in:
parent
93c741018e
commit
16b9a2d2e1
Notes:
sideshowbarker
2024-07-18 11:10:05 +09:00
Author: https://github.com/gunnarbeutner
Commit: 16b9a2d2e1
Pull-request: https://github.com/SerenityOS/serenity/pull/8364
3 changed files with 21 additions and 8 deletions
|
@ -71,10 +71,17 @@ static int create_thread(pthread_t* thread, void* (*entry)(void*), void* argumen
|
|||
while (((uintptr_t)stack - 16) % 16 != 0)
|
||||
push_on_stack(nullptr);
|
||||
|
||||
#if ARCH(I386)
|
||||
push_on_stack((void*)(uintptr_t)thread_params->stack_size);
|
||||
push_on_stack(thread_params->stack_location);
|
||||
push_on_stack(argument);
|
||||
push_on_stack((void*)entry);
|
||||
#else
|
||||
thread_params->rdi = (FlatPtr)entry;
|
||||
thread_params->rsi = (FlatPtr)argument;
|
||||
thread_params->rdx = (FlatPtr)thread_params->stack_location;
|
||||
thread_params->rcx = thread_params->stack_size;
|
||||
#endif
|
||||
VERIFY((uintptr_t)stack % 16 == 0);
|
||||
|
||||
// Push a fake return address
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue