diff options
Diffstat (limited to 'src/core/hle/service/srv.cpp')
| -rw-r--r-- | src/core/hle/service/srv.cpp | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/src/core/hle/service/srv.cpp b/src/core/hle/service/srv.cpp index b25be413a..f8df38c42 100644 --- a/src/core/hle/service/srv.cpp +++ b/src/core/hle/service/srv.cpp | |||
| @@ -7,9 +7,7 @@ | |||
| 7 | #include "core/hle/kernel/event.h" | 7 | #include "core/hle/kernel/event.h" |
| 8 | #include "core/hle/service/srv.h" | 8 | #include "core/hle/service/srv.h" |
| 9 | 9 | ||
| 10 | //////////////////////////////////////////////////////////////////////////////////////////////////// | 10 | namespace Service { |
| 11 | // Namespace SRV | ||
| 12 | |||
| 13 | namespace SRV { | 11 | namespace SRV { |
| 14 | 12 | ||
| 15 | static Kernel::SharedPtr<Kernel::Event> event_handle; | 13 | static Kernel::SharedPtr<Kernel::Event> event_handle; |
| @@ -23,7 +21,7 @@ static Kernel::SharedPtr<Kernel::Event> event_handle; | |||
| 23 | * 0: 0x00010040 | 21 | * 0: 0x00010040 |
| 24 | * 1: ResultCode | 22 | * 1: ResultCode |
| 25 | */ | 23 | */ |
| 26 | static void RegisterClient(Service::Interface* self) { | 24 | static void RegisterClient(Interface* self) { |
| 27 | u32* cmd_buff = Kernel::GetCommandBuffer(); | 25 | u32* cmd_buff = Kernel::GetCommandBuffer(); |
| 28 | 26 | ||
| 29 | if (cmd_buff[1] != IPC::CallingPidDesc()) { | 27 | if (cmd_buff[1] != IPC::CallingPidDesc()) { |
| @@ -48,7 +46,7 @@ static void RegisterClient(Service::Interface* self) { | |||
| 48 | * 2: Translation descriptor: 0x20 | 46 | * 2: Translation descriptor: 0x20 |
| 49 | * 3: Handle to semaphore signaled on process notification | 47 | * 3: Handle to semaphore signaled on process notification |
| 50 | */ | 48 | */ |
| 51 | static void EnableNotification(Service::Interface* self) { | 49 | static void EnableNotification(Interface* self) { |
| 52 | u32* cmd_buff = Kernel::GetCommandBuffer(); | 50 | u32* cmd_buff = Kernel::GetCommandBuffer(); |
| 53 | 51 | ||
| 54 | // TODO(bunnei): Change to a semaphore once these have been implemented | 52 | // TODO(bunnei): Change to a semaphore once these have been implemented |
| @@ -73,7 +71,7 @@ static void EnableNotification(Service::Interface* self) { | |||
| 73 | * 1: ResultCode | 71 | * 1: ResultCode |
| 74 | * 3: Service handle | 72 | * 3: Service handle |
| 75 | */ | 73 | */ |
| 76 | static void GetServiceHandle(Service::Interface* self) { | 74 | static void GetServiceHandle(Interface* self) { |
| 77 | ResultCode res = RESULT_SUCCESS; | 75 | ResultCode res = RESULT_SUCCESS; |
| 78 | u32* cmd_buff = Kernel::GetCommandBuffer(); | 76 | u32* cmd_buff = Kernel::GetCommandBuffer(); |
| 79 | 77 | ||
| @@ -99,7 +97,7 @@ static void GetServiceHandle(Service::Interface* self) { | |||
| 99 | * 0: 0x00090040 | 97 | * 0: 0x00090040 |
| 100 | * 1: ResultCode | 98 | * 1: ResultCode |
| 101 | */ | 99 | */ |
| 102 | static void Subscribe(Service::Interface* self) { | 100 | static void Subscribe(Interface* self) { |
| 103 | u32* cmd_buff = Kernel::GetCommandBuffer(); | 101 | u32* cmd_buff = Kernel::GetCommandBuffer(); |
| 104 | 102 | ||
| 105 | u32 notification_id = cmd_buff[1]; | 103 | u32 notification_id = cmd_buff[1]; |
| @@ -118,7 +116,7 @@ static void Subscribe(Service::Interface* self) { | |||
| 118 | * 0: 0x000A0040 | 116 | * 0: 0x000A0040 |
| 119 | * 1: ResultCode | 117 | * 1: ResultCode |
| 120 | */ | 118 | */ |
| 121 | static void Unsubscribe(Service::Interface* self) { | 119 | static void Unsubscribe(Interface* self) { |
| 122 | u32* cmd_buff = Kernel::GetCommandBuffer(); | 120 | u32* cmd_buff = Kernel::GetCommandBuffer(); |
| 123 | 121 | ||
| 124 | u32 notification_id = cmd_buff[1]; | 122 | u32 notification_id = cmd_buff[1]; |
| @@ -138,7 +136,7 @@ static void Unsubscribe(Service::Interface* self) { | |||
| 138 | * 0: 0x000C0040 | 136 | * 0: 0x000C0040 |
| 139 | * 1: ResultCode | 137 | * 1: ResultCode |
| 140 | */ | 138 | */ |
| 141 | static void PublishToSubscriber(Service::Interface* self) { | 139 | static void PublishToSubscriber(Interface* self) { |
| 142 | u32* cmd_buff = Kernel::GetCommandBuffer(); | 140 | u32* cmd_buff = Kernel::GetCommandBuffer(); |
| 143 | 141 | ||
| 144 | u32 notification_id = cmd_buff[1]; | 142 | u32 notification_id = cmd_buff[1]; |
| @@ -167,16 +165,14 @@ const Interface::FunctionInfo FunctionTable[] = { | |||
| 167 | {0x000E00C0, nullptr, "IsServiceRegistered"}, | 165 | {0x000E00C0, nullptr, "IsServiceRegistered"}, |
| 168 | }; | 166 | }; |
| 169 | 167 | ||
| 170 | //////////////////////////////////////////////////////////////////////////////////////////////////// | 168 | SRV::SRV() { |
| 171 | // Interface class | ||
| 172 | |||
| 173 | Interface::Interface() { | ||
| 174 | Register(FunctionTable); | 169 | Register(FunctionTable); |
| 175 | event_handle = nullptr; | 170 | event_handle = nullptr; |
| 176 | } | 171 | } |
| 177 | 172 | ||
| 178 | Interface::~Interface() { | 173 | SRV::~SRV() { |
| 179 | event_handle = nullptr; | 174 | event_handle = nullptr; |
| 180 | } | 175 | } |
| 181 | 176 | ||
| 182 | } // namespace SRV | 177 | } // namespace SRV |
| 178 | } // namespace Service | ||