1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 12:37:44 +00:00

Kernel+LibC: Add registers for AARCH64 in __mcontext

This commit is contained in:
Gunnar Beutner 2022-10-13 10:17:44 +02:00 committed by Linus Groh
parent b7555419f1
commit 70f4d943be
2 changed files with 45 additions and 7 deletions

View file

@ -13,7 +13,39 @@ extern "C" {
#endif #endif
struct __attribute__((packed)) __mcontext { struct __attribute__((packed)) __mcontext {
int stub; uint64_t r0;
uint64_t r1;
uint64_t r2;
uint64_t r3;
uint64_t r4;
uint64_t r5;
uint64_t r6;
uint64_t r7;
uint64_t r8;
uint64_t r9;
uint64_t r10;
uint64_t r11;
uint64_t r12;
uint64_t r13;
uint64_t r14;
uint64_t r15;
uint64_t r16;
uint64_t r17;
uint64_t r18;
uint64_t r19;
uint64_t r20;
uint64_t r21;
uint64_t r22;
uint64_t r23;
uint64_t r24;
uint64_t r25;
uint64_t r26;
uint64_t r27;
uint64_t r28;
uint64_t r29;
uint64_t r30;
uint64_t sp;
uint64_t pc;
}; };
#ifdef __cplusplus #ifdef __cplusplus

View file

@ -25,8 +25,10 @@ struct [[gnu::packed]] PtraceRegisters : public __mcontext {
return eip; return eip;
# elif ARCH(X86_64) # elif ARCH(X86_64)
return rip; return rip;
# elif ARCH(AARCH64)
return pc;
# else # else
TODO_AARCH64(); # error Unknown architecture
# endif # endif
} }
@ -36,9 +38,10 @@ struct [[gnu::packed]] PtraceRegisters : public __mcontext {
eip = ip; eip = ip;
# elif ARCH(X86_64) # elif ARCH(X86_64)
rip = ip; rip = ip;
# elif ARCH(AARCH64)
pc = ip;
# else # else
(void)ip; # error Unknown architecture
TODO_AARCH64();
# endif # endif
} }
@ -48,8 +51,10 @@ struct [[gnu::packed]] PtraceRegisters : public __mcontext {
return ebp; return ebp;
# elif ARCH(X86_64) # elif ARCH(X86_64)
return rbp; return rbp;
# elif ARCH(AARCH64)
return r29;
# else # else
TODO_AARCH64(); # error Unknown architecture
# endif # endif
} }
@ -59,9 +64,10 @@ struct [[gnu::packed]] PtraceRegisters : public __mcontext {
ebp = bp; ebp = bp;
# elif ARCH(X86_64) # elif ARCH(X86_64)
rbp = bp; rbp = bp;
# elif ARCH(AARCH64)
r29 = bp;
# else # else
(void)bp; # error Unknown architecture
TODO_AARCH64();
# endif # endif
} }
# endif # endif