summaryrefslogtreecommitdiff
path: root/src/core/hle/service/srv.cpp
diff options
context:
space:
mode:
authorGravatar Yuri Kunde Schlesner2016-09-21 11:29:48 -0700
committerGravatar GitHub2016-09-21 11:29:48 -0700
commitd5d2ca8058a0f1c00ab7ca9fe2c058ba47546c0a (patch)
tree8a22ca73ff838f3f0090b29a548ae81087fc90ed /src/core/hle/service/srv.cpp
parentREADME: Specify master branch for Travis CI badge (diff)
parentFix Travis clang-format check (diff)
downloadyuzu-d5d2ca8058a0f1c00ab7ca9fe2c058ba47546c0a.tar.gz
yuzu-d5d2ca8058a0f1c00ab7ca9fe2c058ba47546c0a.tar.xz
yuzu-d5d2ca8058a0f1c00ab7ca9fe2c058ba47546c0a.zip
Merge pull request #2086 from linkmauve/clang-format
Add clang-format as part of our {commit,travis}-time checks
Diffstat (limited to 'src/core/hle/service/srv.cpp')
-rw-r--r--src/core/hle/service/srv.cpp51
1 files changed, 26 insertions, 25 deletions
diff --git a/src/core/hle/service/srv.cpp b/src/core/hle/service/srv.cpp
index 3c05f836b..b25be413a 100644
--- a/src/core/hle/service/srv.cpp
+++ b/src/core/hle/service/srv.cpp
@@ -4,9 +4,8 @@
4 4
5#include "common/common_types.h" 5#include "common/common_types.h"
6#include "common/logging/log.h" 6#include "common/logging/log.h"
7
8#include "core/hle/service/srv.h"
9#include "core/hle/kernel/event.h" 7#include "core/hle/kernel/event.h"
8#include "core/hle/service/srv.h"
10 9
11//////////////////////////////////////////////////////////////////////////////////////////////////// 10////////////////////////////////////////////////////////////////////////////////////////////////////
12// Namespace SRV 11// Namespace SRV
@@ -28,13 +27,14 @@ static void RegisterClient(Service::Interface* self) {
28 u32* cmd_buff = Kernel::GetCommandBuffer(); 27 u32* cmd_buff = Kernel::GetCommandBuffer();
29 28
30 if (cmd_buff[1] != IPC::CallingPidDesc()) { 29 if (cmd_buff[1] != IPC::CallingPidDesc()) {
31 cmd_buff[0] = IPC::MakeHeader(0x0, 0x1, 0); //0x40 30 cmd_buff[0] = IPC::MakeHeader(0x0, 0x1, 0); // 0x40
32 cmd_buff[1] = ResultCode(ErrorDescription::OS_InvalidBufferDescriptor, ErrorModule::OS, 31 cmd_buff[1] = ResultCode(ErrorDescription::OS_InvalidBufferDescriptor, ErrorModule::OS,
33 ErrorSummary::WrongArgument, ErrorLevel::Permanent).raw; 32 ErrorSummary::WrongArgument, ErrorLevel::Permanent)
33 .raw;
34 return; 34 return;
35 } 35 }
36 cmd_buff[0] = IPC::MakeHeader(0x1, 0x1, 0); //0x10040 36 cmd_buff[0] = IPC::MakeHeader(0x1, 0x1, 0); // 0x10040
37 cmd_buff[1] = RESULT_SUCCESS.raw; // No error 37 cmd_buff[1] = RESULT_SUCCESS.raw; // No error
38 LOG_WARNING(Service_SRV, "(STUBBED) called"); 38 LOG_WARNING(Service_SRV, "(STUBBED) called");
39} 39}
40 40
@@ -56,7 +56,7 @@ static void EnableNotification(Service::Interface* self) {
56 event_handle->Clear(); 56 event_handle->Clear();
57 57
58 cmd_buff[0] = IPC::MakeHeader(0x2, 0x1, 0x2); // 0x20042 58 cmd_buff[0] = IPC::MakeHeader(0x2, 0x1, 0x2); // 0x20042
59 cmd_buff[1] = RESULT_SUCCESS.raw; // No error 59 cmd_buff[1] = RESULT_SUCCESS.raw; // No error
60 cmd_buff[2] = IPC::CopyHandleDesc(1); 60 cmd_buff[2] = IPC::CopyHandleDesc(1);
61 cmd_buff[3] = Kernel::g_handle_table.Create(event_handle).MoveFrom(); 61 cmd_buff[3] = Kernel::g_handle_table.Create(event_handle).MoveFrom();
62 LOG_WARNING(Service_SRV, "(STUBBED) called"); 62 LOG_WARNING(Service_SRV, "(STUBBED) called");
@@ -105,7 +105,7 @@ static void Subscribe(Service::Interface* self) {
105 u32 notification_id = cmd_buff[1]; 105 u32 notification_id = cmd_buff[1];
106 106
107 cmd_buff[0] = IPC::MakeHeader(0x9, 0x1, 0); // 0x90040 107 cmd_buff[0] = IPC::MakeHeader(0x9, 0x1, 0); // 0x90040
108 cmd_buff[1] = RESULT_SUCCESS.raw; // No error 108 cmd_buff[1] = RESULT_SUCCESS.raw; // No error
109 LOG_WARNING(Service_SRV, "(STUBBED) called, notification_id=0x%X", notification_id); 109 LOG_WARNING(Service_SRV, "(STUBBED) called, notification_id=0x%X", notification_id);
110} 110}
111 111
@@ -124,7 +124,7 @@ static void Unsubscribe(Service::Interface* self) {
124 u32 notification_id = cmd_buff[1]; 124 u32 notification_id = cmd_buff[1];
125 125
126 cmd_buff[0] = IPC::MakeHeader(0xA, 0x1, 0); // 0xA0040 126 cmd_buff[0] = IPC::MakeHeader(0xA, 0x1, 0); // 0xA0040
127 cmd_buff[1] = RESULT_SUCCESS.raw; // No error 127 cmd_buff[1] = RESULT_SUCCESS.raw; // No error
128 LOG_WARNING(Service_SRV, "(STUBBED) called, notification_id=0x%X", notification_id); 128 LOG_WARNING(Service_SRV, "(STUBBED) called, notification_id=0x%X", notification_id);
129} 129}
130 130
@@ -145,25 +145,26 @@ static void PublishToSubscriber(Service::Interface* self) {
145 u8 flags = cmd_buff[2] & 0xFF; 145 u8 flags = cmd_buff[2] & 0xFF;
146 146
147 cmd_buff[0] = IPC::MakeHeader(0xC, 0x1, 0); // 0xC0040 147 cmd_buff[0] = IPC::MakeHeader(0xC, 0x1, 0); // 0xC0040
148 cmd_buff[1] = RESULT_SUCCESS.raw; // No error 148 cmd_buff[1] = RESULT_SUCCESS.raw; // No error
149 LOG_WARNING(Service_SRV, "(STUBBED) called, notification_id=0x%X, flags=%u", notification_id, flags); 149 LOG_WARNING(Service_SRV, "(STUBBED) called, notification_id=0x%X, flags=%u", notification_id,
150 flags);
150} 151}
151 152
152const Interface::FunctionInfo FunctionTable[] = { 153const Interface::FunctionInfo FunctionTable[] = {
153 {0x00010002, RegisterClient, "RegisterClient"}, 154 {0x00010002, RegisterClient, "RegisterClient"},
154 {0x00020000, EnableNotification, "EnableNotification"}, 155 {0x00020000, EnableNotification, "EnableNotification"},
155 {0x00030100, nullptr, "RegisterService"}, 156 {0x00030100, nullptr, "RegisterService"},
156 {0x000400C0, nullptr, "UnregisterService"}, 157 {0x000400C0, nullptr, "UnregisterService"},
157 {0x00050100, GetServiceHandle, "GetServiceHandle"}, 158 {0x00050100, GetServiceHandle, "GetServiceHandle"},
158 {0x000600C2, nullptr, "RegisterPort"}, 159 {0x000600C2, nullptr, "RegisterPort"},
159 {0x000700C0, nullptr, "UnregisterPort"}, 160 {0x000700C0, nullptr, "UnregisterPort"},
160 {0x00080100, nullptr, "GetPort"}, 161 {0x00080100, nullptr, "GetPort"},
161 {0x00090040, Subscribe, "Subscribe"}, 162 {0x00090040, Subscribe, "Subscribe"},
162 {0x000A0040, Unsubscribe, "Unsubscribe"}, 163 {0x000A0040, Unsubscribe, "Unsubscribe"},
163 {0x000B0000, nullptr, "ReceiveNotification"}, 164 {0x000B0000, nullptr, "ReceiveNotification"},
164 {0x000C0080, PublishToSubscriber, "PublishToSubscriber"}, 165 {0x000C0080, PublishToSubscriber, "PublishToSubscriber"},
165 {0x000D0040, nullptr, "PublishAndGetSubscriber"}, 166 {0x000D0040, nullptr, "PublishAndGetSubscriber"},
166 {0x000E00C0, nullptr, "IsServiceRegistered"}, 167 {0x000E00C0, nullptr, "IsServiceRegistered"},
167}; 168};
168 169
169//////////////////////////////////////////////////////////////////////////////////////////////////// 170////////////////////////////////////////////////////////////////////////////////////////////////////