kern: SvcGetLastThreadInfo, SvcGetDebugFutureThreadInfo

This commit is contained in:
Michael Scire
2020-07-30 16:31:58 -07:00
committed by SciresM
parent 0993ae0685
commit 51084c0837
13 changed files with 325 additions and 18 deletions

View File

@@ -26,6 +26,22 @@ namespace ams::kern::arch::arm64 {
u32 write;
u64 tpidr;
u64 reserved;
constexpr void GetSvcThreadContext(ams::svc::LastThreadContext *out) const {
if ((this->psr & 0x10) == 0) {
/* aarch64 thread. */
out->fp = this->x[29];
out->sp = this->sp;
out->lr = this->x[30];
out->pc = this->pc;
} else {
/* aarch32 thread. */
out->fp = this->x[11];
out->sp = this->x[13];
out->lr = this->x[14];
out->pc = this->pc;
}
}
};
static_assert(sizeof(KExceptionContext) == 0x120);