From ed25191ee634c3cd0df11b25407809c2ba4fe422 Mon Sep 17 00:00:00 2001 From: bunnei Date: Sat, 8 May 2021 02:50:47 -0700 Subject: hle: kernel: Further cleanup and add TIPC helpers. --- src/core/hle/kernel/hle_ipc.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/core/hle/kernel/hle_ipc.h') diff --git a/src/core/hle/kernel/hle_ipc.h b/src/core/hle/kernel/hle_ipc.h index 7cdde2294..07360629e 100644 --- a/src/core/hle/kernel/hle_ipc.h +++ b/src/core/hle/kernel/hle_ipc.h @@ -128,10 +128,19 @@ public: /// Writes data from this context back to the requesting process/thread. ResultCode WriteToOutgoingCommandBuffer(KThread& requesting_thread); - u32_le GetCommand() const { + u32_le GetHipcCommand() const { return command; } + u32_le GetTipcCommand() const { + return static_cast(command_header->type.Value()) - + static_cast(IPC::CommandType::TIPC_CommandRegion); + } + + u32_le GetCommand() const { + return command_header->IsTipc() ? GetTipcCommand() : GetHipcCommand(); + } + bool IsTipc() const { return command_header->IsTipc(); } @@ -140,7 +149,7 @@ public: return command_header->type; } - unsigned GetDataPayloadOffset() const { + u32 GetDataPayloadOffset() const { return data_payload_offset; } @@ -296,7 +305,6 @@ private: std::vector buffer_c_desciptors; u32 data_payload_offset{}; - u32 buffer_c_offset{}; u32 handles_offset{}; u32 domain_offset{}; u32_le command{}; -- cgit v1.2.3