mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 04:47:35 +00:00
Kernel: Factor out setting Thread entry function
This adds ThreadRegisters::set_entry_function, and also implements it for aarch64.
This commit is contained in:
parent
a6f78b895f
commit
1da84c2a2c
3 changed files with 13 additions and 9 deletions
|
@ -25,6 +25,12 @@ struct ThreadRegisters {
|
|||
{
|
||||
set_sp(kernel_stack_top);
|
||||
}
|
||||
|
||||
void set_entry_function(FlatPtr entry_ip, FlatPtr entry_data)
|
||||
{
|
||||
set_ip(entry_ip);
|
||||
x[0] = entry_data;
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -73,6 +73,12 @@ struct ThreadRegisters {
|
|||
set_sp0(kernel_stack_top);
|
||||
}
|
||||
}
|
||||
|
||||
void set_entry_function(FlatPtr entry_ip, FlatPtr entry_data)
|
||||
{
|
||||
set_ip(entry_ip);
|
||||
rdi = entry_data; // entry function argument is expected to be in regs.rdi
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue