mirror of
https://github.com/RGBCube/serenity
synced 2025-05-25 22:45:06 +00:00
Kernel: Remove manual STAC/CLAC in create_thread()
This commit is contained in:
parent
a885719af5
commit
955034e86e
1 changed files with 9 additions and 8 deletions
|
@ -3419,21 +3419,22 @@ void Process::send_signal(u8 signal, Process* sender)
|
|||
thread->send_signal(signal, sender);
|
||||
}
|
||||
|
||||
int Process::sys$create_thread(void* (*entry)(void*), void* argument, const Syscall::SC_create_thread_params* params)
|
||||
int Process::sys$create_thread(void* (*entry)(void*), void* argument, const Syscall::SC_create_thread_params* user_params)
|
||||
{
|
||||
REQUIRE_PROMISE(thread);
|
||||
if (!validate_read((const void*)entry, sizeof(void*)))
|
||||
return -EFAULT;
|
||||
|
||||
if (!validate_read_typed(params))
|
||||
if (!validate_read_typed(user_params))
|
||||
return -EFAULT;
|
||||
|
||||
stac();
|
||||
unsigned detach_state = params->m_detach_state;
|
||||
int schedule_priority = params->m_schedule_priority;
|
||||
void* stack_location = params->m_stack_location;
|
||||
unsigned stack_size = params->m_stack_size;
|
||||
clac();
|
||||
Syscall::SC_create_thread_params params;
|
||||
copy_from_user(¶ms, user_params);
|
||||
|
||||
unsigned detach_state = params.m_detach_state;
|
||||
int schedule_priority = params.m_schedule_priority;
|
||||
void* stack_location = params.m_stack_location;
|
||||
unsigned stack_size = params.m_stack_size;
|
||||
|
||||
if (!validate_write(stack_location, stack_size))
|
||||
return -EFAULT;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue