1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:48:12 +00:00

Kernel: Use Userspace<T> for the exit_thread syscall

Userspace<void*> is a bit strange here, as it would appear to the
user that we intend to de-refrence the pointer in kernel mode.

However I think it does a good join of illustrating that we are
treating the void* as a value type,  instead of a pointer type.
This commit is contained in:
Brian Gianforcaro 2020-08-09 15:45:51 -07:00 committed by Andreas Kling
parent d3847b3489
commit 0e627b0273
3 changed files with 4 additions and 4 deletions

View file

@ -90,12 +90,12 @@ int Process::sys$create_thread(void* (*entry)(void*), Userspace<const Syscall::S
return thread->tid().value();
}
void Process::sys$exit_thread(void* exit_value)
void Process::sys$exit_thread(Userspace<void*> exit_value)
{
REQUIRE_PROMISE(thread);
cli();
auto current_thread = Thread::current();
current_thread->m_exit_value = exit_value;
current_thread->m_exit_value = reinterpret_cast<void*>(exit_value.ptr());
current_thread->set_should_die();
big_lock().force_unlock_if_locked();
current_thread->die_if_needed();