diff options
author | Andreas Kling <kling@serenityos.org> | 2020-01-20 13:38:31 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-01-20 13:41:21 +0100 |
commit | e901a3695ac733c97d72abac07d5a6dccfd60c6a (patch) | |
tree | f12e470b6842ac2aa2f58aa0d8cf37281b78e0d3 /Kernel/Thread.cpp | |
parent | d5426fcc888df700ff356009bb685a5b397f4361 (diff) | |
download | serenity-e901a3695ac733c97d72abac07d5a6dccfd60c6a.zip |
Kernel: Use the templated copy_to/from_user() in more places
These ensure that the "to" and "from" pointers have the same type,
and also that we copy the correct number of bytes.
Diffstat (limited to 'Kernel/Thread.cpp')
-rw-r--r-- | Kernel/Thread.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Kernel/Thread.cpp b/Kernel/Thread.cpp index 838fa78d78..048182812d 100644 --- a/Kernel/Thread.cpp +++ b/Kernel/Thread.cpp @@ -459,7 +459,7 @@ bool Thread::has_signal_handler(u8 signal) const static void push_value_on_user_stack(u32* stack, u32 data) { *stack -= 4; - copy_to_user((u32*)*stack, &data, sizeof(u32)); + copy_to_user((u32*)*stack, &data); } ShouldUnblockThread Thread::dispatch_signal(u8 signal) @@ -601,11 +601,11 @@ void Thread::set_default_signal_dispositions() m_signal_action_data[SIGWINCH].handler_or_sigaction = VirtualAddress(SIG_IGN); } -void Thread::push_value_on_stack(u32 value) +void Thread::push_value_on_stack(uintptr_t value) { m_tss.esp -= 4; - u32* stack_ptr = (u32*)m_tss.esp; - copy_to_user(stack_ptr, &value, sizeof(value)); + uintptr_t* stack_ptr = (uintptr_t*)m_tss.esp; + copy_to_user(stack_ptr, &value); } RegisterDump& Thread::get_register_dump_from_stack() |