mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 02:45:07 +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);
|
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);
|
REQUIRE_PROMISE(thread);
|
||||||
if (!validate_read((const void*)entry, sizeof(void*)))
|
if (!validate_read((const void*)entry, sizeof(void*)))
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
|
|
||||||
if (!validate_read_typed(params))
|
if (!validate_read_typed(user_params))
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
|
|
||||||
stac();
|
Syscall::SC_create_thread_params params;
|
||||||
unsigned detach_state = params->m_detach_state;
|
copy_from_user(¶ms, user_params);
|
||||||
int schedule_priority = params->m_schedule_priority;
|
|
||||||
void* stack_location = params->m_stack_location;
|
unsigned detach_state = params.m_detach_state;
|
||||||
unsigned stack_size = params->m_stack_size;
|
int schedule_priority = params.m_schedule_priority;
|
||||||
clac();
|
void* stack_location = params.m_stack_location;
|
||||||
|
unsigned stack_size = params.m_stack_size;
|
||||||
|
|
||||||
if (!validate_write(stack_location, stack_size))
|
if (!validate_write(stack_location, stack_size))
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue