Make some things panic for later

This commit is contained in:
wheremyfoodat 2023-01-29 02:39:17 +02:00
parent 687c99cab6
commit ec7c0b86b7
5 changed files with 25 additions and 1 deletions

View file

@ -92,6 +92,7 @@ private:
void clearEvent();
void createAddressArbiter();
void createEvent();
void createMemoryBlock();
void createMutex();
void createThread();
void controlMemory();

View file

@ -10,6 +10,7 @@ class CECDService {
MAKE_LOG_FUNCTION(log, cecdLogger)
// Service commands
void getEventHandle(u32 messagePointer);
public:
CECDService(Memory& mem) : mem(mem) {}

View file

@ -38,6 +38,7 @@ void Kernel::serviceSVC(u32 svc) {
case 0x17: createEvent(); break;
case 0x18: signalEvent(); break;
case 0x19: clearEvent(); break;
case 0x1E: createMemoryBlock(); break;
case 0x1F: mapMemoryBlock(); break;
case 0x21: createAddressArbiter(); break;
case 0x22: arbitrateAddress(); break;

View file

@ -120,8 +120,19 @@ void Kernel::mapMemoryBlock() {
default: Helpers::panic("Mapping unknown shared memory block: %X", block);
}
} else {
Helpers::panic("MapMemoryBlock where the handle does not refer to GSP memory");
Helpers::panic("MapMemoryBlock where the handle does not refer to a known piece of kernel shared mem");
}
regs[0] = SVCResult::Success;
}
void Kernel::createMemoryBlock() {
const u32 addr = regs[1];
const u32 size = regs[2];
const u32 myPermission = regs[3];
const u32 otherPermission = regs[4];
logSVC("CreateMemoryBlock (addr = %08X, size = %08X, myPermission = %d, otherPermission = %d)\n", addr, size, myPermission, otherPermission);
regs[0] = SVCResult::Success; regs[1] = 0x66666666;
//Helpers::panic("Kernel::CreateMemoryBlock");
}

View file

@ -2,6 +2,7 @@
namespace CECDCommands {
enum : u32 {
GetEventHandle = 0x000F0000
};
}
@ -16,6 +17,15 @@ void CECDService::reset() {}
void CECDService::handleSyncRequest(u32 messagePointer) {
const u32 command = mem.read32(messagePointer);
switch (command) {
case CECDCommands::GetEventHandle: getEventHandle(messagePointer); break;
default: Helpers::panic("CECD service requested. Command: %08X\n", command);
}
}
void CECDService::getEventHandle(u32 messagePointer) {
log("CECD::GetEventHandle (stubbed)\n");
Helpers::panic("TODO: Actually implement CECD::GetEventHandle");
mem.write32(messagePointer + 4, Result::Success);
mem.write32(messagePointer + 12, 0x66666666);
}