From ea82203780d8f0666d48cc07a3700fb121f6e30c Mon Sep 17 00:00:00 2001 From: wwylele Date: Sat, 10 Mar 2018 13:25:22 +0200 Subject: [PATCH] ipc_helper: remove interface for operating on command buffer directly Now IPC helpers are only supposed to use on top of ServiceFramework --- src/core/hle/ipc_helpers.h | 35 ++------------------------------ src/core/hle/service/service.cpp | 1 + 2 files changed, 3 insertions(+), 33 deletions(-) diff --git a/src/core/hle/ipc_helpers.h b/src/core/hle/ipc_helpers.h index 98575da030..dc6c7bf7d2 100644 --- a/src/core/hle/ipc_helpers.h +++ b/src/core/hle/ipc_helpers.h @@ -10,7 +10,6 @@ #include #include #include "core/hle/ipc.h" -#include "core/hle/kernel/handle_table.h" #include "core/hle/kernel/hle_ipc.h" #include "core/hle/kernel/kernel.h" @@ -18,7 +17,7 @@ namespace IPC { class RequestHelperBase { protected: - Kernel::HLERequestContext* context = nullptr; + Kernel::HLERequestContext* context; u32* cmdbuf; ptrdiff_t index = 1; Header header; @@ -27,9 +26,6 @@ public: RequestHelperBase(Kernel::HLERequestContext& context, Header desired_header) : context(&context), cmdbuf(context.CommandBuffer()), header(desired_header) {} - RequestHelperBase(u32* command_buffer, Header command_header) - : cmdbuf(command_buffer), header(command_header) {} - /// Returns the total size of the request in words size_t TotalSize() const { return 1 /* command header */ + header.normal_params_size + header.translate_params_size; @@ -62,19 +58,6 @@ public: : RequestBuilder( context, Header{MakeHeader(command_id, normal_params_size, translate_params_size)}) {} - RequestBuilder(u32* command_buffer, Header command_header) - : RequestHelperBase(command_buffer, command_header) { - cmdbuf[0] = header.raw; - } - - explicit RequestBuilder(u32* command_buffer, u32 command_header) - : RequestBuilder(command_buffer, Header{command_header}) {} - - RequestBuilder(u32* command_buffer, u16 command_id, unsigned normal_params_size, - unsigned translate_params_size) - : RequestBuilder(command_buffer, - MakeHeader(command_id, normal_params_size, translate_params_size)) {} - // Validate on destruction, as there shouldn't be any case where we don't want it ~RequestBuilder() { ValidateHeader(); @@ -217,27 +200,13 @@ public: Header{MakeHeader(command_id, normal_params_size, translate_params_size)}) { } - RequestParser(u32* command_buffer, Header command_header) - : RequestHelperBase(command_buffer, command_header) {} - - explicit RequestParser(u32* command_buffer, u32 command_header) - : RequestParser(command_buffer, Header{command_header}) {} - - RequestParser(u32* command_buffer, u16 command_id, unsigned normal_params_size, - unsigned translate_params_size) - : RequestParser(command_buffer, - MakeHeader(command_id, normal_params_size, translate_params_size)) {} - RequestBuilder MakeBuilder(u32 normal_params_size, u32 translate_params_size, bool validateHeader = true) { if (validateHeader) ValidateHeader(); Header builderHeader{MakeHeader(static_cast(header.command_id), normal_params_size, translate_params_size)}; - if (context != nullptr) - return {*context, builderHeader}; - else - return {cmdbuf, builderHeader}; + return {*context, builderHeader}; } template diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp index dde75a29ff..9e50617bb3 100644 --- a/src/core/hle/service/service.cpp +++ b/src/core/hle/service/service.cpp @@ -9,6 +9,7 @@ #include "common/string_util.h" #include "core/hle/ipc.h" #include "core/hle/kernel/client_port.h" +#include "core/hle/kernel/handle_table.h" #include "core/hle/kernel/process.h" #include "core/hle/kernel/server_port.h" #include "core/hle/kernel/server_session.h"