summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorph <39850852+Morph1984@users.noreply.github.com>2021-03-12 16:13:31 +0100
committerMorph <39850852+Morph1984@users.noreply.github.com>2021-04-15 07:53:16 +0200
commite3e6a11ab8fc14a99bce35eb6fd860d583f255d8 (patch)
tree4e67f84f2cb516e2a8f00c8059bbbc4cd71928d7
parentILibraryAppletAccessor: Demote from ERROR to DEBUG for null storage logs (diff)
downloadyuzu-e3e6a11ab8fc14a99bce35eb6fd860d583f255d8.tar
yuzu-e3e6a11ab8fc14a99bce35eb6fd860d583f255d8.tar.gz
yuzu-e3e6a11ab8fc14a99bce35eb6fd860d583f255d8.tar.bz2
yuzu-e3e6a11ab8fc14a99bce35eb6fd860d583f255d8.tar.lz
yuzu-e3e6a11ab8fc14a99bce35eb6fd860d583f255d8.tar.xz
yuzu-e3e6a11ab8fc14a99bce35eb6fd860d583f255d8.tar.zst
yuzu-e3e6a11ab8fc14a99bce35eb6fd860d583f255d8.zip
-rw-r--r--src/core/hle/kernel/hle_ipc.cpp8
-rw-r--r--src/core/hle/kernel/hle_ipc.h10
2 files changed, 16 insertions, 2 deletions
diff --git a/src/core/hle/kernel/hle_ipc.cpp b/src/core/hle/kernel/hle_ipc.cpp
index 161d9f782..2b363b1d9 100644
--- a/src/core/hle/kernel/hle_ipc.cpp
+++ b/src/core/hle/kernel/hle_ipc.cpp
@@ -75,10 +75,14 @@ void HLERequestContext::ParseCommandBuffer(const HandleTable& handle_table, u32_
if (incoming) {
// Populate the object lists with the data in the IPC request.
for (u32 handle = 0; handle < handle_descriptor_header->num_handles_to_copy; ++handle) {
- copy_objects.push_back(handle_table.GetGeneric(rp.Pop<Handle>()));
+ const u32 copy_handle{rp.Pop<Handle>()};
+ copy_handles.push_back(copy_handle);
+ copy_objects.push_back(handle_table.GetGeneric(copy_handle));
}
for (u32 handle = 0; handle < handle_descriptor_header->num_handles_to_move; ++handle) {
- move_objects.push_back(handle_table.GetGeneric(rp.Pop<Handle>()));
+ const u32 move_handle{rp.Pop<Handle>()};
+ move_handles.push_back(move_handle);
+ move_objects.push_back(handle_table.GetGeneric(move_handle));
}
} else {
// For responses we just ignore the handles, they're empty and will be populated when
diff --git a/src/core/hle/kernel/hle_ipc.h b/src/core/hle/kernel/hle_ipc.h
index 9a769781b..6fba42615 100644
--- a/src/core/hle/kernel/hle_ipc.h
+++ b/src/core/hle/kernel/hle_ipc.h
@@ -210,6 +210,14 @@ public:
/// Helper function to test whether the output buffer at buffer_index can be written
bool CanWriteBuffer(std::size_t buffer_index = 0) const;
+ Handle GetCopyHandle(std::size_t index) const {
+ return copy_handles.at(index);
+ }
+
+ Handle GetMoveHandle(std::size_t index) const {
+ return move_handles.at(index);
+ }
+
template <typename T>
std::shared_ptr<T> GetCopyObject(std::size_t index) {
return DynamicObjectCast<T>(copy_objects.at(index));
@@ -285,6 +293,8 @@ private:
std::shared_ptr<Kernel::ServerSession> server_session;
std::shared_ptr<KThread> thread;
// TODO(yuriks): Check common usage of this and optimize size accordingly
+ boost::container::small_vector<Handle, 8> move_handles;
+ boost::container::small_vector<Handle, 8> copy_handles;
boost::container::small_vector<std::shared_ptr<Object>, 8> move_objects;
boost::container::small_vector<std::shared_ptr<Object>, 8> copy_objects;
boost::container::small_vector<std::shared_ptr<SessionRequestHandler>, 8> domain_objects;