Skip to content
Snippets Groups Projects
Commit 5ea46796 authored by bunnei's avatar bunnei
Browse files

added some very initial command parsing for SRV Sync

parent 67f6e414
No related branches found
No related tags found
No related merge requests found
......@@ -5,15 +5,16 @@
#include "common/common.h"
#include "common/log.h"
#include "core/hle/hle.h"
#include "core/hle/service/service.h"
////////////////////////////////////////////////////////////////////////////////////////////////////
// Namespace Service
namespace Service {
Manager* g_manager = NULL; ///< Service manager
////////////////////////////////////////////////////////////////////////////////////////////////////
// Service Manager class
Manager::Manager() {
}
......@@ -62,7 +63,11 @@ Interface* Manager::FetchFromPortName(std::string port_name) {
return FetchFromUID(itr->second);
}
////////////////////////////////////////////////////////////////////////////////////////////////////
// Interface to "SRV" service
class Interface_SRV : public Interface {
public:
Interface_SRV() {
......@@ -71,6 +76,12 @@ public:
~Interface_SRV() {
}
enum {
CMD_OFFSET = 0x80,
CMD_HEADER_INIT = 0x10002, ///< Command header to initialize SRV service
CMD_HEADER_GET_HANDLE = 0x50100, ///< Command header to get handle of other services
};
/**
* Gets the string name used by CTROS for a service
* @return String name of service
......@@ -92,12 +103,27 @@ public:
* @return Return result of svcSendSyncRequest passed back to user app
*/
Syscall::Result Sync() {
ERROR_LOG(HLE, "Unimplemented function Interface_SRV::Sync");
u32 header = 0;
HLE::Read<u32>(header, (HLE::CMD_BUFFER_ADDR + CMD_OFFSET));
switch (header) {
case CMD_HEADER_INIT:
NOTICE_LOG(HLE, "Interface_SRV::Sync - Initialize");
break;
case CMD_HEADER_GET_HANDLE:
NOTICE_LOG(HLE, "Interface_SRV::Sync - GetHandle, port: %s", HLE::GetCharPointer(HLE::CMD_BUFFER_ADDR + CMD_OFFSET + 4));
break;
}
return 0;
}
};
////////////////////////////////////////////////////////////////////////////////////////////////////
// Module interface
/// Initialize ServiceManager
void Init() {
g_manager = new Manager;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment