summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar mailwl2016-05-29 12:00:27 +0300
committerGravatar mailwl2016-05-31 10:06:00 +0300
commiteea08f281d96791593f5f9fc59bec6e64fd7fc84 (patch)
tree65f3350f8de1f732674b6e5a05719e3e0c78a1aa /src
parentremove ugly function (diff)
downloadyuzu-eea08f281d96791593f5f9fc59bec6e64fd7fc84.tar.gz
yuzu-eea08f281d96791593f5f9fc59bec6e64fd7fc84.tar.xz
yuzu-eea08f281d96791593f5f9fc59bec6e64fd7fc84.zip
Fix mistakes, add output header codes
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/srv.cpp32
1 files changed, 24 insertions, 8 deletions
diff --git a/src/core/hle/service/srv.cpp b/src/core/hle/service/srv.cpp
index 76bbe3d1a..2afc04d27 100644
--- a/src/core/hle/service/srv.cpp
+++ b/src/core/hle/service/srv.cpp
@@ -21,11 +21,19 @@ static Kernel::SharedPtr<Kernel::Event> event_handle;
21 * 0: 0x00010002 21 * 0: 0x00010002
22 * 1: ProcessId Header (must be 0x20) 22 * 1: ProcessId Header (must be 0x20)
23 * Outputs: 23 * Outputs:
24 * 0: 0x00010040
24 * 1: ResultCode 25 * 1: ResultCode
25 */ 26 */
26static void RegisterClient(Service::Interface* self) { 27static void RegisterClient(Service::Interface* self) {
27 u32* cmd_buff = Kernel::GetCommandBuffer(); 28 u32* cmd_buff = Kernel::GetCommandBuffer();
28 29
30 if (cmd_buff[1] != 0x20) {
31 cmd_buff[0] = IPC::MakeHeader(0x0, 0x1, 0); //0x40
32 cmd_buff[1] = ResultCode(ErrorDescription::OS_InvalidBufferDescriptor, ErrorModule::OS,
33 ErrorSummary::WrongArgument, ErrorLevel::Permanent).raw;
34 return;
35 }
36 cmd_buff[0] = IPC::MakeHeader(0x1, 0x1, 0); //0x10040
29 cmd_buff[1] = RESULT_SUCCESS.raw; // No error 37 cmd_buff[1] = RESULT_SUCCESS.raw; // No error
30 LOG_WARNING(Service_SRV, "(STUBBED) called"); 38 LOG_WARNING(Service_SRV, "(STUBBED) called");
31} 39}
@@ -35,6 +43,7 @@ static void RegisterClient(Service::Interface* self) {
35 * Inputs: 43 * Inputs:
36 * 0: 0x00020000 44 * 0: 0x00020000
37 * Outputs: 45 * Outputs:
46 * 0: 0x00020042
38 * 1: ResultCode 47 * 1: ResultCode
39 * 2: Translation descriptor: 0x20 48 * 2: Translation descriptor: 0x20
40 * 3: Handle to semaphore signaled on process notification 49 * 3: Handle to semaphore signaled on process notification
@@ -46,14 +55,15 @@ static void EnableNotification(Service::Interface* self) {
46 event_handle = Kernel::Event::Create(Kernel::ResetType::OneShot, "SRV:Event"); 55 event_handle = Kernel::Event::Create(Kernel::ResetType::OneShot, "SRV:Event");
47 event_handle->Clear(); 56 event_handle->Clear();
48 57
58 cmd_buff[0] = IPC::MakeHeader(0x2, 0x1, 0x2); // 0x20042
49 cmd_buff[1] = RESULT_SUCCESS.raw; // No error 59 cmd_buff[1] = RESULT_SUCCESS.raw; // No error
50 cmd_buff[2] = 0x20; 60 cmd_buff[2] = IPC::CallingPidDesc();
51 cmd_buff[3] = Kernel::g_handle_table.Create(event_handle).MoveFrom(); 61 cmd_buff[3] = Kernel::g_handle_table.Create(event_handle).MoveFrom();
52 LOG_WARNING(Service_SRV, "(STUBBED) called"); 62 LOG_WARNING(Service_SRV, "(STUBBED) called");
53} 63}
54 64
55/** 65/**
56 * SRV::EnableNotification service function 66 * SRV::GetServiceHandle service function
57 * Inputs: 67 * Inputs:
58 * 0: 0x00050100 68 * 0: 0x00050100
59 * 1-2: 8-byte UTF-8 service name 69 * 1-2: 8-byte UTF-8 service name
@@ -86,15 +96,17 @@ static void GetServiceHandle(Service::Interface* self) {
86 * 0: 0x00090040 96 * 0: 0x00090040
87 * 1: Notification ID 97 * 1: Notification ID
88 * Outputs: 98 * Outputs:
99 * 0: 0x00090040
89 * 1: ResultCode 100 * 1: ResultCode
90 */ 101 */
91static void Subscribe(Service::Interface* self) { 102static void Subscribe(Service::Interface* self) {
92 u32* cmd_buff = Kernel::GetCommandBuffer(); 103 u32* cmd_buff = Kernel::GetCommandBuffer();
93 104
94 u32 notif_id = cmd_buff[1]; 105 u32 notification_id = cmd_buff[1];
95 106
107 cmd_buff[0] = IPC::MakeHeader(0x9, 0x1, 0); // 0x90040
96 cmd_buff[1] = RESULT_SUCCESS.raw; // No error 108 cmd_buff[1] = RESULT_SUCCESS.raw; // No error
97 LOG_WARNING(Service_SRV, "(STUBBED) called, notif_id=0x%X", notif_id); 109 LOG_WARNING(Service_SRV, "(STUBBED) called, notification_id=0x%X", notification_id);
98} 110}
99 111
100/** 112/**
@@ -103,15 +115,17 @@ static void Subscribe(Service::Interface* self) {
103 * 0: 0x000A0040 115 * 0: 0x000A0040
104 * 1: Notification ID 116 * 1: Notification ID
105 * Outputs: 117 * Outputs:
118 * 0: 0x000A0040
106 * 1: ResultCode 119 * 1: ResultCode
107 */ 120 */
108static void Unsubscribe(Service::Interface* self) { 121static void Unsubscribe(Service::Interface* self) {
109 u32* cmd_buff = Kernel::GetCommandBuffer(); 122 u32* cmd_buff = Kernel::GetCommandBuffer();
110 123
111 u32 notif_id = cmd_buff[1]; 124 u32 notification_id = cmd_buff[1];
112 125
126 cmd_buff[0] = IPC::MakeHeader(0xA, 0x1, 0); // 0xA0040
113 cmd_buff[1] = RESULT_SUCCESS.raw; // No error 127 cmd_buff[1] = RESULT_SUCCESS.raw; // No error
114 LOG_WARNING(Service_SRV, "(STUBBED) called, notif_id=0x%X", notif_id); 128 LOG_WARNING(Service_SRV, "(STUBBED) called, notification_id=0x%X", notification_id);
115} 129}
116 130
117/** 131/**
@@ -121,16 +135,18 @@ static void Unsubscribe(Service::Interface* self) {
121 * 1: Notification ID 135 * 1: Notification ID
122 * 2: Flags (bit0: only fire if not fired, bit1: report errors) 136 * 2: Flags (bit0: only fire if not fired, bit1: report errors)
123 * Outputs: 137 * Outputs:
138 * 0: 0x000C0040
124 * 1: ResultCode 139 * 1: ResultCode
125 */ 140 */
126static void PublishToSubscriber(Service::Interface* self) { 141static void PublishToSubscriber(Service::Interface* self) {
127 u32* cmd_buff = Kernel::GetCommandBuffer(); 142 u32* cmd_buff = Kernel::GetCommandBuffer();
128 143
129 u32 notif_id = cmd_buff[1]; 144 u32 notification_id = cmd_buff[1];
130 u8 flags = cmd_buff[2] & 0xFF; 145 u8 flags = cmd_buff[2] & 0xFF;
131 146
147 cmd_buff[0] = IPC::MakeHeader(0xC, 0x1, 0); // 0xC0040
132 cmd_buff[1] = RESULT_SUCCESS.raw; // No error 148 cmd_buff[1] = RESULT_SUCCESS.raw; // No error
133 LOG_WARNING(Service_SRV, "(STUBBED) called, notif_id=0x%X, flags=%u", notif_id, flags); 149 LOG_WARNING(Service_SRV, "(STUBBED) called, notification_id=0x%X, flags=%u", notification_id, flags);
134} 150}
135 151
136const Interface::FunctionInfo FunctionTable[] = { 152const Interface::FunctionInfo FunctionTable[] = {