summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-05-08 11:50:47 +0200
committerbunnei <bunneidev@gmail.com>2021-05-11 00:05:10 +0200
commited25191ee634c3cd0df11b25407809c2ba4fe422 (patch)
tree45811424eed998ac573477cf16c92d43d05c7819 /src/core
parenthle: ipc_helpers: Update IPC response generation for TIPC. (diff)
downloadyuzu-ed25191ee634c3cd0df11b25407809c2ba4fe422.tar
yuzu-ed25191ee634c3cd0df11b25407809c2ba4fe422.tar.gz
yuzu-ed25191ee634c3cd0df11b25407809c2ba4fe422.tar.bz2
yuzu-ed25191ee634c3cd0df11b25407809c2ba4fe422.tar.lz
yuzu-ed25191ee634c3cd0df11b25407809c2ba4fe422.tar.xz
yuzu-ed25191ee634c3cd0df11b25407809c2ba4fe422.tar.zst
yuzu-ed25191ee634c3cd0df11b25407809c2ba4fe422.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hle/kernel/hle_ipc.cpp2
-rw-r--r--src/core/hle/kernel/hle_ipc.h14
2 files changed, 12 insertions, 4 deletions
diff --git a/src/core/hle/kernel/hle_ipc.cpp b/src/core/hle/kernel/hle_ipc.cpp
index 93907f75e..d6929d2c0 100644
--- a/src/core/hle/kernel/hle_ipc.cpp
+++ b/src/core/hle/kernel/hle_ipc.cpp
@@ -99,7 +99,7 @@ void HLERequestContext::ParseCommandBuffer(const KHandleTable& handle_table, u32
buffer_w_desciptors.push_back(rp.PopRaw<IPC::BufferDescriptorABW>());
}
- buffer_c_offset = rp.GetCurrentOffset() + command_header->data_size;
+ const auto buffer_c_offset = rp.GetCurrentOffset() + command_header->data_size;
// Padding to align to 16 bytes
rp.AlignWithPadding();
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<u32_le>(command_header->type.Value()) -
+ static_cast<u32_le>(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<IPC::BufferDescriptorC> buffer_c_desciptors;
u32 data_payload_offset{};
- u32 buffer_c_offset{};
u32 handles_offset{};
u32 domain_offset{};
u32_le command{};