1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 23:07:35 +00:00

Kernel/aarch64: Add getters/setters in RegisterState and ThreadRegisters

Specifically this commit implements two setters set_userspace_sp and
set_ip in RegisterState.h, and also adds a stack pointer getter (sp) in
ThreadRegisters.h. Contributed by konrad, thanks for that.
This commit is contained in:
Timon Kruiper 2023-02-22 19:04:16 +01:00 committed by Idan Horowitz
parent 36362b9679
commit ec765544a5
2 changed files with 3 additions and 4 deletions

View file

@ -24,14 +24,12 @@ struct RegisterState {
FlatPtr userspace_sp() const { return sp_el0; }
void set_userspace_sp(FlatPtr value)
{
(void)value;
TODO_AARCH64();
sp_el0 = value;
}
FlatPtr ip() const { return elr_el1; }
void set_ip(FlatPtr value)
{
(void)value;
TODO_AARCH64();
elr_el1 = value;
}
FlatPtr bp() const { return x[29]; }

View file

@ -22,6 +22,7 @@ struct ThreadRegisters {
FlatPtr ip() const { return elr_el1; }
void set_ip(FlatPtr value) { elr_el1 = value; }
FlatPtr sp() const { return sp_el0; }
void set_sp(FlatPtr value) { sp_el0 = value; }
void set_initial_state(bool is_kernel_process, Memory::AddressSpace& space, FlatPtr kernel_stack_top)