aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorlizzie <lizzie@eden-emu.dev>2026-06-29 08:11:12 +0200
committercrueter <crueter@eden-emu.dev>2026-06-29 08:11:12 +0200
commit1b482fa99b3f9438ac287d99f963effed036ba56 (patch)
tree62ce4eecba895754ad3068ceade9fa57aebc6716 /src
parentb6ee84794737608865457f3f3af3f9947770731b (diff)
[hle] remove parent object reference data on Request/Response builders, pass by argument (#3774)
anyways this should remove a bunch of redundant code/stack usage for response builders (ahem, msvc) SHOULD help games that use IPC heavily like PKZA and whatnot biblical levels of performance greed Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3774 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-by: Maufeat <sahyno1996@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/acc/acc.cpp12
-rw-r--r--src/core/hle/service/acc/async_context.cpp2
-rw-r--r--src/core/hle/service/apm/apm_interface.cpp4
-rw-r--r--src/core/hle/service/fgm/fgm.cpp5
-rw-r--r--src/core/hle/service/friend/friend.cpp14
-rw-r--r--src/core/hle/service/glue/arp.cpp2
-rw-r--r--src/core/hle/service/glue/bgtc.cpp2
-rw-r--r--src/core/hle/service/glue/ectx.cpp5
-rw-r--r--src/core/hle/service/hid/hid_system_server.cpp8
-rw-r--r--src/core/hle/service/hle_ipc.h4
-rw-r--r--src/core/hle/service/ipc_helpers.h244
-rw-r--r--src/core/hle/service/lm/lm.cpp2
-rw-r--r--src/core/hle/service/nfc/nfc.cpp8
-rw-r--r--src/core/hle/service/nfc/nfc_interface.cpp6
-rw-r--r--src/core/hle/service/nfp/nfp.cpp6
-rw-r--r--src/core/hle/service/nifm/nifm.cpp16
-rw-r--r--src/core/hle/service/nim/nim.cpp12
-rw-r--r--src/core/hle/service/ns/read_only_application_control_data_interface.cpp4
-rw-r--r--src/core/hle/service/nvdrv/nvdrv_interface.cpp2
-rw-r--r--src/core/hle/service/pcv/pcv.cpp5
-rw-r--r--src/core/hle/service/pm/pm.cpp2
-rw-r--r--src/core/hle/service/psc/time/alarms.cpp6
-rw-r--r--src/core/hle/service/ptm/psm.cpp4
-rw-r--r--src/core/hle/service/ptm/ts.cpp5
-rw-r--r--src/core/hle/service/sm/sm.cpp9
-rw-r--r--src/core/hle/service/sm/sm_controller.cpp2
-rw-r--r--src/core/hle/service/ssl/ssl.cpp8
-rw-r--r--src/core/hle/service/usb/usb.cpp4
28 files changed, 175 insertions, 228 deletions
diff --git a/src/core/hle/service/acc/acc.cpp b/src/core/hle/service/acc/acc.cpp
index c33b765000..9a8324fbf9 100644
--- a/src/core/hle/service/acc/acc.cpp
+++ b/src/core/hle/service/acc/acc.cpp
@@ -729,7 +729,7 @@ private:
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
- rb.PushIpcInterface(ensure_token_id);
+ rb.PushIpcInterface(ctx, ensure_token_id);
}
void LoadIdTokenCacheDeprecated(HLERequestContext& ctx) {
@@ -921,7 +921,7 @@ void Module::Interface::GetProfile(HLERequestContext& ctx) {
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
- rb.PushIpcInterface<IProfile>(system, user_id, *profile_manager);
+ rb.PushIpcInterface<IProfile>(ctx, system, user_id, *profile_manager);
}
void Module::Interface::IsUserRegistrationRequestPermitted(HLERequestContext& ctx) {
@@ -993,7 +993,7 @@ void Module::Interface::GetBaasAccountManagerForApplication(HLERequestContext& c
LOG_DEBUG(Service_ACC, "called");
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
- rb.PushIpcInterface<IManagerForApplication>(system, profile_manager);
+ rb.PushIpcInterface<IManagerForApplication>(ctx, system, profile_manager);
}
void Module::Interface::IsUserAccountSwitchLocked(HLERequestContext& ctx) {
@@ -1089,7 +1089,7 @@ void Module::Interface::GetProfileEditor(HLERequestContext& ctx) {
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
- rb.PushIpcInterface<IProfileEditor>(system, user_id, *profile_manager);
+ rb.PushIpcInterface<IProfileEditor>(ctx, system, user_id, *profile_manager);
}
void Module::Interface::GetBaasAccountAdministrator(HLERequestContext &ctx) {
@@ -1100,7 +1100,7 @@ void Module::Interface::GetBaasAccountAdministrator(HLERequestContext &ctx) {
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
- rb.PushIpcInterface<IAdministrator>(system, uuid);
+ rb.PushIpcInterface<IAdministrator>(ctx, system, uuid);
}
void Module::Interface::ListQualifiedUsers(HLERequestContext& ctx) {
@@ -1143,7 +1143,7 @@ void Module::Interface::GetBaasAccountManagerForSystemService(HLERequestContext&
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
- rb.PushIpcInterface<IManagerForSystemService>(system, uuid);
+ rb.PushIpcInterface<IManagerForSystemService>(ctx, system, uuid);
}
void Module::Interface::StoreSaveDataThumbnailSystem(HLERequestContext& ctx) {
diff --git a/src/core/hle/service/acc/async_context.cpp b/src/core/hle/service/acc/async_context.cpp
index c767e46e8f..8dec886ad7 100644
--- a/src/core/hle/service/acc/async_context.cpp
+++ b/src/core/hle/service/acc/async_context.cpp
@@ -35,7 +35,7 @@ void IAsyncContext::GetSystemEvent(HLERequestContext& ctx) {
IPC::ResponseBuilder rb{ctx, 2, 1};
rb.Push(ResultSuccess);
- rb.PushCopyObjects(completion_event->GetReadableEvent());
+ rb.PushCopyObjects(ctx, completion_event->GetReadableEvent());
}
void IAsyncContext::Cancel(HLERequestContext& ctx) {
diff --git a/src/core/hle/service/apm/apm_interface.cpp b/src/core/hle/service/apm/apm_interface.cpp
index 90241a7093..51c01e2f25 100644
--- a/src/core/hle/service/apm/apm_interface.cpp
+++ b/src/core/hle/service/apm/apm_interface.cpp
@@ -82,7 +82,7 @@ void APM::OpenSession(HLERequestContext& ctx) {
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
- rb.PushIpcInterface<ISession>(system, controller);
+ rb.PushIpcInterface<ISession>(ctx, system, controller);
}
void APM::GetPerformanceMode(HLERequestContext& ctx) {
@@ -125,7 +125,7 @@ void APM_Sys::GetPerformanceEvent(HLERequestContext& ctx) {
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
- rb.PushIpcInterface<ISession>(system, controller);
+ rb.PushIpcInterface<ISession>(ctx, system, controller);
}
void APM_Sys::SetCpuBoostMode(HLERequestContext& ctx) {
diff --git a/src/core/hle/service/fgm/fgm.cpp b/src/core/hle/service/fgm/fgm.cpp
index 6b3f77be2b..cac03ae24c 100644
--- a/src/core/hle/service/fgm/fgm.cpp
+++ b/src/core/hle/service/fgm/fgm.cpp
@@ -1,3 +1,6 @@
+// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
+// SPDX-License-Identifier: GPL-3.0-or-later
+
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
@@ -45,7 +48,7 @@ private:
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
- rb.PushIpcInterface<IRequest>(system);
+ rb.PushIpcInterface<IRequest>(ctx, system);
}
};
diff --git a/src/core/hle/service/friend/friend.cpp b/src/core/hle/service/friend/friend.cpp
index 6885a7be7d..de23185591 100644
--- a/src/core/hle/service/friend/friend.cpp
+++ b/src/core/hle/service/friend/friend.cpp
@@ -184,7 +184,7 @@ private:
IPC::ResponseBuilder rb{ctx, 2, 1};
rb.Push(readable_event.Signal(system.Kernel()));
- rb.PushCopyObjects(readable_event);
+ rb.PushCopyObjects(ctx, readable_event);
}
void Cancel(HLERequestContext& ctx) {
@@ -400,7 +400,7 @@ private:
IPC::ResponseBuilder rb{ctx, 2, 1};
rb.Push(ResultSuccess);
- rb.PushCopyObjects(notification_event->GetReadableEvent());
+ rb.PushCopyObjects(ctx, notification_event->GetReadableEvent());
}
void Clear(HLERequestContext& ctx) {
@@ -476,7 +476,7 @@ private:
void Module::Interface::CreateFriendService(HLERequestContext& ctx) {
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
- rb.PushIpcInterface<IFriendService>(system);
+ rb.PushIpcInterface<IFriendService>(ctx, system);
LOG_DEBUG(Service_Friend, "called");
}
@@ -488,12 +488,12 @@ void Module::Interface::CreateNotificationService(HLERequestContext& ctx) {
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
- rb.PushIpcInterface<INotificationService>(system, uuid);
+ rb.PushIpcInterface<INotificationService>(ctx, system, uuid);
}
-Module::Interface::Interface(std::shared_ptr<Module> module_, Core::System& system_,
- const char* name)
- : ServiceFramework{system_, name}, module{std::move(module_)} {}
+Module::Interface::Interface(std::shared_ptr<Module> module_, Core::System& system_, const char* name)
+ : ServiceFramework{system_, name}, module{std::move(module_)}
+{}
Module::Interface::~Interface() = default;
diff --git a/src/core/hle/service/glue/arp.cpp b/src/core/hle/service/glue/arp.cpp
index a7f54e980c..b5dfbe9c60 100644
--- a/src/core/hle/service/glue/arp.cpp
+++ b/src/core/hle/service/glue/arp.cpp
@@ -279,7 +279,7 @@ void ARP_W::AcquireRegistrar(HLERequestContext& ctx) {
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
- rb.PushIpcInterface(registrar);
+ rb.PushIpcInterface(ctx, registrar);
}
void ARP_W::UnregisterApplicationInstance(HLERequestContext& ctx) {
diff --git a/src/core/hle/service/glue/bgtc.cpp b/src/core/hle/service/glue/bgtc.cpp
index 5e51f98319..360f16f0dd 100644
--- a/src/core/hle/service/glue/bgtc.cpp
+++ b/src/core/hle/service/glue/bgtc.cpp
@@ -28,7 +28,7 @@ void BGTC_T::OpenTaskService(HLERequestContext& ctx) {
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
- rb.PushIpcInterface<ITaskService>(system);
+ rb.PushIpcInterface<ITaskService>(ctx, system);
}
ITaskService::ITaskService(Core::System& system_) : ServiceFramework{system_, "ITaskService"} {
diff --git a/src/core/hle/service/glue/ectx.cpp b/src/core/hle/service/glue/ectx.cpp
index 6f71b62f3a..951f6cfcc8 100644
--- a/src/core/hle/service/glue/ectx.cpp
+++ b/src/core/hle/service/glue/ectx.cpp
@@ -1,3 +1,6 @@
+// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
+// SPDX-License-Identifier: GPL-3.0-or-later
+
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
@@ -56,7 +59,7 @@ ECTX_AW::~ECTX_AW() = default;
void ECTX_AW::CreateContextRegistrar(HLERequestContext& ctx) {
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
- rb.PushIpcInterface<IContextRegistrar>(std::make_shared<IContextRegistrar>(system));
+ rb.PushIpcInterface<IContextRegistrar>(ctx, system);
}
} // namespace Service::Glue
diff --git a/src/core/hle/service/hid/hid_system_server.cpp b/src/core/hle/service/hid/hid_system_server.cpp
index dbc8310c08..3820e15c36 100644
--- a/src/core/hle/service/hid/hid_system_server.cpp
+++ b/src/core/hle/service/hid/hid_system_server.cpp
@@ -726,7 +726,7 @@ void IHidSystemServer::AcquireConnectionTriggerTimeoutEvent(HLERequestContext& c
IPC::ResponseBuilder rb{ctx, 2, 1};
rb.Push(ResultSuccess);
- rb.PushCopyObjects(acquire_device_registered_event->GetReadableEvent());
+ rb.PushCopyObjects(ctx, acquire_device_registered_event->GetReadableEvent());
}
void IHidSystemServer::AcquireDeviceRegisteredEventForControllerSupport(HLERequestContext& ctx) {
@@ -734,7 +734,7 @@ void IHidSystemServer::AcquireDeviceRegisteredEventForControllerSupport(HLEReque
IPC::ResponseBuilder rb{ctx, 2, 1};
rb.Push(ResultSuccess);
- rb.PushCopyObjects(acquire_device_registered_event->GetReadableEvent());
+ rb.PushCopyObjects(ctx, acquire_device_registered_event->GetReadableEvent());
}
void IHidSystemServer::GetRegisteredDevices(HLERequestContext& ctx) {
@@ -759,7 +759,7 @@ void IHidSystemServer::AcquireUniquePadConnectionEventHandle(HLERequestContext&
LOG_WARNING(Service_HID, "(STUBBED) called");
IPC::ResponseBuilder rb{ctx, 2, 1};
- rb.PushCopyObjects(unique_pad_connection_event->GetReadableEvent());
+ rb.PushCopyObjects(ctx, unique_pad_connection_event->GetReadableEvent());
rb.Push(ResultSuccess);
}
@@ -776,7 +776,7 @@ void IHidSystemServer::AcquireJoyDetachOnBluetoothOffEventHandle(HLERequestConte
IPC::ResponseBuilder rb{ctx, 2, 1};
rb.Push(ResultSuccess);
- rb.PushCopyObjects(joy_detach_event->GetReadableEvent());
+ rb.PushCopyObjects(ctx, joy_detach_event->GetReadableEvent());
}
void IHidSystemServer::IsUsbFullKeyControllerEnabled(HLERequestContext& ctx) {
diff --git a/src/core/hle/service/hle_ipc.h b/src/core/hle/service/hle_ipc.h
index eeb5bf3547..7387318995 100644
--- a/src/core/hle/service/hle_ipc.h
+++ b/src/core/hle/service/hle_ipc.h
@@ -31,7 +31,7 @@ class Memory;
}
namespace IPC {
-class ResponseBuilder;
+struct ResponseBuilder;
}
namespace Service {
@@ -392,7 +392,7 @@ public:
}
private:
- friend class IPC::ResponseBuilder;
+ friend struct IPC::ResponseBuilder;
void ParseCommandBuffer(u32_le* src_cmdbuf, bool incoming);
diff --git a/src/core/hle/service/ipc_helpers.h b/src/core/hle/service/ipc_helpers.h
index c37b0c2e05..67eef7a087 100644
--- a/src/core/hle/service/ipc_helpers.h
+++ b/src/core/hle/service/ipc_helpers.h
@@ -24,45 +24,7 @@ namespace IPC {
constexpr Result ResultSessionClosed{ErrorModule::HIPC, 301};
-class RequestHelperBase {
-protected:
- Service::HLERequestContext* context = nullptr;
- u32* cmdbuf;
- u32 index = 0;
-
-public:
- explicit RequestHelperBase(u32* command_buffer) : cmdbuf(command_buffer) {}
-
- explicit RequestHelperBase(Service::HLERequestContext& ctx)
- : context(&ctx), cmdbuf(ctx.CommandBuffer()) {}
-
- void Skip(u32 size_in_words, bool set_to_null) {
- if (set_to_null) {
- memset(cmdbuf + index, 0, size_in_words * sizeof(u32));
- }
- index += size_in_words;
- }
-
- /**
- * Aligns the current position forward to a 16-byte boundary, padding with zeros.
- */
- void AlignWithPadding() {
- if (index & 3) {
- Skip(static_cast<u32>(4 - (index & 3)), true);
- }
- }
-
- u32 GetCurrentOffset() const {
- return index;
- }
-
- void SetCurrentOffset(u32 offset) {
- index = offset;
- }
-};
-
-class ResponseBuilder : public RequestHelperBase {
-public:
+struct ResponseBuilder {
/// Flags used for customizing the behavior of ResponseBuilder
enum class Flags : u32 {
None = 0,
@@ -71,14 +33,13 @@ public:
AlwaysMoveHandles = 1,
};
- explicit ResponseBuilder(Service::HLERequestContext& ctx, u32 normal_params_size_,
- u32 num_handles_to_copy_ = 0, u32 num_objects_to_move_ = 0,
- Flags flags = Flags::None)
- : RequestHelperBase(ctx), normal_params_size(normal_params_size_),
- num_handles_to_copy(num_handles_to_copy_),
- num_objects_to_move(num_objects_to_move_), kernel{ctx.kernel} {
-
- memset(cmdbuf, 0, sizeof(u32) * IPC::COMMAND_BUFFER_LENGTH);
+ inline explicit ResponseBuilder(Service::HLERequestContext& ctx, u32 normal_params_size_, u32 num_handles_to_copy_ = 0, u32 num_objects_to_move_ = 0, Flags flags = Flags::None)
+ : cmdbuf(ctx.CommandBuffer())
+ , normal_params_size(normal_params_size_)
+ , num_handles_to_copy(num_handles_to_copy_)
+ , num_objects_to_move(num_objects_to_move_)
+ {
+ std::memset(cmdbuf, 0, sizeof(u32) * IPC::COMMAND_BUFFER_LENGTH);
IPC::CommandHeader header{};
auto const mgr = ctx.GetManager().get();
@@ -117,9 +78,7 @@ public:
handle_descriptor_header.num_handles_to_copy.Assign(num_handles_to_copy_);
handle_descriptor_header.num_handles_to_move.Assign(num_handles_to_move);
PushRaw(handle_descriptor_header);
-
ctx.handles_offset = index;
-
Skip(num_handles_to_copy + num_handles_to_move, true);
}
@@ -131,7 +90,6 @@ public:
domain_header.num_objects = num_domain_objects;
PushRaw(domain_header);
}
-
IPC::DataPayloadHeader data_payload_header{};
data_payload_header.magic = Common::MakeMagic('S', 'F', 'C', 'O');
PushRaw(data_payload_header);
@@ -141,34 +99,39 @@ public:
ctx.data_payload_offset = index;
ctx.write_size += index;
- ctx.domain_offset = static_cast<u32>(index + raw_data_size / sizeof(u32));
+ ctx.domain_offset = u32(index + raw_data_size / sizeof(u32));
}
- template <class T>
- void PushIpcInterface(std::shared_ptr<T> iface) {
- auto manager{context->GetManager()};
+ inline void Skip(u32 size_in_words, bool set_to_null) {
+ if (set_to_null) std::memset(cmdbuf + index, 0, size_in_words * sizeof(u32));
+ index += size_in_words;
+ }
+ /// @brief Aligns the current position forward to a 16-byte boundary, padding with zeros.
+ inline void AlignWithPadding() { if (index & 3) Skip(u32(4 - (index & 3)), true); }
+ inline u32 GetCurrentOffset() const { return index; }
+ inline void SetCurrentOffset(u32 offset) { index = offset; }
+ template <class T> inline void PushIpcInterface(Service::HLERequestContext& ctx, std::shared_ptr<T> iface) {
+ auto manager = ctx.GetManager();
if (manager->IsDomain()) {
- context->AddDomainObject(std::move(iface));
+ ctx.AddDomainObject(std::move(iface));
} else {
- ASSERT(Kernel::GetCurrentProcess(kernel).GetResourceLimit()->Reserve(kernel, Kernel::LimitableResource::SessionCountMax, 1));
+ ASSERT(Kernel::GetCurrentProcess(ctx.kernel).GetResourceLimit()->Reserve(ctx.kernel, Kernel::LimitableResource::SessionCountMax, 1));
- auto* session = Kernel::KSession::Create(kernel);
- session->Initialize(kernel, nullptr, 0);
- Kernel::KSession::Register(kernel, session);
+ auto* session = Kernel::KSession::Create(ctx.kernel);
+ session->Initialize(ctx.kernel, nullptr, 0);
+ Kernel::KSession::Register(ctx.kernel, session);
- auto next_manager = std::make_shared<Service::SessionRequestManager>(
- kernel, manager->GetServerManager());
+ auto next_manager = std::make_shared<Service::SessionRequestManager>(ctx.kernel, manager->GetServerManager());
next_manager->SetSessionHandler(iface);
manager->GetServerManager().RegisterSession(&session->GetServerSession(), next_manager);
- context->AddMoveObject(&session->GetClientSession());
+ ctx.AddMoveObject(&session->GetClientSession());
}
}
- template <class T, class... Args>
- void PushIpcInterface(Args&&... args) {
- PushIpcInterface<T>(std::make_shared<T>(std::forward<Args>(args)...));
+ template <class T, class... Args> inline void PushIpcInterface(Service::HLERequestContext& ctx, Args&&... args) {
+ PushIpcInterface<T>(ctx, std::make_shared<T>(std::forward<Args>(args)...));
}
void PushImpl(s8 value);
@@ -184,59 +147,38 @@ public:
void PushImpl(bool value);
void PushImpl(Result value);
- template <typename T>
- void Push(T value) {
+ template <typename T> inline void Push(T value) {
return PushImpl(value);
}
template <typename First, typename... Other>
void Push(const First& first_value, const Other&... other_values);
- /**
- * Helper function for pushing strongly-typed enumeration values.
- *
- * @tparam Enum The enumeration type to be pushed
- *
- * @param value The value to push.
- *
- * @note The underlying size of the enumeration type is the size of the
- * data that gets pushed. e.g. "enum class SomeEnum : u16" will
- * push a u16-sized amount of data.
- */
- template <typename Enum>
- void PushEnum(Enum value) {
+ /// @brief Helper function for pushing strongly-typed enumeration values.
+ /// @tparam Enum The enumeration type to be pushed
+ /// @param value The value to push.
+ /// @note The underlying size of the enumeration type is the size of the data that gets pushed.
+ /// e.g. "enum class SomeEnum : u16" will push a u16-sized amount of data.
+ template <typename Enum> inline void PushEnum(Enum value) {
static_assert(std::is_enum_v<Enum>, "T must be an enum type within a PushEnum call.");
- static_assert(!std::is_convertible_v<Enum, int>,
- "enum type in PushEnum must be a strongly typed enum.");
+ static_assert(!std::is_convertible_v<Enum, int>, "enum type in PushEnum must be a strongly typed enum.");
Push(static_cast<std::underlying_type_t<Enum>>(value));
}
- /**
- * @brief Copies the content of the given trivially copyable class to the buffer as a normal
- * param
- * @note: The input class must be correctly packed/padded to fit hardware layout.
- */
- template <typename T>
- void PushRaw(const T& value);
-
- template <typename... O>
- void PushMoveObjects(O*... pointers);
-
- template <typename... O>
- void PushMoveObjects(O&... pointers);
-
- template <typename... O>
- void PushCopyObjects(O*... pointers);
+ /// @brief Copies the content of the given trivially copyable class to the buffer as a normal param
+ /// @note: The input class must be correctly packed/padded to fit hardware layout.
+ template <typename T> void PushRaw(const T& value);
+ template <typename... O> void PushMoveObjects(Service::HLERequestContext& ctx, O*... pointers);
+ template <typename... O> void PushMoveObjects(Service::HLERequestContext& ctx, O&... pointers);
+ template <typename... O> void PushCopyObjects(Service::HLERequestContext& ctx, O*... pointers);
+ template <typename... O> void PushCopyObjects(Service::HLERequestContext& ctx, O&... pointers);
- template <typename... O>
- void PushCopyObjects(O&... pointers);
-
-private:
+ u32* cmdbuf;
+ u32 index = 0;
u32 normal_params_size{};
u32 num_handles_to_copy{};
u32 num_objects_to_move{}; ///< Domain objects or move handles, context dependent
u32 data_payload_index{};
- Kernel::KernelCore& kernel;
};
/// Push ///
@@ -251,8 +193,7 @@ inline void ResponseBuilder::PushImpl(u32 value) {
template <typename T>
void ResponseBuilder::PushRaw(const T& value) {
- static_assert(std::is_trivially_copyable_v<T>,
- "It's undefined behavior to use memcpy with non-trivially copyable objects");
+ static_assert(std::is_trivially_copyable_v<T>, "It's undefined behavior to use memcpy with non-trivially copyable objects");
std::memcpy(cmdbuf + index, &value, sizeof(T));
index += (sizeof(T) + 3) / 4; // round up to word length
}
@@ -272,8 +213,8 @@ inline void ResponseBuilder::PushImpl(s16 value) {
}
inline void ResponseBuilder::PushImpl(s64 value) {
- PushImpl(static_cast<u32>(value));
- PushImpl(static_cast<u32>(value >> 32));
+ PushImpl(u32(value));
+ PushImpl(u32(value >> 32));
}
inline void ResponseBuilder::PushImpl(u8 value) {
@@ -285,8 +226,8 @@ inline void ResponseBuilder::PushImpl(u16 value) {
}
inline void ResponseBuilder::PushImpl(u64 value) {
- PushImpl(static_cast<u32>(value));
- PushImpl(static_cast<u32>(value >> 32));
+ PushImpl(u32(value));
+ PushImpl(u32(value >> 32));
}
inline void ResponseBuilder::PushImpl(float value) {
@@ -312,90 +253,88 @@ void ResponseBuilder::Push(const First& first_value, const Other&... other_value
}
template <typename... O>
-inline void ResponseBuilder::PushCopyObjects(O*... pointers) {
+inline void ResponseBuilder::PushCopyObjects(Service::HLERequestContext& ctx, O*... pointers) {
auto objects = {pointers...};
for (auto& object : objects) {
- context->AddCopyObject(object);
+ ctx.AddCopyObject(object);
}
}
template <typename... O>
-inline void ResponseBuilder::PushCopyObjects(O&... pointers) {
+inline void ResponseBuilder::PushCopyObjects(Service::HLERequestContext& ctx, O&... pointers) {
auto objects = {&pointers...};
for (auto& object : objects) {
- context->AddCopyObject(object);
+ ctx.AddCopyObject(object);
}
}
template <typename... O>
-inline void ResponseBuilder::PushMoveObjects(O*... pointers) {
+inline void ResponseBuilder::PushMoveObjects(Service::HLERequestContext& ctx, O*... pointers) {
auto objects = {pointers...};
for (auto& object : objects) {
- context->AddMoveObject(object);
+ ctx.AddMoveObject(object);
}
}
template <typename... O>
-inline void ResponseBuilder::PushMoveObjects(O&... pointers) {
+inline void ResponseBuilder::PushMoveObjects(Service::HLERequestContext& ctx, O&... pointers) {
auto objects = {&pointers...};
for (auto& object : objects) {
- context->AddMoveObject(object);
+ ctx.AddMoveObject(object);
}
}
-class RequestParser : public RequestHelperBase {
-public:
- explicit RequestParser(u32* command_buffer) : RequestHelperBase(command_buffer) {}
-
- explicit RequestParser(Service::HLERequestContext& ctx) : RequestHelperBase(ctx) {
+struct RequestParser {
+ inline explicit RequestParser(u32* command_buffer) : cmdbuf(command_buffer) {}
+ inline explicit RequestParser(Service::HLERequestContext& ctx)
+ : cmdbuf(ctx.CommandBuffer())
+ {
// TIPC does not have data payload offset
if (!ctx.IsTipc()) {
ASSERT_MSG(ctx.GetDataPayloadOffset(), "context is incomplete");
Skip(ctx.GetDataPayloadOffset(), false);
}
-
// Skip the u64 command id, it's already stored in the context
static constexpr u32 CommandIdSize = 2;
Skip(CommandIdSize, false);
}
- template <typename T>
- T Pop();
-
- template <typename T>
- void Pop(T& value);
+ inline void Skip(u32 size_in_words, bool set_to_null) {
+ if (set_to_null) std::memset(cmdbuf + index, 0, size_in_words * sizeof(u32));
+ index += size_in_words;
+ }
+ /// @brief Aligns the current position forward to a 16-byte boundary, padding with zeros.
+ inline void AlignWithPadding() { if (index & 3) Skip(u32(4 - (index & 3)), true); }
+ inline u32 GetCurrentOffset() const { return index; }
+ inline void SetCurrentOffset(u32 offset) { index = offset; }
- template <typename First, typename... Other>
- void Pop(First& first_value, Other&... other_values);
+ template <typename T> T Pop();
+ template <typename T> void Pop(T& value);
+ template <typename First, typename... Other> void Pop(First& first_value, Other&... other_values);
template <typename T>
T PopEnum() {
static_assert(std::is_enum_v<T>, "T must be an enum type within a PopEnum call.");
- static_assert(!std::is_convertible_v<T, int>,
- "enum type in PopEnum must be a strongly typed enum.");
- return static_cast<T>(Pop<std::underlying_type_t<T>>());
+ static_assert(!std::is_convertible_v<T, int>, "enum type in PopEnum must be a strongly typed enum.");
+ return T(Pop<std::underlying_type_t<T>>());
}
- /**
- * @brief Reads the next normal parameters as a struct, by copying it
- * @note: The output class must be correctly packed/padded to fit hardware layout.
- */
- template <typename T>
- void PopRaw(T& value);
+ /// @brief Reads the next normal parameters as a struct, by copying it
+ /// @note: The output class must be correctly packed/padded to fit hardware layout.
+ template <typename T> void PopRaw(T& value);
- /**
- * @brief Reads the next normal parameters as a struct, by copying it into a new value
- * @note: The output class must be correctly packed/padded to fit hardware layout.
- */
- template <typename T>
- T PopRaw();
+ /// @brief Reads the next normal parameters as a struct, by copying it into a new value
+ /// @note: The output class must be correctly packed/padded to fit hardware layout.
+ template <typename T> T PopRaw();
- template <class T>
- std::weak_ptr<T> PopIpcInterface() {
- ASSERT(context->GetManager()->IsDomain());
- ASSERT(context->GetDomainMessageHeader().input_object_count > 0);
- return context->GetDomainHandler<T>(Pop<u32>() - 1);
+ template <class T> [[nodiscard]] std::weak_ptr<T> PopIpcInterface(Service::HLERequestContext& ctx) {
+ ASSERT(ctx.GetManager()->IsDomain());
+ ASSERT(ctx.GetDomainMessageHeader().input_object_count > 0);
+ return ctx.GetDomainHandler<T>(Pop<u32>() - 1);
}
+
+ u32* cmdbuf;
+ u32 index = 0;
};
/// Pop ///
@@ -407,7 +346,7 @@ inline u32 RequestParser::Pop() {
template <>
inline s32 RequestParser::Pop() {
- return static_cast<s32>(Pop<u32>());
+ return s32(Pop<u32>());
}
// Ignore the -Wclass-memaccess warning on memcpy for non-trivially default constructible objects.
@@ -417,8 +356,7 @@ inline s32 RequestParser::Pop() {
#endif
template <typename T>
void RequestParser::PopRaw(T& value) {
- static_assert(std::is_trivially_copyable_v<T>,
- "It's undefined behavior to use memcpy with non-trivially copyable objects");
+ static_assert(std::is_trivially_copyable_v<T>, "It's undefined behavior to use memcpy with non-trivially copyable objects");
std::memcpy(&value, cmdbuf + index, sizeof(T));
index += (sizeof(T) + 3) / 4; // round up to word length
}
diff --git a/src/core/hle/service/lm/lm.cpp b/src/core/hle/service/lm/lm.cpp
index 26f7e0fc32..9a45f130df 100644
--- a/src/core/hle/service/lm/lm.cpp
+++ b/src/core/hle/service/lm/lm.cpp
@@ -353,7 +353,7 @@ private:
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
- rb.PushIpcInterface<ILogger>(system);
+ rb.PushIpcInterface<ILogger>(ctx, system);
}
};
diff --git a/src/core/hle/service/nfc/nfc.cpp b/src/core/hle/service/nfc/nfc.cpp
index 6583cd2445..f64445835e 100644
--- a/src/core/hle/service/nfc/nfc.cpp
+++ b/src/core/hle/service/nfc/nfc.cpp
@@ -151,7 +151,7 @@ private:
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
- rb.PushIpcInterface<IAm>(system);
+ rb.PushIpcInterface<IAm>(ctx, system);
}
};
@@ -173,7 +173,7 @@ private:
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
- rb.PushIpcInterface<MFIUser>(system);
+ rb.PushIpcInterface<MFIUser>(ctx, system);
}
};
@@ -195,7 +195,7 @@ private:
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
- rb.PushIpcInterface<IUser>(system);
+ rb.PushIpcInterface<IUser>(ctx, system);
}
};
@@ -217,7 +217,7 @@ private:
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
- rb.PushIpcInterface<ISystem>(system);
+ rb.PushIpcInterface<ISystem>(ctx, system);
}
};
diff --git a/src/core/hle/service/nfc/nfc_interface.cpp b/src/core/hle/service/nfc/nfc_interface.cpp
index 35849bd6c4..084227fa06 100644
--- a/src/core/hle/service/nfc/nfc_interface.cpp
+++ b/src/core/hle/service/nfc/nfc_interface.cpp
@@ -143,7 +143,7 @@ void NfcInterface::AttachAvailabilityChangeEvent(HLERequestContext& ctx) {
IPC::ResponseBuilder rb{ctx, 2, 1};
rb.Push(ResultSuccess);
- rb.PushCopyObjects(GetManager()->AttachAvailabilityChangeEvent());
+ rb.PushCopyObjects(ctx, GetManager()->AttachAvailabilityChangeEvent());
}
void NfcInterface::StartDetection(HLERequestContext& ctx) {
@@ -203,7 +203,7 @@ void NfcInterface::AttachActivateEvent(HLERequestContext& ctx) {
IPC::ResponseBuilder rb{ctx, 2, 1};
rb.Push(result);
- rb.PushCopyObjects(out_event);
+ rb.PushCopyObjects(ctx, out_event);
}
void NfcInterface::AttachDeactivateEvent(HLERequestContext& ctx) {
@@ -217,7 +217,7 @@ void NfcInterface::AttachDeactivateEvent(HLERequestContext& ctx) {
IPC::ResponseBuilder rb{ctx, 2, 1};
rb.Push(result);
- rb.PushCopyObjects(out_event);
+ rb.PushCopyObjects(ctx, out_event);
}
void NfcInterface::SetNfcEnabled(HLERequestContext& ctx) {
diff --git a/src/core/hle/service/nfp/nfp.cpp b/src/core/hle/service/nfp/nfp.cpp
index 604daabbe2..b9922ce024 100644
--- a/src/core/hle/service/nfp/nfp.cpp
+++ b/src/core/hle/service/nfp/nfp.cpp
@@ -157,7 +157,7 @@ private:
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
- rb.PushIpcInterface<IUser>(system);
+ rb.PushIpcInterface<IUser>(ctx, system);
}
};
@@ -179,7 +179,7 @@ private:
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
- rb.PushIpcInterface<ISystem>(system);
+ rb.PushIpcInterface<ISystem>(ctx, system);
}
};
@@ -201,7 +201,7 @@ private:
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
- rb.PushIpcInterface<IDebug>(system);
+ rb.PushIpcInterface<IDebug>(ctx, system);
}
};
diff --git a/src/core/hle/service/nifm/nifm.cpp b/src/core/hle/service/nifm/nifm.cpp
index 87e806d86b..03c12a1505 100644
--- a/src/core/hle/service/nifm/nifm.cpp
+++ b/src/core/hle/service/nifm/nifm.cpp
@@ -307,7 +307,7 @@ private:
void GetSystemEventReadableHandle(HLERequestContext& ctx) {
IPC::ResponseBuilder rb{ctx, 2, 2};
rb.Push(ResultSuccess);
- rb.PushCopyObjects(evt_scan_complete->GetReadableEvent(),
+ rb.PushCopyObjects(ctx, evt_scan_complete->GetReadableEvent(),
evt_processing->GetReadableEvent());
}
@@ -452,7 +452,7 @@ private:
IPC::ResponseBuilder rb{ctx, 2, 2};
rb.Push(ResultSuccess);
- rb.PushCopyObjects(event1->GetReadableEvent(), event2->GetReadableEvent());
+ rb.PushCopyObjects(ctx, event1->GetReadableEvent(), event2->GetReadableEvent());
}
void Cancel(HLERequestContext& ctx) {
@@ -528,7 +528,7 @@ void IGeneralService::CreateScanRequest(HLERequestContext& ctx) {
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
- rb.PushIpcInterface<IScanRequest>(system);
+ rb.PushIpcInterface<IScanRequest>(ctx, system);
}
void IGeneralService::CreateRequest(HLERequestContext& ctx) {
@@ -537,7 +537,7 @@ void IGeneralService::CreateRequest(HLERequestContext& ctx) {
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
- rb.PushIpcInterface<IRequest>(system);
+ rb.PushIpcInterface<IRequest>(ctx, system);
}
void IGeneralService::GetCurrentNetworkProfile(HLERequestContext& ctx) {
@@ -716,7 +716,7 @@ void IGeneralService::GetNetworkProfile(HLERequestContext& ctx) {
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSuccess);
- rb.PushIpcInterface<INetworkProfile>(system);
+ rb.PushIpcInterface<INetworkProfile>(ctx, system);
}
void IGeneralService::SetNetworkProfile(HLERequestContext& ctx) {
@@ -869,7 +869,7 @@ void IGeneralService::CreateTemporaryNetworkProfile(HLERequestContext& ctx) {
IPC::ResponseBuilder rb{ctx, 6, 0, 1};
rb.Push(ResultSuccess);
- rb.PushIpcInterface<INetworkProfile>(system);
+ rb.PushIpcInterface<INetworkProfile>(ctx, system);
rb.PushRaw<u128>(uuid);
}
@@ -1124,7 +1124,7 @@ private:
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
- rb.PushIpcInterface<IGeneralService>(system);
+ rb.PushIpcInterface<IGeneralService>(ctx, system);
}
void CreateGeneralService(HLERequestContext& ctx) {
@@ -1132,7 +1132,7 @@ private:
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
- rb.PushIpcInterface<IGeneralService>(system);
+ rb.PushIpcInterface<IGeneralService>(ctx, system);
}
};
diff --git a/src/core/hle/service/nim/nim.cpp b/src/core/hle/service/nim/nim.cpp
index 5f85302713..dfea4efa69 100644
--- a/src/core/hle/service/nim/nim.cpp
+++ b/src/core/hle/service/nim/nim.cpp
@@ -53,7 +53,7 @@ private:
LOG_WARNING(Service_NIM, "(STUBBED) called");
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
- rb.PushIpcInterface<IShopServiceAsync>(system);
+ rb.PushIpcInterface<IShopServiceAsync>(ctx, system);
}
};
@@ -75,7 +75,7 @@ private:
LOG_WARNING(Service_NIM, "(STUBBED) called");
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
- rb.PushIpcInterface<IShopServiceAccessor>(system);
+ rb.PushIpcInterface<IShopServiceAccessor>(ctx, system);
}
};
@@ -336,7 +336,7 @@ private:
LOG_DEBUG(Service_NIM, "(STUBBED) called");
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
- rb.PushIpcInterface<IShopServiceAccessServer>(system);
+ rb.PushIpcInterface<IShopServiceAccessServer>(ctx, system);
}
void IsLargeResourceAvailable(HLERequestContext& ctx) {
@@ -356,7 +356,7 @@ private:
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
- rb.PushIpcInterface<IShopServiceAccessServer>(system);
+ rb.PushIpcInterface<IShopServiceAccessServer>(ctx, system);
}
};
@@ -439,7 +439,7 @@ private:
IPC::ResponseBuilder rb{ctx, 2, 1};
rb.Push(ResultSuccess);
- rb.PushCopyObjects(finished_event->GetReadableEvent());
+ rb.PushCopyObjects(ctx, finished_event->GetReadableEvent());
}
void GetResult(HLERequestContext& ctx) {
@@ -500,7 +500,7 @@ private:
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
- rb.PushIpcInterface<IEnsureNetworkClockAvailabilityService>(system);
+ rb.PushIpcInterface<IEnsureNetworkClockAvailabilityService>(ctx, system);
}
// TODO(ogniK): Do we need these?
diff --git a/src/core/hle/service/ns/read_only_application_control_data_interface.cpp b/src/core/hle/service/ns/read_only_application_control_data_interface.cpp
index f12d9b03d2..0f3228e601 100644
--- a/src/core/hle/service/ns/read_only_application_control_data_interface.cpp
+++ b/src/core/hle/service/ns/read_only_application_control_data_interface.cpp
@@ -359,8 +359,8 @@ void IReadOnlyApplicationControlDataInterface::ListApplicationTitle(HLERequestCo
IPC::ResponseBuilder rb{ctx, 2, 1, 1};
rb.Push(ResultSuccess);
- rb.PushCopyObjects(async_value->ReadableEvent());
- rb.PushIpcInterface(std::move(async_value));
+ rb.PushCopyObjects(ctx, async_value->ReadableEvent());
+ rb.PushIpcInterface(ctx, std::move(async_value));
}
Result IReadOnlyApplicationControlDataInterface::GetApplicationControlData3(
diff --git a/src/core/hle/service/nvdrv/nvdrv_interface.cpp b/src/core/hle/service/nvdrv/nvdrv_interface.cpp
index 15983ba881..2b0f7b5409 100644
--- a/src/core/hle/service/nvdrv/nvdrv_interface.cpp
+++ b/src/core/hle/service/nvdrv/nvdrv_interface.cpp
@@ -199,7 +199,7 @@ void NVDRV::QueryEvent(HLERequestContext& ctx) {
IPC::ResponseBuilder rb{ctx, 3, 1};
rb.Push(ResultSuccess);
auto& readable_event = event->GetReadableEvent();
- rb.PushCopyObjects(readable_event);
+ rb.PushCopyObjects(ctx, readable_event);
rb.PushEnum(NvResult::Success);
} else {
LOG_ERROR(Service_NVDRV, "Invalid event request!");
diff --git a/src/core/hle/service/pcv/pcv.cpp b/src/core/hle/service/pcv/pcv.cpp
index 3d0f2aeb7d..c2f466c90b 100644
--- a/src/core/hle/service/pcv/pcv.cpp
+++ b/src/core/hle/service/pcv/pcv.cpp
@@ -1,3 +1,6 @@
+// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
+// SPDX-License-Identifier: GPL-3.0-or-later
+
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
@@ -124,7 +127,7 @@ private:
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
- rb.PushIpcInterface<IClkrstSession>(system, device_code);
+ rb.PushIpcInterface<IClkrstSession>(ctx, system, device_code);
}
};
diff --git a/src/core/hle/service/pm/pm.cpp b/src/core/hle/service/pm/pm.cpp
index 5f94984f4e..3e192bd840 100644
--- a/src/core/hle/service/pm/pm.cpp
+++ b/src/core/hle/service/pm/pm.cpp
@@ -161,7 +161,7 @@ private:
IPC::ResponseBuilder rb{ctx, 10, 1};
rb.Push(ResultSuccess);
- rb.PushCopyObjects(*process);
+ rb.PushCopyObjects(ctx, *process);
rb.PushRaw(program_location);
rb.PushRaw(override_status);
}
diff --git a/src/core/hle/service/psc/time/alarms.cpp b/src/core/hle/service/psc/time/alarms.cpp
index c2de95f653..16127c9366 100644
--- a/src/core/hle/service/psc/time/alarms.cpp
+++ b/src/core/hle/service/psc/time/alarms.cpp
@@ -147,7 +147,7 @@ void IAlarmService::CreateWakeupAlarm(HLERequestContext& ctx) {
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
- rb.PushIpcInterface<ISteadyClockAlarm>(system, m_alarms, AlarmType::WakeupAlarm);
+ rb.PushIpcInterface<ISteadyClockAlarm>(ctx, system, m_alarms, AlarmType::WakeupAlarm);
}
void IAlarmService::CreateBackgroundTaskAlarm(HLERequestContext& ctx) {
@@ -155,7 +155,7 @@ void IAlarmService::CreateBackgroundTaskAlarm(HLERequestContext& ctx) {
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
- rb.PushIpcInterface<ISteadyClockAlarm>(system, m_alarms, AlarmType::BackgroundTaskAlarm);
+ rb.PushIpcInterface<ISteadyClockAlarm>(ctx, system, m_alarms, AlarmType::BackgroundTaskAlarm);
}
ISteadyClockAlarm::ISteadyClockAlarm(Core::System& system_, Alarms& alarms, AlarmType type)
@@ -179,7 +179,7 @@ void ISteadyClockAlarm::GetAlarmEvent(HLERequestContext& ctx) {
IPC::ResponseBuilder rb{ctx, 2, 1};
rb.Push(ResultSuccess);
- rb.PushCopyObjects(m_alarm.GetEventHandle());
+ rb.PushCopyObjects(ctx, m_alarm.GetEventHandle());
}
void ISteadyClockAlarm::Enable(HLERequestContext& ctx) {
diff --git a/src/core/hle/service/ptm/psm.cpp b/src/core/hle/service/ptm/psm.cpp
index 211f380171..41d172b71b 100644
--- a/src/core/hle/service/ptm/psm.cpp
+++ b/src/core/hle/service/ptm/psm.cpp
@@ -67,7 +67,7 @@ private:
IPC::ResponseBuilder rb{ctx, 2, 1};
rb.Push(ResultSuccess);
- rb.PushCopyObjects(state_change_event->GetReadableEvent());
+ rb.PushCopyObjects(ctx, state_change_event->GetReadableEvent());
}
void UnbindStateChangeEvent(HLERequestContext& ctx) {
@@ -186,7 +186,7 @@ void PSM::OpenSession(HLERequestContext& ctx) {
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
- rb.PushIpcInterface<IPsmSession>(system);
+ rb.PushIpcInterface<IPsmSession>(ctx, system);
}
void PSM::GetBatteryVoltageState(HLERequestContext& ctx) {
diff --git a/src/core/hle/service/ptm/ts.cpp b/src/core/hle/service/ptm/ts.cpp
index 652f38b97e..b1ac0c8f11 100644
--- a/src/core/hle/service/ptm/ts.cpp
+++ b/src/core/hle/service/ptm/ts.cpp
@@ -1,3 +1,6 @@
+// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
+// SPDX-License-Identifier: GPL-3.0-or-later
+
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
@@ -82,7 +85,7 @@ void TS::OpenSession(HLERequestContext& ctx) {
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
- rb.PushIpcInterface<ISession>(system);
+ rb.PushIpcInterface<ISession>(ctx, system);
}
} // namespace Service::PTM
diff --git a/src/core/hle/service/sm/sm.cpp b/src/core/hle/service/sm/sm.cpp
index 241533d53b..d5f4146917 100644
--- a/src/core/hle/service/sm/sm.cpp
+++ b/src/core/hle/service/sm/sm.cpp
@@ -140,7 +140,7 @@ void SM::GetServiceCmif(HLERequestContext& ctx) {
if (result == ResultSuccess) {
IPC::ResponseBuilder rb{ctx, 2, 0, 1, IPC::ResponseBuilder::Flags::AlwaysMoveHandles};
rb.Push(result);
- rb.PushMoveObjects(client_session);
+ rb.PushMoveObjects(ctx, client_session);
} else {
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(result);
@@ -157,7 +157,7 @@ void SM::GetServiceTipc(HLERequestContext& ctx) {
IPC::ResponseBuilder rb{ctx, 2, 0, 1, IPC::ResponseBuilder::Flags::AlwaysMoveHandles};
rb.Push(result);
- rb.PushMoveObjects(result == ResultSuccess ? client_session : nullptr);
+ rb.PushMoveObjects(ctx, result == ResultSuccess ? client_session : nullptr);
}
static std::string PopServiceName(IPC::RequestParser& rp) {
@@ -230,8 +230,7 @@ void SM::RegisterServiceImpl(HLERequestContext& ctx, std::string name, u32 max_s
max_session_count, is_light);
Kernel::KServerPort* server_port{};
- if (const auto result = service_manager.RegisterService(std::addressof(server_port), name,
- max_session_count, nullptr);
+ if (const auto result = service_manager.RegisterService(std::addressof(server_port), name, max_session_count, nullptr);
result.IsError()) {
LOG_ERROR(Service_SM, "failed to register service with error_code={:08X}", result.raw);
IPC::ResponseBuilder rb{ctx, 2};
@@ -241,7 +240,7 @@ void SM::RegisterServiceImpl(HLERequestContext& ctx, std::string name, u32 max_s
IPC::ResponseBuilder rb{ctx, 2, 0, 1, IPC::ResponseBuilder::Flags::AlwaysMoveHandles};
rb.Push(ResultSuccess);
- rb.PushMoveObjects(server_port);
+ rb.PushMoveObjects(ctx, server_port);
}
void SM::UnregisterService(HLERequestContext& ctx) {
diff --git a/src/core/hle/service/sm/sm_controller.cpp b/src/core/hle/service/sm/sm_controller.cpp
index 7d7ef38152..125eb4a247 100644
--- a/src/core/hle/service/sm/sm_controller.cpp
+++ b/src/core/hle/service/sm/sm_controller.cpp
@@ -60,7 +60,7 @@ void Controller::CloneCurrentObject(HLERequestContext& ctx) {
// We succeeded.
IPC::ResponseBuilder rb{ctx, 2, 0, 1, IPC::ResponseBuilder::Flags::AlwaysMoveHandles};
rb.Push(ResultSuccess);
- rb.PushMoveObjects(session->GetClientSession());
+ rb.PushMoveObjects(ctx, session->GetClientSession());
}
void Controller::CloneCurrentObjectEx(HLERequestContext& ctx) {
diff --git a/src/core/hle/service/ssl/ssl.cpp b/src/core/hle/service/ssl/ssl.cpp
index 766673c653..f826993920 100644
--- a/src/core/hle/service/ssl/ssl.cpp
+++ b/src/core/hle/service/ssl/ssl.cpp
@@ -543,8 +543,7 @@ private:
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(res);
if (res == ResultSuccess) {
- rb.PushIpcInterface<ISslConnection>(system, ssl_version, shared_data,
- std::move(backend));
+ rb.PushIpcInterface<ISslConnection>(ctx, system, ssl_version, shared_data, std::move(backend));
}
}
@@ -624,12 +623,11 @@ private:
IPC::RequestParser rp{ctx};
const auto parameters = rp.PopRaw<Parameters>();
- LOG_WARNING(Service_SSL, "(STUBBED) called, api_version={}, pid_placeholder={}",
- parameters.ssl_version.api_version, parameters.pid_placeholder);
+ LOG_WARNING(Service_SSL, "(STUBBED) called, api_version={}, pid_placeholder={}", parameters.ssl_version.api_version, parameters.pid_placeholder);
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
- rb.PushIpcInterface<ISslContext>(system, parameters.ssl_version);
+ rb.PushIpcInterface<ISslContext>(ctx, system, parameters.ssl_version);
}
void SetInterfaceVersion(HLERequestContext& ctx) {
diff --git a/src/core/hle/service/usb/usb.cpp b/src/core/hle/service/usb/usb.cpp
index 7f07cfef19..a451d4f783 100644
--- a/src/core/hle/service/usb/usb.cpp
+++ b/src/core/hle/service/usb/usb.cpp
@@ -155,7 +155,7 @@ private:
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
- rb.PushIpcInterface<IPdSession>(system);
+ rb.PushIpcInterface<IPdSession>(ctx, system);
}
};
@@ -199,7 +199,7 @@ private:
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
- rb.PushIpcInterface<IPdCradleSession>(system);
+ rb.PushIpcInterface<IPdCradleSession>(ctx, system);
}
};