diff options
| author | 2021-05-20 21:40:03 -0700 | |
|---|---|---|
| committer | 2021-05-20 21:40:03 -0700 | |
| commit | ea4e4b05e4c05b704646a65a4bf98f218dbb867a (patch) | |
| tree | aeb2043455960c61320458a0667d7c165a52e479 | |
| parent | Merge pull request #6321 from lat9nq/per-game-cpu (diff) | |
| parent | hle_ipc: unsigned -> u32 (diff) | |
| download | yuzu-ea4e4b05e4c05b704646a65a4bf98f218dbb867a.tar.gz yuzu-ea4e4b05e4c05b704646a65a4bf98f218dbb867a.tar.xz yuzu-ea4e4b05e4c05b704646a65a4bf98f218dbb867a.zip | |
Merge pull request #6320 from Morph1984/get-pid
hle_ipc: Add a getter for PID
Diffstat (limited to '')
| -rw-r--r-- | src/core/hle/kernel/hle_ipc.cpp | 16 | ||||
| -rw-r--r-- | src/core/hle/kernel/hle_ipc.h | 7 |
2 files changed, 14 insertions, 9 deletions
diff --git a/src/core/hle/kernel/hle_ipc.cpp b/src/core/hle/kernel/hle_ipc.cpp index ce3466df8..24700f7a5 100644 --- a/src/core/hle/kernel/hle_ipc.cpp +++ b/src/core/hle/kernel/hle_ipc.cpp | |||
| @@ -64,7 +64,7 @@ void HLERequestContext::ParseCommandBuffer(const KHandleTable& handle_table, u32 | |||
| 64 | if (command_header->enable_handle_descriptor) { | 64 | if (command_header->enable_handle_descriptor) { |
| 65 | handle_descriptor_header = rp.PopRaw<IPC::HandleDescriptorHeader>(); | 65 | handle_descriptor_header = rp.PopRaw<IPC::HandleDescriptorHeader>(); |
| 66 | if (handle_descriptor_header->send_current_pid) { | 66 | if (handle_descriptor_header->send_current_pid) { |
| 67 | rp.Skip(2, false); | 67 | pid = rp.Pop<u64>(); |
| 68 | } | 68 | } |
| 69 | if (incoming) { | 69 | if (incoming) { |
| 70 | // Populate the object lists with the data in the IPC request. | 70 | // Populate the object lists with the data in the IPC request. |
| @@ -86,16 +86,16 @@ void HLERequestContext::ParseCommandBuffer(const KHandleTable& handle_table, u32 | |||
| 86 | } | 86 | } |
| 87 | } | 87 | } |
| 88 | 88 | ||
| 89 | for (unsigned i = 0; i < command_header->num_buf_x_descriptors; ++i) { | 89 | for (u32 i = 0; i < command_header->num_buf_x_descriptors; ++i) { |
| 90 | buffer_x_desciptors.push_back(rp.PopRaw<IPC::BufferDescriptorX>()); | 90 | buffer_x_desciptors.push_back(rp.PopRaw<IPC::BufferDescriptorX>()); |
| 91 | } | 91 | } |
| 92 | for (unsigned i = 0; i < command_header->num_buf_a_descriptors; ++i) { | 92 | for (u32 i = 0; i < command_header->num_buf_a_descriptors; ++i) { |
| 93 | buffer_a_desciptors.push_back(rp.PopRaw<IPC::BufferDescriptorABW>()); | 93 | buffer_a_desciptors.push_back(rp.PopRaw<IPC::BufferDescriptorABW>()); |
| 94 | } | 94 | } |
| 95 | for (unsigned i = 0; i < command_header->num_buf_b_descriptors; ++i) { | 95 | for (u32 i = 0; i < command_header->num_buf_b_descriptors; ++i) { |
| 96 | buffer_b_desciptors.push_back(rp.PopRaw<IPC::BufferDescriptorABW>()); | 96 | buffer_b_desciptors.push_back(rp.PopRaw<IPC::BufferDescriptorABW>()); |
| 97 | } | 97 | } |
| 98 | for (unsigned i = 0; i < command_header->num_buf_w_descriptors; ++i) { | 98 | for (u32 i = 0; i < command_header->num_buf_w_descriptors; ++i) { |
| 99 | buffer_w_desciptors.push_back(rp.PopRaw<IPC::BufferDescriptorABW>()); | 99 | buffer_w_desciptors.push_back(rp.PopRaw<IPC::BufferDescriptorABW>()); |
| 100 | } | 100 | } |
| 101 | 101 | ||
| @@ -148,14 +148,14 @@ void HLERequestContext::ParseCommandBuffer(const KHandleTable& handle_table, u32 | |||
| 148 | IPC::CommandHeader::BufferDescriptorCFlag::OneDescriptor) { | 148 | IPC::CommandHeader::BufferDescriptorCFlag::OneDescriptor) { |
| 149 | buffer_c_desciptors.push_back(rp.PopRaw<IPC::BufferDescriptorC>()); | 149 | buffer_c_desciptors.push_back(rp.PopRaw<IPC::BufferDescriptorC>()); |
| 150 | } else { | 150 | } else { |
| 151 | unsigned num_buf_c_descriptors = | 151 | u32 num_buf_c_descriptors = |
| 152 | static_cast<unsigned>(command_header->buf_c_descriptor_flags.Value()) - 2; | 152 | static_cast<u32>(command_header->buf_c_descriptor_flags.Value()) - 2; |
| 153 | 153 | ||
| 154 | // This is used to detect possible underflows, in case something is broken | 154 | // This is used to detect possible underflows, in case something is broken |
| 155 | // with the two ifs above and the flags value is == 0 || == 1. | 155 | // with the two ifs above and the flags value is == 0 || == 1. |
| 156 | ASSERT(num_buf_c_descriptors < 14); | 156 | ASSERT(num_buf_c_descriptors < 14); |
| 157 | 157 | ||
| 158 | for (unsigned i = 0; i < num_buf_c_descriptors; ++i) { | 158 | for (u32 i = 0; i < num_buf_c_descriptors; ++i) { |
| 159 | buffer_c_desciptors.push_back(rp.PopRaw<IPC::BufferDescriptorC>()); | 159 | buffer_c_desciptors.push_back(rp.PopRaw<IPC::BufferDescriptorC>()); |
| 160 | } | 160 | } |
| 161 | } | 161 | } |
diff --git a/src/core/hle/kernel/hle_ipc.h b/src/core/hle/kernel/hle_ipc.h index 4fba300dc..e1b128281 100644 --- a/src/core/hle/kernel/hle_ipc.h +++ b/src/core/hle/kernel/hle_ipc.h | |||
| @@ -150,6 +150,10 @@ public: | |||
| 150 | return command_header->type; | 150 | return command_header->type; |
| 151 | } | 151 | } |
| 152 | 152 | ||
| 153 | u64 GetPID() const { | ||
| 154 | return pid; | ||
| 155 | } | ||
| 156 | |||
| 153 | u32 GetDataPayloadOffset() const { | 157 | u32 GetDataPayloadOffset() const { |
| 154 | return data_payload_offset; | 158 | return data_payload_offset; |
| 155 | } | 159 | } |
| @@ -305,11 +309,12 @@ private: | |||
| 305 | std::vector<IPC::BufferDescriptorABW> buffer_w_desciptors; | 309 | std::vector<IPC::BufferDescriptorABW> buffer_w_desciptors; |
| 306 | std::vector<IPC::BufferDescriptorC> buffer_c_desciptors; | 310 | std::vector<IPC::BufferDescriptorC> buffer_c_desciptors; |
| 307 | 311 | ||
| 312 | u32_le command{}; | ||
| 313 | u64 pid{}; | ||
| 308 | u32 data_payload_offset{}; | 314 | u32 data_payload_offset{}; |
| 309 | u32 handles_offset{}; | 315 | u32 handles_offset{}; |
| 310 | u32 domain_offset{}; | 316 | u32 domain_offset{}; |
| 311 | u32 data_size{}; | 317 | u32 data_size{}; |
| 312 | u32_le command{}; | ||
| 313 | 318 | ||
| 314 | std::vector<std::shared_ptr<SessionRequestHandler>> domain_request_handlers; | 319 | std::vector<std::shared_ptr<SessionRequestHandler>> domain_request_handlers; |
| 315 | bool is_thread_waiting{}; | 320 | bool is_thread_waiting{}; |