kern: implement KProcess::Run

This commit is contained in:
Michael Scire
2020-02-19 19:38:20 -08:00
parent 28ea0b12a8
commit c568788609
25 changed files with 516 additions and 33 deletions

View File

@@ -137,6 +137,12 @@ namespace ams::kern::arch::arm64 {
return ResultSuccess();
}
void KThreadContext::SetArguments(uintptr_t arg0, uintptr_t arg1) {
u64 *stack = reinterpret_cast<u64 *>(this->sp);
stack[0] = arg0;
stack[1] = arg1;
}
void KThreadContext::FpuContextSwitchHandler(KThread *thread) {
MESOSPHERE_ASSERT(!KInterruptManager::AreInterruptsEnabled());
MESOSPHERE_ASSERT(!IsFpuEnabled());
@@ -148,9 +154,9 @@ namespace ams::kern::arch::arm64 {
KProcess *process = thread->GetOwnerProcess();
MESOSPHERE_ASSERT(process != nullptr);
if (process->Is64Bit()) {
RestoreFpuRegisters64(*thread->GetContext());
RestoreFpuRegisters64(thread->GetContext());
} else {
RestoreFpuRegisters32(*thread->GetContext());
RestoreFpuRegisters32(thread->GetContext());
}
}