diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/service.cpp | 36 |
1 files changed, 31 insertions, 5 deletions
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp index 3434b6dbf..556dfc8a2 100644 --- a/src/core/hle/service/service.cpp +++ b/src/core/hle/service/service.cpp | |||
| @@ -5,15 +5,16 @@ | |||
| 5 | #include "common/common.h" | 5 | #include "common/common.h" |
| 6 | #include "common/log.h" | 6 | #include "common/log.h" |
| 7 | 7 | ||
| 8 | #include "core/hle/hle.h" | ||
| 8 | #include "core/hle/service/service.h" | 9 | #include "core/hle/service/service.h" |
| 9 | 10 | ||
| 10 | //////////////////////////////////////////////////////////////////////////////////////////////////// | ||
| 11 | // Namespace Service | ||
| 12 | |||
| 13 | namespace Service { | 11 | namespace Service { |
| 14 | 12 | ||
| 15 | Manager* g_manager = NULL; ///< Service manager | 13 | Manager* g_manager = NULL; ///< Service manager |
| 16 | 14 | ||
| 15 | //////////////////////////////////////////////////////////////////////////////////////////////////// | ||
| 16 | // Service Manager class | ||
| 17 | |||
| 17 | Manager::Manager() { | 18 | Manager::Manager() { |
| 18 | } | 19 | } |
| 19 | 20 | ||
| @@ -62,7 +63,11 @@ Interface* Manager::FetchFromPortName(std::string port_name) { | |||
| 62 | return FetchFromUID(itr->second); | 63 | return FetchFromUID(itr->second); |
| 63 | } | 64 | } |
| 64 | 65 | ||
| 66 | //////////////////////////////////////////////////////////////////////////////////////////////////// | ||
| 67 | // Interface to "SRV" service | ||
| 68 | |||
| 65 | class Interface_SRV : public Interface { | 69 | class Interface_SRV : public Interface { |
| 70 | |||
| 66 | public: | 71 | public: |
| 67 | 72 | ||
| 68 | Interface_SRV() { | 73 | Interface_SRV() { |
| @@ -71,6 +76,12 @@ public: | |||
| 71 | ~Interface_SRV() { | 76 | ~Interface_SRV() { |
| 72 | } | 77 | } |
| 73 | 78 | ||
| 79 | enum { | ||
| 80 | CMD_OFFSET = 0x80, | ||
| 81 | CMD_HEADER_INIT = 0x10002, ///< Command header to initialize SRV service | ||
| 82 | CMD_HEADER_GET_HANDLE = 0x50100, ///< Command header to get handle of other services | ||
| 83 | }; | ||
| 84 | |||
| 74 | /** | 85 | /** |
| 75 | * Gets the string name used by CTROS for a service | 86 | * Gets the string name used by CTROS for a service |
| 76 | * @return String name of service | 87 | * @return String name of service |
| @@ -92,12 +103,27 @@ public: | |||
| 92 | * @return Return result of svcSendSyncRequest passed back to user app | 103 | * @return Return result of svcSendSyncRequest passed back to user app |
| 93 | */ | 104 | */ |
| 94 | Syscall::Result Sync() { | 105 | Syscall::Result Sync() { |
| 95 | ERROR_LOG(HLE, "Unimplemented function Interface_SRV::Sync"); | 106 | u32 header = 0; |
| 107 | HLE::Read<u32>(header, (HLE::CMD_BUFFER_ADDR + CMD_OFFSET)); | ||
| 108 | |||
| 109 | switch (header) { | ||
| 110 | case CMD_HEADER_INIT: | ||
| 111 | NOTICE_LOG(HLE, "Interface_SRV::Sync - Initialize"); | ||
| 112 | break; | ||
| 113 | |||
| 114 | case CMD_HEADER_GET_HANDLE: | ||
| 115 | NOTICE_LOG(HLE, "Interface_SRV::Sync - GetHandle, port: %s", HLE::GetCharPointer(HLE::CMD_BUFFER_ADDR + CMD_OFFSET + 4)); | ||
| 116 | break; | ||
| 117 | } | ||
| 118 | |||
| 96 | return 0; | 119 | return 0; |
| 97 | } | 120 | } |
| 98 | 121 | ||
| 99 | }; | 122 | }; |
| 100 | 123 | ||
| 124 | //////////////////////////////////////////////////////////////////////////////////////////////////// | ||
| 125 | // Module interface | ||
| 126 | |||
| 101 | /// Initialize ServiceManager | 127 | /// Initialize ServiceManager |
| 102 | void Init() { | 128 | void Init() { |
| 103 | g_manager = new Manager; | 129 | g_manager = new Manager; |