diff options
| author | 2017-10-15 01:24:22 -0400 | |
|---|---|---|
| committer | 2017-10-15 01:24:22 -0400 | |
| commit | 4fb1b24d68e140230da612d464a5edc226860946 (patch) | |
| tree | ed6cc24d62caf4476737508de317908a6cb23e90 /src/core/hle/service/service.cpp | |
| parent | core: Refactor MakeMagic usage and remove dead code. (diff) | |
| download | yuzu-4fb1b24d68e140230da612d464a5edc226860946.tar.gz yuzu-4fb1b24d68e140230da612d464a5edc226860946.tar.xz yuzu-4fb1b24d68e140230da612d464a5edc226860946.zip | |
hle: Implement ConvertSessionToDomain, various cleanups.
Diffstat (limited to 'src/core/hle/service/service.cpp')
| -rw-r--r-- | src/core/hle/service/service.cpp | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp index 153277681..240d79715 100644 --- a/src/core/hle/service/service.cpp +++ b/src/core/hle/service/service.cpp | |||
| @@ -10,11 +10,11 @@ | |||
| 10 | #include "core/hle/ipc.h" | 10 | #include "core/hle/ipc.h" |
| 11 | #include "core/hle/ipc_helpers.h" | 11 | #include "core/hle/ipc_helpers.h" |
| 12 | #include "core/hle/kernel/client_port.h" | 12 | #include "core/hle/kernel/client_port.h" |
| 13 | #include "core/hle/kernel/handle_table.h" | ||
| 13 | #include "core/hle/kernel/process.h" | 14 | #include "core/hle/kernel/process.h" |
| 14 | #include "core/hle/kernel/server_port.h" | 15 | #include "core/hle/kernel/server_port.h" |
| 15 | #include "core/hle/kernel/server_session.h" | 16 | #include "core/hle/kernel/server_session.h" |
| 16 | #include "core/hle/kernel/thread.h" | 17 | #include "core/hle/kernel/thread.h" |
| 17 | #include "core/hle/kernel/handle_table.h" | ||
| 18 | #include "core/hle/service/am/am.h" | 18 | #include "core/hle/service/am/am.h" |
| 19 | #include "core/hle/service/apm/apm.h" | 19 | #include "core/hle/service/apm/apm.h" |
| 20 | #include "core/hle/service/dsp_dsp.h" | 20 | #include "core/hle/service/dsp_dsp.h" |
| @@ -82,7 +82,8 @@ void ServiceFrameworkBase::RegisterHandlersBase(const FunctionInfoBase* function | |||
| 82 | } | 82 | } |
| 83 | } | 83 | } |
| 84 | 84 | ||
| 85 | void ServiceFrameworkBase::ReportUnimplementedFunction(Kernel::HLERequestContext& ctx, const FunctionInfoBase* info) { | 85 | void ServiceFrameworkBase::ReportUnimplementedFunction(Kernel::HLERequestContext& ctx, |
| 86 | const FunctionInfoBase* info) { | ||
| 86 | auto cmd_buf = ctx.CommandBuffer(); | 87 | auto cmd_buf = ctx.CommandBuffer(); |
| 87 | std::string function_name = info == nullptr ? fmt::format("{:#08x}", cmd_buf[0]) : info->name; | 88 | std::string function_name = info == nullptr ? fmt::format("{:#08x}", cmd_buf[0]) : info->name; |
| 88 | 89 | ||
| @@ -96,7 +97,7 @@ void ServiceFrameworkBase::ReportUnimplementedFunction(Kernel::HLERequestContext | |||
| 96 | 97 | ||
| 97 | LOG_ERROR(Service, "unknown / unimplemented %s", w.c_str()); | 98 | LOG_ERROR(Service, "unknown / unimplemented %s", w.c_str()); |
| 98 | // TODO(bunnei): Hack - ignore error | 99 | // TODO(bunnei): Hack - ignore error |
| 99 | IPC::RequestBuilder rb{ ctx, 1 }; | 100 | IPC::RequestBuilder rb{ctx, 1}; |
| 100 | rb.Push(RESULT_SUCCESS); | 101 | rb.Push(RESULT_SUCCESS); |
| 101 | } | 102 | } |
| 102 | 103 | ||
| @@ -107,13 +108,14 @@ void ServiceFrameworkBase::InvokeRequest(Kernel::HLERequestContext& ctx) { | |||
| 107 | return ReportUnimplementedFunction(ctx, info); | 108 | return ReportUnimplementedFunction(ctx, info); |
| 108 | } | 109 | } |
| 109 | 110 | ||
| 110 | LOG_TRACE(Service, "%s", | 111 | LOG_TRACE( |
| 112 | Service, "%s", | ||
| 111 | MakeFunctionString(info->name, GetServiceName().c_str(), ctx.CommandBuffer()).c_str()); | 113 | MakeFunctionString(info->name, GetServiceName().c_str(), ctx.CommandBuffer()).c_str()); |
| 112 | handler_invoker(this, info->handler_callback, ctx); | 114 | handler_invoker(this, info->handler_callback, ctx); |
| 113 | } | 115 | } |
| 114 | 116 | ||
| 115 | void ServiceFrameworkBase::HandleSyncRequest(SharedPtr<ServerSession> server_session) { | 117 | void ServiceFrameworkBase::HandleSyncRequest(SharedPtr<ServerSession> server_session) { |
| 116 | u32* cmd_buf = (u32*)Memory::GetPointer(Kernel::GetCurrentThread()->GetTLSAddress());; | 118 | u32* cmd_buf = (u32*)Memory::GetPointer(Kernel::GetCurrentThread()->GetTLSAddress()); |
| 117 | 119 | ||
| 118 | // TODO(yuriks): The kernel should be the one handling this as part of translation after | 120 | // TODO(yuriks): The kernel should be the one handling this as part of translation after |
| 119 | // everything else is migrated | 121 | // everything else is migrated |
| @@ -122,19 +124,16 @@ void ServiceFrameworkBase::HandleSyncRequest(SharedPtr<ServerSession> server_ses | |||
| 122 | Kernel::g_handle_table); | 124 | Kernel::g_handle_table); |
| 123 | 125 | ||
| 124 | switch (context.GetCommandType()) { | 126 | switch (context.GetCommandType()) { |
| 125 | case IPC::CommandType::Close: | 127 | case IPC::CommandType::Close: { |
| 126 | { | ||
| 127 | IPC::RequestBuilder rb{context, 1}; | 128 | IPC::RequestBuilder rb{context, 1}; |
| 128 | rb.Push(RESULT_SUCCESS); | 129 | rb.Push(RESULT_SUCCESS); |
| 129 | break; | 130 | break; |
| 130 | } | 131 | } |
| 131 | case IPC::CommandType::Control: | 132 | case IPC::CommandType::Control: { |
| 132 | { | ||
| 133 | SM::g_service_manager->InvokeControlRequest(context); | 133 | SM::g_service_manager->InvokeControlRequest(context); |
| 134 | break; | 134 | break; |
| 135 | } | 135 | } |
| 136 | case IPC::CommandType::Request: | 136 | case IPC::CommandType::Request: { |
| 137 | { | ||
| 138 | InvokeRequest(context); | 137 | InvokeRequest(context); |
| 139 | break; | 138 | break; |
| 140 | } | 139 | } |
| @@ -176,4 +175,4 @@ void Shutdown() { | |||
| 176 | g_kernel_named_ports.clear(); | 175 | g_kernel_named_ports.clear(); |
| 177 | LOG_DEBUG(Service, "shutdown OK"); | 176 | LOG_DEBUG(Service, "shutdown OK"); |
| 178 | } | 177 | } |
| 179 | } | 178 | } // namespace Service |