kern: implement SvcCreateThread, SvcStartThread

This commit is contained in:
Michael Scire
2020-07-09 18:54:09 -07:00
parent 9503aae522
commit 7f4c6ae9e7
5 changed files with 95 additions and 6 deletions

View File

@@ -173,4 +173,19 @@ namespace ams::kern::arch::arm64 {
}
}
void KThreadContext::CloneFpuStatus() {
u64 pcr, psr;
cpu::InstructionMemoryBarrier();
if (IsFpuEnabled()) {
__asm__ __volatile__("mrs %[pcr], fpcr" : [pcr]"=r"(pcr) :: "memory");
__asm__ __volatile__("mrs %[psr], fpsr" : [psr]"=r"(psr) :: "memory");
} else {
pcr = GetCurrentThread().GetContext().GetFpcr();
psr = GetCurrentThread().GetContext().GetFpsr();
}
this->SetFpcr(pcr);
this->SetFpsr(psr);
}
}