diff options
Diffstat (limited to 'src/core/hle/service/service.cpp')
| -rw-r--r-- | src/core/hle/service/service.cpp | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp index 5b8440b77..a531aad87 100644 --- a/src/core/hle/service/service.cpp +++ b/src/core/hle/service/service.cpp | |||
| @@ -5,7 +5,6 @@ | |||
| 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 | 7 | ||
| 8 | #include "core/hle/service/service.h" | ||
| 9 | #include "core/hle/service/ac_u.h" | 8 | #include "core/hle/service/ac_u.h" |
| 10 | #include "core/hle/service/act_a.h" | 9 | #include "core/hle/service/act_a.h" |
| 11 | #include "core/hle/service/act_u.h" | 10 | #include "core/hle/service/act_u.h" |
| @@ -19,6 +18,7 @@ | |||
| 19 | #include "core/hle/service/ns_s.h" | 18 | #include "core/hle/service/ns_s.h" |
| 20 | #include "core/hle/service/nwm_uds.h" | 19 | #include "core/hle/service/nwm_uds.h" |
| 21 | #include "core/hle/service/pm_app.h" | 20 | #include "core/hle/service/pm_app.h" |
| 21 | #include "core/hle/service/service.h" | ||
| 22 | #include "core/hle/service/soc_u.h" | 22 | #include "core/hle/service/soc_u.h" |
| 23 | #include "core/hle/service/srv.h" | 23 | #include "core/hle/service/srv.h" |
| 24 | #include "core/hle/service/ssl_c.h" | 24 | #include "core/hle/service/ssl_c.h" |
| @@ -29,10 +29,10 @@ | |||
| 29 | #include "core/hle/service/boss/boss.h" | 29 | #include "core/hle/service/boss/boss.h" |
| 30 | #include "core/hle/service/cam/cam.h" | 30 | #include "core/hle/service/cam/cam.h" |
| 31 | #include "core/hle/service/cecd/cecd.h" | 31 | #include "core/hle/service/cecd/cecd.h" |
| 32 | #include "core/hle/service/cfg/cfg.h" | ||
| 32 | #include "core/hle/service/dlp/dlp.h" | 33 | #include "core/hle/service/dlp/dlp.h" |
| 33 | #include "core/hle/service/frd/frd.h" | 34 | #include "core/hle/service/frd/frd.h" |
| 34 | #include "core/hle/service/fs/archive.h" | 35 | #include "core/hle/service/fs/archive.h" |
| 35 | #include "core/hle/service/cfg/cfg.h" | ||
| 36 | #include "core/hle/service/hid/hid.h" | 36 | #include "core/hle/service/hid/hid.h" |
| 37 | #include "core/hle/service/ir/ir.h" | 37 | #include "core/hle/service/ir/ir.h" |
| 38 | #include "core/hle/service/ldr_ro/ldr_ro.h" | 38 | #include "core/hle/service/ldr_ro/ldr_ro.h" |
| @@ -50,11 +50,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 | 50 | * 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. | 51 | * on what's passed in) the port name, and all the cmd_buff arguments. |
| 52 | */ | 52 | */ |
| 53 | static std::string MakeFunctionString(const char* name, const char* port_name, const u32* cmd_buff) { | 53 | static std::string MakeFunctionString(const char* name, const char* port_name, |
| 54 | const u32* cmd_buff) { | ||
| 54 | // Number of params == bits 0-5 + bits 6-11 | 55 | // Number of params == bits 0-5 + bits 6-11 |
| 55 | int num_params = (cmd_buff[0] & 0x3F) + ((cmd_buff[0] >> 6) & 0x3F); | 56 | int num_params = (cmd_buff[0] & 0x3F) + ((cmd_buff[0] >> 6) & 0x3F); |
| 56 | 57 | ||
| 57 | std::string function_string = Common::StringFromFormat("function '%s': port=%s", name, port_name); | 58 | std::string function_string = |
| 59 | Common::StringFromFormat("function '%s': port=%s", name, port_name); | ||
| 58 | for (int i = 1; i <= num_params; ++i) { | 60 | for (int i = 1; i <= num_params; ++i) { |
| 59 | function_string += Common::StringFromFormat(", cmd_buff[%i]=0x%X", i, cmd_buff[i]); | 61 | function_string += Common::StringFromFormat(", cmd_buff[%i]=0x%X", i, cmd_buff[i]); |
| 60 | } | 62 | } |
| @@ -66,14 +68,19 @@ ResultVal<bool> Interface::SyncRequest() { | |||
| 66 | auto itr = m_functions.find(cmd_buff[0]); | 68 | auto itr = m_functions.find(cmd_buff[0]); |
| 67 | 69 | ||
| 68 | if (itr == m_functions.end() || itr->second.func == nullptr) { | 70 | 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; | 71 | 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()); | 72 | ? Common::StringFromFormat("0x%08X", cmd_buff[0]) |
| 73 | : itr->second.name; | ||
| 74 | LOG_ERROR( | ||
| 75 | Service, "unknown / unimplemented %s", | ||
| 76 | MakeFunctionString(function_name.c_str(), GetPortName().c_str(), cmd_buff).c_str()); | ||
| 71 | 77 | ||
| 72 | // TODO(bunnei): Hack - ignore error | 78 | // TODO(bunnei): Hack - ignore error |
| 73 | cmd_buff[1] = 0; | 79 | cmd_buff[1] = 0; |
| 74 | return MakeResult<bool>(false); | 80 | return MakeResult<bool>(false); |
| 75 | } | 81 | } |
| 76 | LOG_TRACE(Service, "%s", MakeFunctionString(itr->second.name, GetPortName().c_str(), cmd_buff).c_str()); | 82 | LOG_TRACE(Service, "%s", |
| 83 | MakeFunctionString(itr->second.name, GetPortName().c_str(), cmd_buff).c_str()); | ||
| 77 | 84 | ||
| 78 | itr->second.func(this); | 85 | itr->second.func(this); |
| 79 | 86 | ||
| @@ -163,6 +170,4 @@ void Shutdown() { | |||
| 163 | g_kernel_named_ports.clear(); | 170 | g_kernel_named_ports.clear(); |
| 164 | LOG_DEBUG(Service, "shutdown OK"); | 171 | LOG_DEBUG(Service, "shutdown OK"); |
| 165 | } | 172 | } |
| 166 | |||
| 167 | |||
| 168 | } | 173 | } |