diff --git a/include/services/nim.hpp b/include/services/nim.hpp index dfe13694..ea599b4e 100644 --- a/include/services/nim.hpp +++ b/include/services/nim.hpp @@ -6,7 +6,6 @@ #include "result/result.hpp" class NIMService { - Handle handle = KernelHandles::NIM; Memory& mem; MAKE_LOG_FUNCTION(log, nimLogger) @@ -14,7 +13,12 @@ class NIMService { void initialize(u32 messagePointer); public: + enum class Type { + AOC, // nim:aoc + U, // nim:u + }; + NIMService(Memory& mem) : mem(mem) {} void reset(); - void handleSyncRequest(u32 messagePointer); + void handleSyncRequest(u32 messagePointer, Type type); }; \ No newline at end of file diff --git a/src/core/services/nim.cpp b/src/core/services/nim.cpp index e4e14c1c..c9141756 100644 --- a/src/core/services/nim.cpp +++ b/src/core/services/nim.cpp @@ -9,10 +9,16 @@ namespace NIMCommands { void NIMService::reset() {} -void NIMService::handleSyncRequest(u32 messagePointer) { +void NIMService::handleSyncRequest(u32 messagePointer, Type type) { const u32 command = mem.read32(messagePointer); switch (command) { - case NIMCommands::Initialize: initialize(messagePointer); break; + if (type == Type::AOC) { + switch (command) { + case NIMCommands::Initialize: initialize(messagePointer); break; + + default: Helpers::panic("NIM AOC service requested. Command: %08X\n", command); + } + } default: Helpers::panic("NIM service requested. Command: %08X\n", command); } }