summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel
diff options
context:
space:
mode:
authorbunnei <ericbunnie@gmail.com>2014-05-21 00:50:16 +0200
committerbunnei <ericbunnie@gmail.com>2014-05-21 00:50:16 +0200
commit49dc2ce8ac4fc37a008fa28e0771c8c74c576b05 (patch)
tree1640b629267273cb6afe73e7923833072ad55d7d /src/core/hle/kernel
parentrenamed "syscall" module to "svc" (more accurate naming) (diff)
downloadyuzu-49dc2ce8ac4fc37a008fa28e0771c8c74c576b05.tar
yuzu-49dc2ce8ac4fc37a008fa28e0771c8c74c576b05.tar.gz
yuzu-49dc2ce8ac4fc37a008fa28e0771c8c74c576b05.tar.bz2
yuzu-49dc2ce8ac4fc37a008fa28e0771c8c74c576b05.tar.lz
yuzu-49dc2ce8ac4fc37a008fa28e0771c8c74c576b05.tar.xz
yuzu-49dc2ce8ac4fc37a008fa28e0771c8c74c576b05.tar.zst
yuzu-49dc2ce8ac4fc37a008fa28e0771c8c74c576b05.zip
Diffstat (limited to 'src/core/hle/kernel')
-rw-r--r--src/core/hle/kernel/thread.cpp38
1 files changed, 2 insertions, 36 deletions
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp
index 136fff021..b3d306c53 100644
--- a/src/core/hle/kernel/thread.cpp
+++ b/src/core/hle/kernel/thread.cpp
@@ -98,46 +98,12 @@ inline void __SetCurrentThread(Thread* t) {
/// Saves the current CPU context
void __KernelSaveContext(ThreadContext& ctx) {
- ctx.cpu_registers[0] = Core::g_app_core->GetReg(0);
- ctx.cpu_registers[1] = Core::g_app_core->GetReg(1);
- ctx.cpu_registers[2] = Core::g_app_core->GetReg(2);
- ctx.cpu_registers[3] = Core::g_app_core->GetReg(3);
- ctx.cpu_registers[4] = Core::g_app_core->GetReg(4);
- ctx.cpu_registers[5] = Core::g_app_core->GetReg(5);
- ctx.cpu_registers[6] = Core::g_app_core->GetReg(6);
- ctx.cpu_registers[7] = Core::g_app_core->GetReg(7);
- ctx.cpu_registers[8] = Core::g_app_core->GetReg(8);
- ctx.cpu_registers[9] = Core::g_app_core->GetReg(9);
- ctx.cpu_registers[10] = Core::g_app_core->GetReg(10);
- ctx.cpu_registers[11] = Core::g_app_core->GetReg(11);
- ctx.cpu_registers[12] = Core::g_app_core->GetReg(12);
- ctx.sp = Core::g_app_core->GetReg(13);
- ctx.lr = Core::g_app_core->GetReg(14);
- ctx.pc = Core::g_app_core->GetPC();
- ctx.cpsr = Core::g_app_core->GetCPSR();
+ Core::g_app_core->SaveContext(ctx);
}
/// Loads a CPU context
void __KernelLoadContext(const ThreadContext& ctx) {
- Core::g_app_core->SetReg(0, ctx.cpu_registers[0]);
- Core::g_app_core->SetReg(1, ctx.cpu_registers[1]);
- Core::g_app_core->SetReg(2, ctx.cpu_registers[2]);
- Core::g_app_core->SetReg(3, ctx.cpu_registers[3]);
- Core::g_app_core->SetReg(4, ctx.cpu_registers[4]);
- Core::g_app_core->SetReg(5, ctx.cpu_registers[5]);
- Core::g_app_core->SetReg(6, ctx.cpu_registers[6]);
- Core::g_app_core->SetReg(7, ctx.cpu_registers[7]);
- Core::g_app_core->SetReg(8, ctx.cpu_registers[8]);
- Core::g_app_core->SetReg(9, ctx.cpu_registers[9]);
- Core::g_app_core->SetReg(10, ctx.cpu_registers[10]);
- Core::g_app_core->SetReg(11, ctx.cpu_registers[11]);
- Core::g_app_core->SetReg(12, ctx.cpu_registers[12]);
- Core::g_app_core->SetReg(13, ctx.sp);
- Core::g_app_core->SetReg(14, ctx.lr);
- //Core::g_app_core->SetReg(15, ctx.pc);
-
- Core::g_app_core->SetPC(ctx.pc);
- Core::g_app_core->SetCPSR(ctx.cpsr);
+ Core::g_app_core->LoadContext(ctx);
}
/// Resets a thread