diff options
| author | 2017-10-15 01:24:22 -0400 | |
|---|---|---|
| committer | 2017-10-15 01:24:22 -0400 | |
| commit | 4fb1b24d68e140230da612d464a5edc226860946 (patch) | |
| tree | ed6cc24d62caf4476737508de317908a6cb23e90 /src | |
| 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')
| -rw-r--r-- | src/core/hle/ipc.h | 10 | ||||
| -rw-r--r-- | src/core/hle/ipc_helpers.h | 2 | ||||
| -rw-r--r-- | src/core/hle/kernel/hle_ipc.cpp | 23 | ||||
| -rw-r--r-- | src/core/hle/kernel/hle_ipc.h | 3 | ||||
| -rw-r--r-- | src/core/hle/kernel/server_session.h | 10 | ||||
| -rw-r--r-- | src/core/hle/service/lm/lm.cpp | 6 | ||||
| -rw-r--r-- | src/core/hle/service/service.cpp | 23 | ||||
| -rw-r--r-- | src/core/hle/service/sm/controller.cpp | 30 | ||||
| -rw-r--r-- | src/core/hle/service/sm/controller.h | 1 | ||||
| -rw-r--r-- | src/core/hle/service/sm/sm.cpp | 7 |
10 files changed, 82 insertions, 33 deletions
diff --git a/src/core/hle/ipc.h b/src/core/hle/ipc.h index 2f8a520ba..16f51a635 100644 --- a/src/core/hle/ipc.h +++ b/src/core/hle/ipc.h | |||
| @@ -144,6 +144,16 @@ struct DataPayloadHeader { | |||
| 144 | }; | 144 | }; |
| 145 | static_assert(sizeof(DataPayloadHeader) == 8, "DataPayloadRequest size is incorrect"); | 145 | static_assert(sizeof(DataPayloadHeader) == 8, "DataPayloadRequest size is incorrect"); |
| 146 | 146 | ||
| 147 | struct DomainMessageHeader { | ||
| 148 | union { | ||
| 149 | BitField<0, 8, u32_le> command; | ||
| 150 | BitField<16, 16, u32_le> size; | ||
| 151 | }; | ||
| 152 | u32_le object_id; | ||
| 153 | INSERT_PADDING_WORDS(2); | ||
| 154 | }; | ||
| 155 | static_assert(sizeof(DomainMessageHeader) == 16, "DomainMessageHeader size is incorrect"); | ||
| 156 | |||
| 147 | enum DescriptorType : u32 { | 157 | enum DescriptorType : u32 { |
| 148 | // Buffer related desciptors types (mask : 0x0F) | 158 | // Buffer related desciptors types (mask : 0x0F) |
| 149 | StaticBuffer = 0x02, | 159 | StaticBuffer = 0x02, |
diff --git a/src/core/hle/ipc_helpers.h b/src/core/hle/ipc_helpers.h index 083d3a0d0..41899c519 100644 --- a/src/core/hle/ipc_helpers.h +++ b/src/core/hle/ipc_helpers.h | |||
| @@ -80,7 +80,7 @@ public: | |||
| 80 | AlignWithPadding(); | 80 | AlignWithPadding(); |
| 81 | 81 | ||
| 82 | IPC::DataPayloadHeader data_payload_header{}; | 82 | IPC::DataPayloadHeader data_payload_header{}; |
| 83 | data_payload_header.magic = 0x4f434653; | 83 | data_payload_header.magic = Common::MakeMagic('S', 'F', 'C', 'O'); |
| 84 | PushRaw(data_payload_header); | 84 | PushRaw(data_payload_header); |
| 85 | } | 85 | } |
| 86 | 86 | ||
diff --git a/src/core/hle/kernel/hle_ipc.cpp b/src/core/hle/kernel/hle_ipc.cpp index b7070af03..35cac68f1 100644 --- a/src/core/hle/kernel/hle_ipc.cpp +++ b/src/core/hle/kernel/hle_ipc.cpp | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | #include <boost/range/algorithm_ext/erase.hpp> | 5 | #include <boost/range/algorithm_ext/erase.hpp> |
| 6 | #include "common/assert.h" | 6 | #include "common/assert.h" |
| 7 | #include "common/common_funcs.h" | ||
| 7 | #include "common/common_types.h" | 8 | #include "common/common_types.h" |
| 8 | #include "core/hle/ipc_helpers.h" | 9 | #include "core/hle/ipc_helpers.h" |
| 9 | #include "core/hle/kernel/handle_table.h" | 10 | #include "core/hle/kernel/handle_table.h" |
| @@ -45,10 +46,15 @@ void HLERequestContext::ClearIncomingObjects() { | |||
| 45 | request_handles.clear(); | 46 | request_handles.clear(); |
| 46 | } | 47 | } |
| 47 | 48 | ||
| 48 | void HLERequestContext::ParseCommandBuffer(u32_le* src_cmdbuf) { | 49 | void HLERequestContext::ParseCommandBuffer(u32_le* src_cmdbuf, bool incoming) { |
| 49 | IPC::RequestParser rp(src_cmdbuf); | 50 | IPC::RequestParser rp(src_cmdbuf); |
| 50 | command_header = std::make_unique<IPC::CommandHeader>(rp.PopRaw<IPC::CommandHeader>()); | 51 | command_header = std::make_unique<IPC::CommandHeader>(rp.PopRaw<IPC::CommandHeader>()); |
| 51 | 52 | ||
| 53 | if (command_header->type == IPC::CommandType::Close) { | ||
| 54 | // Close does not populate the rest of the IPC header | ||
| 55 | return; | ||
| 56 | } | ||
| 57 | |||
| 52 | // If handle descriptor is present, add size of it | 58 | // If handle descriptor is present, add size of it |
| 53 | if (command_header->enable_handle_descriptor) { | 59 | if (command_header->enable_handle_descriptor) { |
| 54 | handle_descriptor_header = | 60 | handle_descriptor_header = |
| @@ -80,9 +86,18 @@ void HLERequestContext::ParseCommandBuffer(u32_le* src_cmdbuf) { | |||
| 80 | UNIMPLEMENTED(); | 86 | UNIMPLEMENTED(); |
| 81 | } | 87 | } |
| 82 | 88 | ||
| 89 | if (incoming && Session()->IsDomain()) { | ||
| 90 | domain_message_header = std::make_unique<IPC::DomainMessageHeader>(rp.PopRaw<IPC::DomainMessageHeader>()); | ||
| 91 | } | ||
| 92 | |||
| 83 | data_payload_header = | 93 | data_payload_header = |
| 84 | std::make_unique<IPC::DataPayloadHeader>(rp.PopRaw<IPC::DataPayloadHeader>()); | 94 | std::make_unique<IPC::DataPayloadHeader>(rp.PopRaw<IPC::DataPayloadHeader>()); |
| 85 | ASSERT(data_payload_header->magic == 0x49434653 || data_payload_header->magic == 0x4F434653); | 95 | |
| 96 | if (incoming) { | ||
| 97 | ASSERT(data_payload_header->magic == Common::MakeMagic('S', 'F', 'C', 'I')); | ||
| 98 | } else { | ||
| 99 | ASSERT(data_payload_header->magic == Common::MakeMagic('S', 'F', 'C', 'O')); | ||
| 100 | } | ||
| 86 | 101 | ||
| 87 | data_payload_offset = rp.GetCurrentOffset(); | 102 | data_payload_offset = rp.GetCurrentOffset(); |
| 88 | command = rp.Pop<u32_le>(); | 103 | command = rp.Pop<u32_le>(); |
| @@ -91,7 +106,7 @@ void HLERequestContext::ParseCommandBuffer(u32_le* src_cmdbuf) { | |||
| 91 | ResultCode HLERequestContext::PopulateFromIncomingCommandBuffer(u32_le* src_cmdbuf, | 106 | ResultCode HLERequestContext::PopulateFromIncomingCommandBuffer(u32_le* src_cmdbuf, |
| 92 | Process& src_process, | 107 | Process& src_process, |
| 93 | HandleTable& src_table) { | 108 | HandleTable& src_table) { |
| 94 | ParseCommandBuffer(src_cmdbuf); | 109 | ParseCommandBuffer(src_cmdbuf, true); |
| 95 | size_t untranslated_size = data_payload_offset + command_header->data_size; | 110 | size_t untranslated_size = data_payload_offset + command_header->data_size; |
| 96 | std::copy_n(src_cmdbuf, untranslated_size, cmd_buf.begin()); | 111 | std::copy_n(src_cmdbuf, untranslated_size, cmd_buf.begin()); |
| 97 | 112 | ||
| @@ -106,7 +121,7 @@ ResultCode HLERequestContext::PopulateFromIncomingCommandBuffer(u32_le* src_cmdb | |||
| 106 | 121 | ||
| 107 | ResultCode HLERequestContext::WriteToOutgoingCommandBuffer(u32_le* dst_cmdbuf, Process& dst_process, | 122 | ResultCode HLERequestContext::WriteToOutgoingCommandBuffer(u32_le* dst_cmdbuf, Process& dst_process, |
| 108 | HandleTable& dst_table) { | 123 | HandleTable& dst_table) { |
| 109 | ParseCommandBuffer(&cmd_buf[0]); | 124 | ParseCommandBuffer(&cmd_buf[0], false); |
| 110 | size_t untranslated_size = data_payload_offset + command_header->data_size; | 125 | size_t untranslated_size = data_payload_offset + command_header->data_size; |
| 111 | std::copy_n(cmd_buf.begin(), untranslated_size, dst_cmdbuf); | 126 | std::copy_n(cmd_buf.begin(), untranslated_size, dst_cmdbuf); |
| 112 | 127 | ||
diff --git a/src/core/hle/kernel/hle_ipc.h b/src/core/hle/kernel/hle_ipc.h index 32a528968..17baffc06 100644 --- a/src/core/hle/kernel/hle_ipc.h +++ b/src/core/hle/kernel/hle_ipc.h | |||
| @@ -119,7 +119,7 @@ public: | |||
| 119 | */ | 119 | */ |
| 120 | void ClearIncomingObjects(); | 120 | void ClearIncomingObjects(); |
| 121 | 121 | ||
| 122 | void ParseCommandBuffer(u32_le* src_cmdbuf); | 122 | void ParseCommandBuffer(u32_le* src_cmdbuf, bool incoming); |
| 123 | 123 | ||
| 124 | /// Populates this context with data from the requesting process/thread. | 124 | /// Populates this context with data from the requesting process/thread. |
| 125 | ResultCode PopulateFromIncomingCommandBuffer(u32_le* src_cmdbuf, Process& src_process, | 125 | ResultCode PopulateFromIncomingCommandBuffer(u32_le* src_cmdbuf, Process& src_process, |
| @@ -149,6 +149,7 @@ private: | |||
| 149 | std::unique_ptr<IPC::CommandHeader> command_header; | 149 | std::unique_ptr<IPC::CommandHeader> command_header; |
| 150 | std::unique_ptr<IPC::HandleDescriptorHeader> handle_descriptor_header; | 150 | std::unique_ptr<IPC::HandleDescriptorHeader> handle_descriptor_header; |
| 151 | std::unique_ptr<IPC::DataPayloadHeader> data_payload_header; | 151 | std::unique_ptr<IPC::DataPayloadHeader> data_payload_header; |
| 152 | std::unique_ptr<IPC::DomainMessageHeader> domain_message_header; | ||
| 152 | 153 | ||
| 153 | unsigned data_payload_offset{}; | 154 | unsigned data_payload_offset{}; |
| 154 | u32_le command{}; | 155 | u32_le command{}; |
diff --git a/src/core/hle/kernel/server_session.h b/src/core/hle/kernel/server_session.h index f4360ddf3..78db5510d 100644 --- a/src/core/hle/kernel/server_session.h +++ b/src/core/hle/kernel/server_session.h | |||
| @@ -91,6 +91,14 @@ public: | |||
| 91 | /// TODO(Subv): Find a better name for this. | 91 | /// TODO(Subv): Find a better name for this. |
| 92 | SharedPtr<Thread> currently_handling; | 92 | SharedPtr<Thread> currently_handling; |
| 93 | 93 | ||
| 94 | void ConvertToDomain() { | ||
| 95 | is_domain = true; | ||
| 96 | } | ||
| 97 | |||
| 98 | bool IsDomain() const { | ||
| 99 | return is_domain; | ||
| 100 | } | ||
| 101 | |||
| 94 | private: | 102 | private: |
| 95 | ServerSession(); | 103 | ServerSession(); |
| 96 | ~ServerSession() override; | 104 | ~ServerSession() override; |
| @@ -102,6 +110,8 @@ private: | |||
| 102 | * @return The created server session | 110 | * @return The created server session |
| 103 | */ | 111 | */ |
| 104 | static ResultVal<SharedPtr<ServerSession>> Create(std::string name = "Unknown"); | 112 | static ResultVal<SharedPtr<ServerSession>> Create(std::string name = "Unknown"); |
| 113 | |||
| 114 | bool is_domain{}; | ||
| 105 | }; | 115 | }; |
| 106 | 116 | ||
| 107 | /** | 117 | /** |
diff --git a/src/core/hle/service/lm/lm.cpp b/src/core/hle/service/lm/lm.cpp index 3c5fa7de3..d66ac55ca 100644 --- a/src/core/hle/service/lm/lm.cpp +++ b/src/core/hle/service/lm/lm.cpp | |||
| @@ -18,7 +18,7 @@ void InstallInterfaces(SM::ServiceManager& service_manager) { | |||
| 18 | * Inputs: | 18 | * Inputs: |
| 19 | * 0: 0x00000000 | 19 | * 0: 0x00000000 |
| 20 | * Outputs: | 20 | * Outputs: |
| 21 | * 1: ResultCode | 21 | * 0: ResultCode |
| 22 | */ | 22 | */ |
| 23 | void LM::Initialize(Kernel::HLERequestContext& ctx) { | 23 | void LM::Initialize(Kernel::HLERequestContext& ctx) { |
| 24 | IPC::RequestBuilder rb{ctx, 1}; | 24 | IPC::RequestBuilder rb{ctx, 1}; |
| @@ -29,10 +29,6 @@ void LM::Initialize(Kernel::HLERequestContext& ctx) { | |||
| 29 | LM::LM() : ServiceFramework("lm") { | 29 | LM::LM() : ServiceFramework("lm") { |
| 30 | static const FunctionInfo functions[] = { | 30 | static const FunctionInfo functions[] = { |
| 31 | {0x00000000, &LM::Initialize, "Initialize"}, | 31 | {0x00000000, &LM::Initialize, "Initialize"}, |
| 32 | {0x00000001, nullptr, "Unknown2"}, | ||
| 33 | {0x00000002, nullptr, "Unknown3"}, | ||
| 34 | {0x00000003, nullptr, "Unknown4"}, | ||
| 35 | {0x00000004, nullptr, "Unknown5"}, | ||
| 36 | }; | 32 | }; |
| 37 | RegisterHandlers(functions); | 33 | RegisterHandlers(functions); |
| 38 | } | 34 | } |
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 |
diff --git a/src/core/hle/service/sm/controller.cpp b/src/core/hle/service/sm/controller.cpp index 4b250d6ba..174ee8161 100644 --- a/src/core/hle/service/sm/controller.cpp +++ b/src/core/hle/service/sm/controller.cpp | |||
| @@ -10,24 +10,42 @@ namespace Service { | |||
| 10 | namespace SM { | 10 | namespace SM { |
| 11 | 11 | ||
| 12 | /** | 12 | /** |
| 13 | * Controller::ConvertSessionToDomain service function | ||
| 14 | * Inputs: | ||
| 15 | * 0: 0x00000000 | ||
| 16 | * Outputs: | ||
| 17 | * 0: ResultCode | ||
| 18 | * 2: Handle of domain | ||
| 19 | */ | ||
| 20 | void Controller::ConvertSessionToDomain(Kernel::HLERequestContext& ctx) { | ||
| 21 | ctx.Session()->ConvertToDomain(); | ||
| 22 | IPC::RequestBuilder rb{ctx, 3}; | ||
| 23 | rb.Push(RESULT_SUCCESS); | ||
| 24 | rb.Skip(1, true); | ||
| 25 | Kernel::Handle handle = Kernel::g_handle_table.Create(ctx.Session()).Unwrap(); | ||
| 26 | rb.Push(handle); | ||
| 27 | LOG_DEBUG(Service, "called, handle=0x%08x", handle); | ||
| 28 | } | ||
| 29 | |||
| 30 | /** | ||
| 13 | * Controller::QueryPointerBufferSize service function | 31 | * Controller::QueryPointerBufferSize service function |
| 14 | * Inputs: | 32 | * Inputs: |
| 15 | * 0: 0x00000003 | 33 | * 0: 0x00000003 |
| 16 | * Outputs: | 34 | * Outputs: |
| 17 | * 1: ResultCode | 35 | * 0: ResultCode |
| 18 | * 3: Size of memory | 36 | * 2: Size of memory |
| 19 | */ | 37 | */ |
| 20 | void Controller::QueryPointerBufferSize(Kernel::HLERequestContext& ctx) { | 38 | void Controller::QueryPointerBufferSize(Kernel::HLERequestContext& ctx) { |
| 21 | IPC::RequestBuilder rb{ctx, 2}; | 39 | IPC::RequestBuilder rb{ctx, 3}; |
| 22 | rb.Push(RESULT_SUCCESS); | 40 | rb.Push(RESULT_SUCCESS); |
| 23 | rb.Push(0x0U); | 41 | rb.Skip(1, true); |
| 24 | rb.Push(0x500U); | 42 | rb.Push<u32>(0x500); |
| 25 | LOG_WARNING(Service, "(STUBBED) called"); | 43 | LOG_WARNING(Service, "(STUBBED) called"); |
| 26 | } | 44 | } |
| 27 | 45 | ||
| 28 | Controller::Controller() : ServiceFramework("IpcController") { | 46 | Controller::Controller() : ServiceFramework("IpcController") { |
| 29 | static const FunctionInfo functions[] = { | 47 | static const FunctionInfo functions[] = { |
| 30 | {0x00000000, nullptr, "ConvertSessionToDomain"}, | 48 | {0x00000000, &Controller::ConvertSessionToDomain, "ConvertSessionToDomain"}, |
| 31 | {0x00000001, nullptr, "ConvertDomainToSession"}, | 49 | {0x00000001, nullptr, "ConvertDomainToSession"}, |
| 32 | {0x00000002, nullptr, "DuplicateSession"}, | 50 | {0x00000002, nullptr, "DuplicateSession"}, |
| 33 | {0x00000003, &Controller::QueryPointerBufferSize, "QueryPointerBufferSize"}, | 51 | {0x00000003, &Controller::QueryPointerBufferSize, "QueryPointerBufferSize"}, |
diff --git a/src/core/hle/service/sm/controller.h b/src/core/hle/service/sm/controller.h index c6aa6f502..bb5a815f8 100644 --- a/src/core/hle/service/sm/controller.h +++ b/src/core/hle/service/sm/controller.h | |||
| @@ -15,6 +15,7 @@ public: | |||
| 15 | ~Controller(); | 15 | ~Controller(); |
| 16 | 16 | ||
| 17 | private: | 17 | private: |
| 18 | void ConvertSessionToDomain(Kernel::HLERequestContext& ctx); | ||
| 18 | void QueryPointerBufferSize(Kernel::HLERequestContext& ctx); | 19 | void QueryPointerBufferSize(Kernel::HLERequestContext& ctx); |
| 19 | }; | 20 | }; |
| 20 | 21 | ||
diff --git a/src/core/hle/service/sm/sm.cpp b/src/core/hle/service/sm/sm.cpp index b027651d0..e77ec8df9 100644 --- a/src/core/hle/service/sm/sm.cpp +++ b/src/core/hle/service/sm/sm.cpp | |||
| @@ -80,7 +80,7 @@ std::shared_ptr<ServiceManager> g_service_manager; | |||
| 80 | * Inputs: | 80 | * Inputs: |
| 81 | * 0: 0x00000000 | 81 | * 0: 0x00000000 |
| 82 | * Outputs: | 82 | * Outputs: |
| 83 | * 1: ResultCode | 83 | * 0: ResultCode |
| 84 | */ | 84 | */ |
| 85 | void SM::Initialize(Kernel::HLERequestContext& ctx) { | 85 | void SM::Initialize(Kernel::HLERequestContext& ctx) { |
| 86 | IPC::RequestBuilder rb{ctx, 1}; | 86 | IPC::RequestBuilder rb{ctx, 1}; |
| @@ -89,15 +89,14 @@ void SM::Initialize(Kernel::HLERequestContext& ctx) { | |||
| 89 | } | 89 | } |
| 90 | 90 | ||
| 91 | /** | 91 | /** |
| 92 | * SM::GetServiceHandle service function | 92 | * SM::GetService service function |
| 93 | * Inputs: | 93 | * Inputs: |
| 94 | * 0: 0x00000001 | 94 | * 0: 0x00000001 |
| 95 | * 1: Unknown | 95 | * 1: Unknown |
| 96 | * 2: Unknown | 96 | * 2: Unknown |
| 97 | * 3-4: 8-byte UTF-8 service name | 97 | * 3-4: 8-byte UTF-8 service name |
| 98 | * Outputs: | 98 | * Outputs: |
| 99 | * 1: ResultCode | 99 | * 0: ResultCode |
| 100 | * 3: Service handle | ||
| 101 | */ | 100 | */ |
| 102 | void SM::GetService(Kernel::HLERequestContext& ctx) { | 101 | void SM::GetService(Kernel::HLERequestContext& ctx) { |
| 103 | IPC::RequestParser rp{ctx}; | 102 | IPC::RequestParser rp{ctx}; |