1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 18:17:34 +00:00

Kernel+LibC: Modify aarch64's __mcontext to store registers in an array

This commit also removes the unnecessary ifdefs from
sys/arch/aarch64/regs.h. Contributed by konrad, thanks for that.
This commit is contained in:
Timon Kruiper 2023-02-23 00:00:37 +01:00 committed by Idan Horowitz
parent 7440112cd9
commit 200e91cd7f
2 changed files with 3 additions and 57 deletions

View file

@ -21,46 +21,22 @@ struct [[gnu::packed]] PtraceRegisters : public __mcontext {
# if defined(__cplusplus) && defined(__cpp_concepts)
FlatPtr ip() const
{
# if ARCH(X86_64)
return rip;
# elif ARCH(AARCH64)
return pc;
# else
# error Unknown architecture
# endif
}
void set_ip(FlatPtr ip)
{
# if ARCH(X86_64)
rip = ip;
# elif ARCH(AARCH64)
pc = ip;
# else
# error Unknown architecture
# endif
}
FlatPtr bp() const
{
# if ARCH(X86_64)
return rbp;
# elif ARCH(AARCH64)
return r29;
# else
# error Unknown architecture
# endif
return x[29];
}
void set_bp(FlatPtr bp)
{
# if ARCH(X86_64)
rbp = bp;
# elif ARCH(AARCH64)
r29 = bp;
# else
# error Unknown architecture
# endif
x[29] = bp;
}
# endif
};