[SRV] Stub ReceiveNotification

This commit is contained in:
wheremyfoodat 2022-10-09 20:51:29 +03:00
parent 5f7804e99f
commit d777981204
2 changed files with 10 additions and 1 deletions

View file

@ -27,6 +27,7 @@ class ServiceManager {
// "srv:" commands
void enableNotification(u32 messagePointer);
void getServiceHandle(u32 messagePointer);
void receiveNotification(u32 messagePointer);
void registerClient(u32 messagePointer);
public:

View file

@ -46,6 +46,7 @@ void ServiceManager::handleSyncRequest(u32 messagePointer) {
switch (header) {
case Commands::EnableNotification: enableNotification(messagePointer); break;
case Commands::ReceiveNotification: receiveNotification(messagePointer); break;
case Commands::RegisterClient: registerClient(messagePointer); break;
case Commands::GetServiceHandle: getServiceHandle(messagePointer); break;
default: Helpers::panic("Unknown \"srv:\" command: %08X", header);
@ -92,7 +93,7 @@ void ServiceManager::getServiceHandle(u32 messagePointer) {
}
void ServiceManager::enableNotification(u32 messagePointer) {
log("srv::EnableNotification()\n");
log("srv::EnableNotification() (STUBBED)\n");
mem.write32(messagePointer + 4, Result::Success); // Result code
mem.write32(messagePointer + 8, 0); // Translation descriptor
@ -100,6 +101,13 @@ void ServiceManager::enableNotification(u32 messagePointer) {
mem.write32(messagePointer + 12, 0x69696979);
}
void ServiceManager::receiveNotification(u32 messagePointer) {
log("srv::ReceiveNotification() (STUBBED)\n");
printf("r15 = %08X", regs[15]);
mem.write32(messagePointer + 4, Result::Success); // Result code
mem.write32(messagePointer + 8, 0); // Notification ID
}
void ServiceManager::sendCommandToService(u32 messagePointer, Handle handle) {
switch (handle) {
case KernelHandles::APT: apt.handleSyncRequest(messagePointer); break;