mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
Kernel+LibPthread: Add support for usermode threads on x86_64
This commit is contained in:
committed by
Andreas Kling
parent
93c741018e
commit
16b9a2d2e1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user