summaryrefslogtreecommitdiff
path: root/src/core/hle/service/service.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/service/service.cpp')
-rw-r--r--src/core/hle/service/service.cpp53
1 files changed, 28 insertions, 25 deletions
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp
index 5b8440b77..ca7eeac8a 100644
--- a/src/core/hle/service/service.cpp
+++ b/src/core/hle/service/service.cpp
@@ -4,42 +4,40 @@
4 4
5#include "common/logging/log.h" 5#include "common/logging/log.h"
6#include "common/string_util.h" 6#include "common/string_util.h"
7
8#include "core/hle/service/service.h"
9#include "core/hle/service/ac_u.h" 7#include "core/hle/service/ac_u.h"
10#include "core/hle/service/act_a.h" 8#include "core/hle/service/act_a.h"
11#include "core/hle/service/act_u.h" 9#include "core/hle/service/act_u.h"
12#include "core/hle/service/csnd_snd.h"
13#include "core/hle/service/dsp_dsp.h"
14#include "core/hle/service/err_f.h"
15#include "core/hle/service/gsp_gpu.h"
16#include "core/hle/service/gsp_lcd.h"
17#include "core/hle/service/http_c.h"
18#include "core/hle/service/mic_u.h"
19#include "core/hle/service/ns_s.h"
20#include "core/hle/service/nwm_uds.h"
21#include "core/hle/service/pm_app.h"
22#include "core/hle/service/soc_u.h"
23#include "core/hle/service/srv.h"
24#include "core/hle/service/ssl_c.h"
25#include "core/hle/service/y2r_u.h"
26
27#include "core/hle/service/am/am.h" 10#include "core/hle/service/am/am.h"
28#include "core/hle/service/apt/apt.h" 11#include "core/hle/service/apt/apt.h"
29#include "core/hle/service/boss/boss.h" 12#include "core/hle/service/boss/boss.h"
30#include "core/hle/service/cam/cam.h" 13#include "core/hle/service/cam/cam.h"
31#include "core/hle/service/cecd/cecd.h" 14#include "core/hle/service/cecd/cecd.h"
15#include "core/hle/service/cfg/cfg.h"
16#include "core/hle/service/csnd_snd.h"
32#include "core/hle/service/dlp/dlp.h" 17#include "core/hle/service/dlp/dlp.h"
18#include "core/hle/service/dsp_dsp.h"
19#include "core/hle/service/err_f.h"
33#include "core/hle/service/frd/frd.h" 20#include "core/hle/service/frd/frd.h"
34#include "core/hle/service/fs/archive.h" 21#include "core/hle/service/fs/archive.h"
35#include "core/hle/service/cfg/cfg.h" 22#include "core/hle/service/gsp_gpu.h"
23#include "core/hle/service/gsp_lcd.h"
36#include "core/hle/service/hid/hid.h" 24#include "core/hle/service/hid/hid.h"
25#include "core/hle/service/http_c.h"
37#include "core/hle/service/ir/ir.h" 26#include "core/hle/service/ir/ir.h"
38#include "core/hle/service/ldr_ro/ldr_ro.h" 27#include "core/hle/service/ldr_ro/ldr_ro.h"
28#include "core/hle/service/mic_u.h"
39#include "core/hle/service/ndm/ndm.h" 29#include "core/hle/service/ndm/ndm.h"
40#include "core/hle/service/news/news.h" 30#include "core/hle/service/news/news.h"
41#include "core/hle/service/nim/nim.h" 31#include "core/hle/service/nim/nim.h"
32#include "core/hle/service/ns_s.h"
33#include "core/hle/service/nwm_uds.h"
34#include "core/hle/service/pm_app.h"
42#include "core/hle/service/ptm/ptm.h" 35#include "core/hle/service/ptm/ptm.h"
36#include "core/hle/service/service.h"
37#include "core/hle/service/soc_u.h"
38#include "core/hle/service/srv.h"
39#include "core/hle/service/ssl_c.h"
40#include "core/hle/service/y2r_u.h"
43 41
44namespace Service { 42namespace Service {
45 43
@@ -50,11 +48,13 @@ std::unordered_map<std::string, Kernel::SharedPtr<Interface>> g_srv_services;
50 * Creates a function string for logging, complete with the name (or header code, depending 48 * Creates a function string for logging, complete with the name (or header code, depending
51 * on what's passed in) the port name, and all the cmd_buff arguments. 49 * on what's passed in) the port name, and all the cmd_buff arguments.
52 */ 50 */
53static std::string MakeFunctionString(const char* name, const char* port_name, const u32* cmd_buff) { 51static std::string MakeFunctionString(const char* name, const char* port_name,
52 const u32* cmd_buff) {
54 // Number of params == bits 0-5 + bits 6-11 53 // Number of params == bits 0-5 + bits 6-11
55 int num_params = (cmd_buff[0] & 0x3F) + ((cmd_buff[0] >> 6) & 0x3F); 54 int num_params = (cmd_buff[0] & 0x3F) + ((cmd_buff[0] >> 6) & 0x3F);
56 55
57 std::string function_string = Common::StringFromFormat("function '%s': port=%s", name, port_name); 56 std::string function_string =
57 Common::StringFromFormat("function '%s': port=%s", name, port_name);
58 for (int i = 1; i <= num_params; ++i) { 58 for (int i = 1; i <= num_params; ++i) {
59 function_string += Common::StringFromFormat(", cmd_buff[%i]=0x%X", i, cmd_buff[i]); 59 function_string += Common::StringFromFormat(", cmd_buff[%i]=0x%X", i, cmd_buff[i]);
60 } 60 }
@@ -66,14 +66,19 @@ ResultVal<bool> Interface::SyncRequest() {
66 auto itr = m_functions.find(cmd_buff[0]); 66 auto itr = m_functions.find(cmd_buff[0]);
67 67
68 if (itr == m_functions.end() || itr->second.func == nullptr) { 68 if (itr == m_functions.end() || itr->second.func == nullptr) {
69 std::string function_name = (itr == m_functions.end()) ? Common::StringFromFormat("0x%08X", cmd_buff[0]) : itr->second.name; 69 std::string function_name = (itr == m_functions.end())
70 LOG_ERROR(Service, "unknown / unimplemented %s", MakeFunctionString(function_name.c_str(), GetPortName().c_str(), cmd_buff).c_str()); 70 ? Common::StringFromFormat("0x%08X", cmd_buff[0])
71 : itr->second.name;
72 LOG_ERROR(
73 Service, "unknown / unimplemented %s",
74 MakeFunctionString(function_name.c_str(), GetPortName().c_str(), cmd_buff).c_str());
71 75
72 // TODO(bunnei): Hack - ignore error 76 // TODO(bunnei): Hack - ignore error
73 cmd_buff[1] = 0; 77 cmd_buff[1] = 0;
74 return MakeResult<bool>(false); 78 return MakeResult<bool>(false);
75 } 79 }
76 LOG_TRACE(Service, "%s", MakeFunctionString(itr->second.name, GetPortName().c_str(), cmd_buff).c_str()); 80 LOG_TRACE(Service, "%s",
81 MakeFunctionString(itr->second.name, GetPortName().c_str(), cmd_buff).c_str());
77 82
78 itr->second.func(this); 83 itr->second.func(this);
79 84
@@ -163,6 +168,4 @@ void Shutdown() {
163 g_kernel_named_ports.clear(); 168 g_kernel_named_ports.clear();
164 LOG_DEBUG(Service, "shutdown OK"); 169 LOG_DEBUG(Service, "shutdown OK");
165} 170}
166
167
168} 171}