summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2018-03-18 20:18:42 -0400
committerGravatar bunnei2018-03-18 20:56:33 -0400
commit2faa83ca13c766d0b510f62462d63b971e3a72e6 (patch)
tree0dcc75e59feb4f0082beb8cd70e96710aec0dd66 /src
parenthle_ipc: Remove GetPointer(..) usage with WriteToOutgoingCommandBuffer. (diff)
downloadyuzu-2faa83ca13c766d0b510f62462d63b971e3a72e6.tar.gz
yuzu-2faa83ca13c766d0b510f62462d63b971e3a72e6.tar.xz
yuzu-2faa83ca13c766d0b510f62462d63b971e3a72e6.zip
hle_ipc: Use shared_ptr instead of unique_ptr to allow copies.
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/kernel/hle_ipc.cpp8
-rw-r--r--src/core/hle/kernel/hle_ipc.h10
2 files changed, 9 insertions, 9 deletions
diff --git a/src/core/hle/kernel/hle_ipc.cpp b/src/core/hle/kernel/hle_ipc.cpp
index f30f8739c..aae14f09e 100644
--- a/src/core/hle/kernel/hle_ipc.cpp
+++ b/src/core/hle/kernel/hle_ipc.cpp
@@ -35,7 +35,7 @@ HLERequestContext::~HLERequestContext() = default;
35 35
36void HLERequestContext::ParseCommandBuffer(u32_le* src_cmdbuf, bool incoming) { 36void HLERequestContext::ParseCommandBuffer(u32_le* src_cmdbuf, bool incoming) {
37 IPC::RequestParser rp(src_cmdbuf); 37 IPC::RequestParser rp(src_cmdbuf);
38 command_header = std::make_unique<IPC::CommandHeader>(rp.PopRaw<IPC::CommandHeader>()); 38 command_header = std::make_shared<IPC::CommandHeader>(rp.PopRaw<IPC::CommandHeader>());
39 39
40 if (command_header->type == IPC::CommandType::Close) { 40 if (command_header->type == IPC::CommandType::Close) {
41 // Close does not populate the rest of the IPC header 41 // Close does not populate the rest of the IPC header
@@ -45,7 +45,7 @@ void HLERequestContext::ParseCommandBuffer(u32_le* src_cmdbuf, bool incoming) {
45 // If handle descriptor is present, add size of it 45 // If handle descriptor is present, add size of it
46 if (command_header->enable_handle_descriptor) { 46 if (command_header->enable_handle_descriptor) {
47 handle_descriptor_header = 47 handle_descriptor_header =
48 std::make_unique<IPC::HandleDescriptorHeader>(rp.PopRaw<IPC::HandleDescriptorHeader>()); 48 std::make_shared<IPC::HandleDescriptorHeader>(rp.PopRaw<IPC::HandleDescriptorHeader>());
49 if (handle_descriptor_header->send_current_pid) { 49 if (handle_descriptor_header->send_current_pid) {
50 rp.Skip(2, false); 50 rp.Skip(2, false);
51 } 51 }
@@ -88,7 +88,7 @@ void HLERequestContext::ParseCommandBuffer(u32_le* src_cmdbuf, bool incoming) {
88 // All outgoing domain messages have the domain header, if only incoming has it 88 // All outgoing domain messages have the domain header, if only incoming has it
89 if (incoming || domain_message_header) { 89 if (incoming || domain_message_header) {
90 domain_message_header = 90 domain_message_header =
91 std::make_unique<IPC::DomainMessageHeader>(rp.PopRaw<IPC::DomainMessageHeader>()); 91 std::make_shared<IPC::DomainMessageHeader>(rp.PopRaw<IPC::DomainMessageHeader>());
92 } else { 92 } else {
93 if (Session()->IsDomain()) 93 if (Session()->IsDomain())
94 LOG_WARNING(IPC, "Domain request has no DomainMessageHeader!"); 94 LOG_WARNING(IPC, "Domain request has no DomainMessageHeader!");
@@ -96,7 +96,7 @@ void HLERequestContext::ParseCommandBuffer(u32_le* src_cmdbuf, bool incoming) {
96 } 96 }
97 97
98 data_payload_header = 98 data_payload_header =
99 std::make_unique<IPC::DataPayloadHeader>(rp.PopRaw<IPC::DataPayloadHeader>()); 99 std::make_shared<IPC::DataPayloadHeader>(rp.PopRaw<IPC::DataPayloadHeader>());
100 100
101 data_payload_offset = rp.GetCurrentOffset(); 101 data_payload_offset = rp.GetCurrentOffset();
102 102
diff --git a/src/core/hle/kernel/hle_ipc.h b/src/core/hle/kernel/hle_ipc.h
index 743835f18..b5cc0d0af 100644
--- a/src/core/hle/kernel/hle_ipc.h
+++ b/src/core/hle/kernel/hle_ipc.h
@@ -139,7 +139,7 @@ public:
139 return buffer_c_desciptors; 139 return buffer_c_desciptors;
140 } 140 }
141 141
142 const std::unique_ptr<IPC::DomainMessageHeader>& GetDomainMessageHeader() const { 142 const std::shared_ptr<IPC::DomainMessageHeader>& GetDomainMessageHeader() const {
143 return domain_message_header; 143 return domain_message_header;
144 } 144 }
145 145
@@ -212,10 +212,10 @@ private:
212 boost::container::small_vector<SharedPtr<Object>, 8> copy_objects; 212 boost::container::small_vector<SharedPtr<Object>, 8> copy_objects;
213 boost::container::small_vector<std::shared_ptr<SessionRequestHandler>, 8> domain_objects; 213 boost::container::small_vector<std::shared_ptr<SessionRequestHandler>, 8> domain_objects;
214 214
215 std::unique_ptr<IPC::CommandHeader> command_header; 215 std::shared_ptr<IPC::CommandHeader> command_header;
216 std::unique_ptr<IPC::HandleDescriptorHeader> handle_descriptor_header; 216 std::shared_ptr<IPC::HandleDescriptorHeader> handle_descriptor_header;
217 std::unique_ptr<IPC::DataPayloadHeader> data_payload_header; 217 std::shared_ptr<IPC::DataPayloadHeader> data_payload_header;
218 std::unique_ptr<IPC::DomainMessageHeader> domain_message_header; 218 std::shared_ptr<IPC::DomainMessageHeader> domain_message_header;
219 std::vector<IPC::BufferDescriptorX> buffer_x_desciptors; 219 std::vector<IPC::BufferDescriptorX> buffer_x_desciptors;
220 std::vector<IPC::BufferDescriptorABW> buffer_a_desciptors; 220 std::vector<IPC::BufferDescriptorABW> buffer_a_desciptors;
221 std::vector<IPC::BufferDescriptorABW> buffer_b_desciptors; 221 std::vector<IPC::BufferDescriptorABW> buffer_b_desciptors;