From 6219abd17aea9bd1bdea359e9d0ccdf161bc0ae2 Mon Sep 17 00:00:00 2001 From: wheremyfoodat Date: Fri, 16 Sep 2022 16:18:12 +0300 Subject: [PATCH] Stub CloseHandle --- include/kernel/kernel.hpp | 1 + src/core/kernel/kernel.cpp | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/include/kernel/kernel.hpp b/include/kernel/kernel.hpp index abc435ee..579c8631 100644 --- a/include/kernel/kernel.hpp +++ b/include/kernel/kernel.hpp @@ -57,6 +57,7 @@ class Kernel { void getResourceLimit(); void getResourceLimitLimitValues(); void getResourceLimitCurrentValues(); + void svcCloseHandle(); public: Kernel(std::array& regs, Memory& mem) : regs(regs), mem(mem), handleCounter(0) { diff --git a/src/core/kernel/kernel.cpp b/src/core/kernel/kernel.cpp index fc079ad7..c2f353af 100644 --- a/src/core/kernel/kernel.cpp +++ b/src/core/kernel/kernel.cpp @@ -5,6 +5,7 @@ void Kernel::serviceSVC(u32 svc) { switch (svc) { case 0x21: createAddressArbiter(); break; + case 0x23: svcCloseHandle(); break; case 0x38: getResourceLimit(); break; case 0x39: getResourceLimitLimitValues(); break; case 0x3A: getResourceLimitCurrentValues(); break; @@ -51,12 +52,17 @@ void Kernel::reset() { } // Result CreateAddressArbiter(Handle* arbiter) -// out: r0 -> result void Kernel::createAddressArbiter() { printf("Stubbed call to CreateAddressArbiter. Handle address: %08X\n", regs[0]); regs[0] = SVCResult::Success; } +// Result CloseHandle(Handle handle) +void Kernel::svcCloseHandle() { + printf("CloseHandle(handle = %d) (Unimplemented)\n", regs[0]); + regs[0] = SVCResult::Success; +} + std::string Kernel::getProcessName(u32 pid) { if (pid == KernelHandles::CurrentProcess) { return "current";