mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 12:38:12 +00:00
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.
This commit is contained in:
parent
d5426fcc88
commit
e901a3695a
3 changed files with 21 additions and 21 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue