From e8c95a9a41aadaa03470866a26118cbb6ffd0261 Mon Sep 17 00:00:00 2001 From: wwylele Date: Thu, 15 Feb 2018 11:16:41 +0200 Subject: [PATCH] ipc_helpers: add PopPID; remove PushCurrentPIDHandle It doesn't make sense for a service to tell its own PID to a client, and there is no such use case. Also the name "handle" is misleading as the PID is not a handle --- src/core/hle/ipc_helpers.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/core/hle/ipc_helpers.h b/src/core/hle/ipc_helpers.h index 9e687b518..949256433 100644 --- a/src/core/hle/ipc_helpers.h +++ b/src/core/hle/ipc_helpers.h @@ -128,8 +128,6 @@ public: template void PushMoveObjects(Kernel::SharedPtr... pointers); - void PushCurrentPIDHandle(); - [[deprecated]] void PushStaticBuffer(VAddr buffer_vaddr, size_t size, u8 buffer_id); void PushStaticBuffer(const std::vector& buffer, u8 buffer_id); @@ -208,11 +206,6 @@ inline void RequestBuilder::PushMoveObjects(Kernel::SharedPtr... pointers) { PushMoveHandles(context->AddOutgoingHandle(std::move(pointers))...); } -inline void RequestBuilder::PushCurrentPIDHandle() { - Push(CallingPidDesc()); - Push(u32(0)); -} - inline void RequestBuilder::PushStaticBuffer(VAddr buffer_vaddr, size_t size, u8 buffer_id) { Push(StaticBufferDesc(size, buffer_id)); Push(buffer_vaddr); @@ -338,6 +331,8 @@ public: std::tie(pointers...) = PopObjects(); } + u32 PopPID(); + /** * @brief Pops the static buffer vaddr * @return The virtual address of the buffer @@ -507,6 +502,11 @@ inline std::tuple...> RequestParser::PopObjects() { std::index_sequence_for{}); } +inline u32 RequestParser::PopPID() { + ASSERT(Pop() == static_cast(DescriptorType::CallingPid)); + return Pop(); +} + inline VAddr RequestParser::PopStaticBuffer(size_t* data_size) { const u32 sbuffer_descriptor = Pop(); StaticBufferDescInfo bufferInfo{sbuffer_descriptor};