[Kernel] Register CreateMutex in the SVC table

This commit is contained in:
wheremyfoodat 2022-10-15 23:19:28 +03:00
parent 015343a848
commit 72132cd97e
3 changed files with 9 additions and 0 deletions

View file

@ -82,6 +82,7 @@ class Kernel {
void clearEvent();
void createAddressArbiter();
void createEvent();
void createMutex();
void createThread();
void controlMemory();
void duplicateHandle();

View file

@ -24,6 +24,7 @@ void Kernel::serviceSVC(u32 svc) {
case 0x02: queryMemory(); break;
case 0x08: createThread(); break;
case 0x0A: svcSleepThread(); break;
case 0x13: createMutex(); break;
case 0x14: releaseMutex(); break;
case 0x17: createEvent(); break;
case 0x18: signalEvent(); break;

View file

@ -213,6 +213,13 @@ void Kernel::getThreadID() {
regs[1] = thread->getData<Thread>()->index;
}
void Kernel::createMutex() {
bool locked = regs[1] != 0;
Helpers::panic("CreateMutex (initially locked: %s)\n", locked ? "yes" : "no");
regs[0] = SVCResult::Success;
}
void Kernel::releaseMutex() {
const Handle handle = regs[0];