From 5e5933256b022f6890fc3f14164ae9e9c3ee9ae3 Mon Sep 17 00:00:00 2001 From: bunnei Date: Sat, 3 Apr 2021 21:21:22 -0700 Subject: hle: kernel: Refactor IPC interfaces to not use std::shared_ptr. --- src/core/hle/ipc_helpers.h | 20 ++++++++++---------- src/core/hle/kernel/client_port.cpp | 2 +- src/core/hle/kernel/hle_ipc.cpp | 12 +++++++----- src/core/hle/kernel/hle_ipc.h | 19 +++++++++++-------- src/core/hle/kernel/k_event.h | 4 ++-- src/core/hle/kernel/svc.cpp | 2 +- src/core/hle/service/am/am.cpp | 5 ++--- src/core/hle/service/am/am.h | 4 ++-- src/core/hle/service/am/applets/applets.cpp | 6 +++--- src/core/hle/service/am/applets/applets.h | 6 +++--- src/core/hle/service/bcat/backend/backend.cpp | 2 +- src/core/hle/service/bcat/module.cpp | 2 +- src/core/hle/service/hid/controllers/npad.cpp | 3 +-- src/core/hle/service/hid/controllers/npad.h | 2 +- src/core/hle/service/hid/hid.cpp | 2 +- src/core/hle/service/hid/irs.cpp | 2 +- src/core/hle/service/nfp/nfp.cpp | 2 +- src/core/hle/service/nfp/nfp.h | 2 +- src/core/hle/service/ns/pl_u.cpp | 2 +- src/core/hle/service/nvdrv/interface.cpp | 2 +- src/core/hle/service/nvdrv/nvdrv.cpp | 2 +- src/core/hle/service/nvflinger/buffer_queue.cpp | 2 +- src/core/hle/service/nvflinger/buffer_queue.h | 1 + src/core/hle/service/sm/controller.cpp | 2 +- src/core/hle/service/sm/sm.cpp | 8 +++++--- src/core/hle/service/time/time.cpp | 2 +- src/core/hle/service/vi/display/vi_display.cpp | 2 +- src/core/hle/service/vi/vi.cpp | 4 ++-- 28 files changed, 65 insertions(+), 59 deletions(-) (limited to 'src/core/hle') diff --git a/src/core/hle/ipc_helpers.h b/src/core/hle/ipc_helpers.h index 56cc911d1..224bee950 100644 --- a/src/core/hle/ipc_helpers.h +++ b/src/core/hle/ipc_helpers.h @@ -138,8 +138,8 @@ public: context->AddDomainObject(std::move(iface)); } else { auto [client, server] = Kernel::Session::Create(kernel, iface->GetServiceName()); - context->AddMoveObject(std::move(client)); - iface->ClientConnected(std::move(server)); + context->AddMoveObject(client.get()); + iface->ClientConnected(std::move(client), std::move(server)); } } @@ -215,10 +215,10 @@ public: void PushRaw(const T& value); template - void PushMoveObjects(std::shared_ptr... pointers); + void PushMoveObjects(O*... pointers); template - void PushCopyObjects(std::shared_ptr... pointers); + void PushCopyObjects(O*... pointers); private: u32 normal_params_size{}; @@ -301,7 +301,7 @@ void ResponseBuilder::Push(const First& first_value, const Other&... other_value } template -inline void ResponseBuilder::PushCopyObjects(std::shared_ptr... pointers) { +inline void ResponseBuilder::PushCopyObjects(O*... pointers) { auto objects = {pointers...}; for (auto& object : objects) { context->AddCopyObject(std::move(object)); @@ -309,7 +309,7 @@ inline void ResponseBuilder::PushCopyObjects(std::shared_ptr... pointers) { } template -inline void ResponseBuilder::PushMoveObjects(std::shared_ptr... pointers) { +inline void ResponseBuilder::PushMoveObjects(O*... pointers) { auto objects = {pointers...}; for (auto& object : objects) { context->AddMoveObject(std::move(object)); @@ -360,10 +360,10 @@ public: T PopRaw(); template - std::shared_ptr GetMoveObject(std::size_t index); + T* GetMoveObject(std::size_t index); template - std::shared_ptr GetCopyObject(std::size_t index); + T* GetCopyObject(std::size_t index); template std::shared_ptr PopIpcInterface() { @@ -470,12 +470,12 @@ void RequestParser::Pop(First& first_value, Other&... other_values) { } template -std::shared_ptr RequestParser::GetMoveObject(std::size_t index) { +T* RequestParser::GetMoveObject(std::size_t index) { return context->GetMoveObject(index); } template -std::shared_ptr RequestParser::GetCopyObject(std::size_t index) { +T* RequestParser::GetCopyObject(std::size_t index) { return context->GetCopyObject(index); } diff --git a/src/core/hle/kernel/client_port.cpp b/src/core/hle/kernel/client_port.cpp index 0b6957e31..431a90d82 100644 --- a/src/core/hle/kernel/client_port.cpp +++ b/src/core/hle/kernel/client_port.cpp @@ -28,7 +28,7 @@ ResultVal> ClientPort::Connect() { auto [client, server] = Kernel::Session::Create(kernel, name); if (server_port->HasHLEHandler()) { - server_port->GetHLEHandler()->ClientConnected(std::move(server)); + server_port->GetHLEHandler()->ClientConnected(client, std::move(server)); } else { server_port->AppendPendingSession(std::move(server)); } diff --git a/src/core/hle/kernel/hle_ipc.cpp b/src/core/hle/kernel/hle_ipc.cpp index 6ffe6ac41..a9702539f 100644 --- a/src/core/hle/kernel/hle_ipc.cpp +++ b/src/core/hle/kernel/hle_ipc.cpp @@ -35,15 +35,17 @@ SessionRequestHandler::SessionRequestHandler() = default; SessionRequestHandler::~SessionRequestHandler() = default; -void SessionRequestHandler::ClientConnected(std::shared_ptr server_session) { +void SessionRequestHandler::ClientConnected(std::shared_ptr client_session, + std::shared_ptr server_session) { server_session->SetHleHandler(shared_from_this()); - connected_sessions.push_back(std::move(server_session)); + client_sessions.push_back(std::move(client_session)); + server_sessions.push_back(std::move(server_session)); } void SessionRequestHandler::ClientDisconnected( const std::shared_ptr& server_session) { server_session->SetHleHandler(nullptr); - boost::range::remove_erase(connected_sessions, server_session); + boost::range::remove_erase(server_sessions, server_session); } HLERequestContext::HLERequestContext(KernelCore& kernel_, Core::Memory::Memory& memory_, @@ -223,12 +225,12 @@ ResultCode HLERequestContext::WriteToOutgoingCommandBuffer(KThread& thread) { // for specific values in each of these descriptors. for (auto& object : copy_objects) { ASSERT(object != nullptr); - dst_cmdbuf[current_offset++] = handle_table.Create(object).Unwrap(); + dst_cmdbuf[current_offset++] = handle_table.Create(SharedFrom(object)).Unwrap(); } for (auto& object : move_objects) { ASSERT(object != nullptr); - dst_cmdbuf[current_offset++] = handle_table.Create(object).Unwrap(); + dst_cmdbuf[current_offset++] = handle_table.Create(SharedFrom(object)).Unwrap(); } } diff --git a/src/core/hle/kernel/hle_ipc.h b/src/core/hle/kernel/hle_ipc.h index 398f1c467..74a95bc76 100644 --- a/src/core/hle/kernel/hle_ipc.h +++ b/src/core/hle/kernel/hle_ipc.h @@ -39,6 +39,7 @@ class HandleTable; class HLERequestContext; class KernelCore; class Process; +class ClientSession; class ServerSession; class KThread; class KReadableEvent; @@ -71,7 +72,8 @@ public: * associated ServerSession alive for the duration of the connection. * @param server_session Owning pointer to the ServerSession associated with the connection. */ - void ClientConnected(std::shared_ptr server_session); + void ClientConnected( + std::shared_ptr client_session, std::shared_ptr server_session); /** * Signals that a client has just disconnected from this HLE handler and releases the @@ -84,7 +86,8 @@ protected: /// List of sessions that are connected to this handler. /// A ServerSession whose server endpoint is an HLE implementation is kept alive by this list /// for the duration of the connection. - std::vector> connected_sessions; + std::vector> client_sessions; + std::vector> server_sessions; }; /** @@ -218,21 +221,21 @@ public: } template - std::shared_ptr GetCopyObject(std::size_t index) { + T* GetCopyObject(std::size_t index) { return DynamicObjectCast(copy_objects.at(index)); } template - std::shared_ptr GetMoveObject(std::size_t index) { + T* GetMoveObject(std::size_t index) { return DynamicObjectCast(move_objects.at(index)); } - void AddMoveObject(std::shared_ptr object) { - move_objects.emplace_back(std::move(object)); + void AddMoveObject(Object* object) { + move_objects.emplace_back(object); } - void AddCopyObject(std::shared_ptr object) { - copy_objects.emplace_back(std::move(object)); + void AddCopyObject(Object* object) { + copy_objects.emplace_back(object); } void AddDomainObject(std::shared_ptr object) { diff --git a/src/core/hle/kernel/k_event.h b/src/core/hle/kernel/k_event.h index 2fb887129..ec6894b16 100644 --- a/src/core/hle/kernel/k_event.h +++ b/src/core/hle/kernel/k_event.h @@ -32,8 +32,8 @@ public: return HANDLE_TYPE; } - std::shared_ptr& GetReadableEvent() { - return readable_event; + KReadableEvent* GetReadableEvent() { + return readable_event.get(); } std::shared_ptr& GetWritableEvent() { diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index 813450115..dca1bcc92 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp @@ -1976,7 +1976,7 @@ static ResultCode CreateEvent(Core::System& system, Handle* out_write, Handle* o auto handle_guard = SCOPE_GUARD({ handle_table.Remove(*write_create_result); }); // Add the readable event to the handle table. - const auto read_create_result = handle_table.Create(event->GetReadableEvent()); + const auto read_create_result = handle_table.Create(SharedFrom(event->GetReadableEvent())); if (read_create_result.Failed()) { return read_create_result.Code(); } diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index 58c7f2930..7be94446a 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp @@ -588,12 +588,11 @@ AppletMessageQueue::AppletMessageQueue(Kernel::KernelCore& kernel) { AppletMessageQueue::~AppletMessageQueue() = default; -const std::shared_ptr& AppletMessageQueue::GetMessageReceiveEvent() const { +Kernel::KReadableEvent* AppletMessageQueue::GetMessageReceiveEvent() const { return on_new_message->GetReadableEvent(); } -const std::shared_ptr& AppletMessageQueue::GetOperationModeChangedEvent() - const { +Kernel::KReadableEvent* AppletMessageQueue::GetOperationModeChangedEvent() const { return on_operation_mode_changed->GetReadableEvent(); } diff --git a/src/core/hle/service/am/am.h b/src/core/hle/service/am/am.h index 5d302e155..f8daeb437 100644 --- a/src/core/hle/service/am/am.h +++ b/src/core/hle/service/am/am.h @@ -56,8 +56,8 @@ public: explicit AppletMessageQueue(Kernel::KernelCore& kernel); ~AppletMessageQueue(); - const std::shared_ptr& GetMessageReceiveEvent() const; - const std::shared_ptr& GetOperationModeChangedEvent() const; + Kernel::KReadableEvent* GetMessageReceiveEvent() const; + Kernel::KReadableEvent* GetOperationModeChangedEvent() const; void PushMessage(AppletMessage msg); AppletMessage PopMessage(); std::size_t GetMessageCount() const; diff --git a/src/core/hle/service/am/applets/applets.cpp b/src/core/hle/service/am/applets/applets.cpp index a56df6a7e..c093813fe 100644 --- a/src/core/hle/service/am/applets/applets.cpp +++ b/src/core/hle/service/am/applets/applets.cpp @@ -142,15 +142,15 @@ void AppletDataBroker::SignalStateChanged() const { } } -std::shared_ptr AppletDataBroker::GetNormalDataEvent() const { +Kernel::KReadableEvent* AppletDataBroker::GetNormalDataEvent() const { return pop_out_data_event->GetReadableEvent(); } -std::shared_ptr AppletDataBroker::GetInteractiveDataEvent() const { +Kernel::KReadableEvent* AppletDataBroker::GetInteractiveDataEvent() const { return pop_interactive_out_data_event->GetReadableEvent(); } -std::shared_ptr AppletDataBroker::GetStateChangedEvent() const { +Kernel::KReadableEvent* AppletDataBroker::GetStateChangedEvent() const { return state_changed_event->GetReadableEvent(); } diff --git a/src/core/hle/service/am/applets/applets.h b/src/core/hle/service/am/applets/applets.h index 4215d2232..ffde8ced0 100644 --- a/src/core/hle/service/am/applets/applets.h +++ b/src/core/hle/service/am/applets/applets.h @@ -97,9 +97,9 @@ public: void SignalStateChanged() const; - std::shared_ptr GetNormalDataEvent() const; - std::shared_ptr GetInteractiveDataEvent() const; - std::shared_ptr GetStateChangedEvent() const; + Kernel::KReadableEvent* GetNormalDataEvent() const; + Kernel::KReadableEvent* GetInteractiveDataEvent() const; + Kernel::KReadableEvent* GetStateChangedEvent() const; private: Core::System& system; diff --git a/src/core/hle/service/bcat/backend/backend.cpp b/src/core/hle/service/bcat/backend/backend.cpp index 92d25dbe4..7f301fdeb 100644 --- a/src/core/hle/service/bcat/backend/backend.cpp +++ b/src/core/hle/service/bcat/backend/backend.cpp @@ -21,7 +21,7 @@ ProgressServiceBackend::ProgressServiceBackend(Kernel::KernelCore& kernel, } std::shared_ptr ProgressServiceBackend::GetEvent() const { - return event->GetReadableEvent(); + return SharedFrom(event->GetReadableEvent()); } DeliveryCacheProgressImpl& ProgressServiceBackend::GetImpl() { diff --git a/src/core/hle/service/bcat/module.cpp b/src/core/hle/service/bcat/module.cpp index 285085f2a..8473b716b 100644 --- a/src/core/hle/service/bcat/module.cpp +++ b/src/core/hle/service/bcat/module.cpp @@ -109,7 +109,7 @@ private: IPC::ResponseBuilder rb{ctx, 2, 1}; rb.Push(RESULT_SUCCESS); - rb.PushCopyObjects(event); + rb.PushCopyObjects(event.get()); } void GetImpl(Kernel::HLERequestContext& ctx) { diff --git a/src/core/hle/service/hid/controllers/npad.cpp b/src/core/hle/service/hid/controllers/npad.cpp index d4678ef49..9d07ca09c 100644 --- a/src/core/hle/service/hid/controllers/npad.cpp +++ b/src/core/hle/service/hid/controllers/npad.cpp @@ -955,8 +955,7 @@ bool Controller_NPad::IsVibrationDeviceMounted(const DeviceHandle& vibration_dev return vibration_devices_mounted[npad_index][device_index]; } -std::shared_ptr Controller_NPad::GetStyleSetChangedEvent( - u32 npad_id) const { +Kernel::KReadableEvent* Controller_NPad::GetStyleSetChangedEvent(u32 npad_id) const { const auto& styleset_event = styleset_changed_events[NPadIdToIndex(npad_id)]; return styleset_event->GetReadableEvent(); } diff --git a/src/core/hle/service/hid/controllers/npad.h b/src/core/hle/service/hid/controllers/npad.h index ea484d4bf..8c24728b1 100644 --- a/src/core/hle/service/hid/controllers/npad.h +++ b/src/core/hle/service/hid/controllers/npad.h @@ -199,7 +199,7 @@ public: bool IsVibrationDeviceMounted(const DeviceHandle& vibration_device_handle) const; - std::shared_ptr GetStyleSetChangedEvent(u32 npad_id) const; + Kernel::KReadableEvent* GetStyleSetChangedEvent(u32 npad_id) const; void SignalStyleSetChangedEvent(u32 npad_id) const; // Adds a new controller at an index. diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp index 9c4bf6d16..d2a6375f5 100644 --- a/src/core/hle/service/hid/hid.cpp +++ b/src/core/hle/service/hid/hid.cpp @@ -118,7 +118,7 @@ void IAppletResource::GetSharedMemoryHandle(Kernel::HLERequestContext& ctx) { IPC::ResponseBuilder rb{ctx, 2, 1}; rb.Push(RESULT_SUCCESS); - rb.PushCopyObjects(shared_mem); + rb.PushCopyObjects(shared_mem.get()); } void IAppletResource::UpdateControllers(std::uintptr_t user_data, diff --git a/src/core/hle/service/hid/irs.cpp b/src/core/hle/service/hid/irs.cpp index 2dfa936fb..b50a51eb7 100644 --- a/src/core/hle/service/hid/irs.cpp +++ b/src/core/hle/service/hid/irs.cpp @@ -62,7 +62,7 @@ void IRS::GetIrsensorSharedMemoryHandle(Kernel::HLERequestContext& ctx) { IPC::ResponseBuilder rb{ctx, 2, 1}; rb.Push(RESULT_SUCCESS); - rb.PushCopyObjects(shared_mem); + rb.PushCopyObjects(shared_mem.get()); } void IRS::StopImageProcessor(Kernel::HLERequestContext& ctx) { diff --git a/src/core/hle/service/nfp/nfp.cpp b/src/core/hle/service/nfp/nfp.cpp index 2d1d4d67f..1446c0bcf 100644 --- a/src/core/hle/service/nfp/nfp.cpp +++ b/src/core/hle/service/nfp/nfp.cpp @@ -343,7 +343,7 @@ bool Module::Interface::LoadAmiibo(const std::vector& buffer) { return true; } -const std::shared_ptr& Module::Interface::GetNFCEvent() const { +Kernel::KReadableEvent* Module::Interface::GetNFCEvent() const { return nfc_tag_load->GetReadableEvent(); } diff --git a/src/core/hle/service/nfp/nfp.h b/src/core/hle/service/nfp/nfp.h index c46551760..7a97caffb 100644 --- a/src/core/hle/service/nfp/nfp.h +++ b/src/core/hle/service/nfp/nfp.h @@ -38,7 +38,7 @@ public: void CreateUserInterface(Kernel::HLERequestContext& ctx); bool LoadAmiibo(const std::vector& buffer); - const std::shared_ptr& GetNFCEvent() const; + Kernel::KReadableEvent* GetNFCEvent() const; const AmiiboFile& GetAmiiboBuffer() const; private: diff --git a/src/core/hle/service/ns/pl_u.cpp b/src/core/hle/service/ns/pl_u.cpp index da139fdc4..e6616a3b9 100644 --- a/src/core/hle/service/ns/pl_u.cpp +++ b/src/core/hle/service/ns/pl_u.cpp @@ -267,7 +267,7 @@ void PL_U::GetSharedMemoryNativeHandle(Kernel::HLERequestContext& ctx) { IPC::ResponseBuilder rb{ctx, 2, 1}; rb.Push(RESULT_SUCCESS); - rb.PushCopyObjects(impl->shared_font_mem); + rb.PushCopyObjects(impl->shared_font_mem.get()); } void PL_U::GetSharedFontInOrderOfPriority(Kernel::HLERequestContext& ctx) { diff --git a/src/core/hle/service/nvdrv/interface.cpp b/src/core/hle/service/nvdrv/interface.cpp index eff9c3cc9..8e359040f 100644 --- a/src/core/hle/service/nvdrv/interface.cpp +++ b/src/core/hle/service/nvdrv/interface.cpp @@ -189,7 +189,7 @@ void NVDRV::QueryEvent(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); auto event = nvdrv->GetEvent(event_id); event->Clear(); - rb.PushCopyObjects(event); + rb.PushCopyObjects(event.get()); rb.PushEnum(NvResult::Success); } else { IPC::ResponseBuilder rb{ctx, 3}; diff --git a/src/core/hle/service/nvdrv/nvdrv.cpp b/src/core/hle/service/nvdrv/nvdrv.cpp index ede77858a..6bba9c0b3 100644 --- a/src/core/hle/service/nvdrv/nvdrv.cpp +++ b/src/core/hle/service/nvdrv/nvdrv.cpp @@ -178,7 +178,7 @@ void Module::SignalSyncpt(const u32 syncpoint_id, const u32 value) { } std::shared_ptr Module::GetEvent(const u32 event_id) const { - return events_interface.events[event_id].event->GetReadableEvent(); + return SharedFrom(events_interface.events[event_id].event->GetReadableEvent()); } std::shared_ptr Module::GetEventWriteable(const u32 event_id) const { diff --git a/src/core/hle/service/nvflinger/buffer_queue.cpp b/src/core/hle/service/nvflinger/buffer_queue.cpp index 7842a82ed..f783ae54f 100644 --- a/src/core/hle/service/nvflinger/buffer_queue.cpp +++ b/src/core/hle/service/nvflinger/buffer_queue.cpp @@ -194,7 +194,7 @@ std::shared_ptr BufferQueue::GetWritableBufferWaitEvent( } std::shared_ptr BufferQueue::GetBufferWaitEvent() const { - return buffer_wait_event->GetReadableEvent(); + return SharedFrom(buffer_wait_event->GetReadableEvent()); } } // namespace Service::NVFlinger diff --git a/src/core/hle/service/nvflinger/buffer_queue.h b/src/core/hle/service/nvflinger/buffer_queue.h index 163fa4c54..9a21c7426 100644 --- a/src/core/hle/service/nvflinger/buffer_queue.h +++ b/src/core/hle/service/nvflinger/buffer_queue.h @@ -13,6 +13,7 @@ #include "common/common_funcs.h" #include "common/math_util.h" #include "common/swap.h" +#include "core/hle/kernel/k_readable_event.h" #include "core/hle/kernel/object.h" #include "core/hle/service/nvdrv/nvdata.h" diff --git a/src/core/hle/service/sm/controller.cpp b/src/core/hle/service/sm/controller.cpp index 916177efd..b34fe4bc2 100644 --- a/src/core/hle/service/sm/controller.cpp +++ b/src/core/hle/service/sm/controller.cpp @@ -30,7 +30,7 @@ void Controller::CloneCurrentObject(Kernel::HLERequestContext& ctx) { IPC::ResponseBuilder rb{ctx, 2, 0, 1, IPC::ResponseBuilder::Flags::AlwaysMoveHandles}; rb.Push(RESULT_SUCCESS); - rb.PushMoveObjects(ctx.Session()->GetParent()->Client()); + rb.PushMoveObjects(ctx.Session()->GetParent()->Client().get()); } void Controller::CloneCurrentObjectEx(Kernel::HLERequestContext& ctx) { diff --git a/src/core/hle/service/sm/sm.cpp b/src/core/hle/service/sm/sm.cpp index 94608d529..62f7a5358 100644 --- a/src/core/hle/service/sm/sm.cpp +++ b/src/core/hle/service/sm/sm.cpp @@ -134,7 +134,7 @@ void SM::GetService(Kernel::HLERequestContext& ctx) { const auto& server_port = client_port.Unwrap()->GetServerPort(); if (server_port->GetHLEHandler()) { - server_port->GetHLEHandler()->ClientConnected(server); + server_port->GetHLEHandler()->ClientConnected(client, server); } else { server_port->AppendPendingSession(server); } @@ -142,7 +142,7 @@ void SM::GetService(Kernel::HLERequestContext& ctx) { LOG_DEBUG(Service_SM, "called service={} -> session={}", name, client->GetObjectId()); IPC::ResponseBuilder rb{ctx, 2, 0, 1, IPC::ResponseBuilder::Flags::AlwaysMoveHandles}; rb.Push(RESULT_SUCCESS); - rb.PushMoveObjects(std::move(client)); + rb.PushMoveObjects(client.get()); } void SM::RegisterService(Kernel::HLERequestContext& ctx) { @@ -170,7 +170,9 @@ void SM::RegisterService(Kernel::HLERequestContext& ctx) { IPC::ResponseBuilder rb{ctx, 2, 0, 1, IPC::ResponseBuilder::Flags::AlwaysMoveHandles}; rb.Push(handle.Code()); - rb.PushMoveObjects(std::move(handle).Unwrap()); + + auto server_port = handle.Unwrap(); + rb.PushMoveObjects(server_port.get()); } void SM::UnregisterService(Kernel::HLERequestContext& ctx) { diff --git a/src/core/hle/service/time/time.cpp b/src/core/hle/service/time/time.cpp index 32f372d71..30283f239 100644 --- a/src/core/hle/service/time/time.cpp +++ b/src/core/hle/service/time/time.cpp @@ -393,7 +393,7 @@ void Module::Interface::GetSharedMemoryNativeHandle(Kernel::HLERequestContext& c LOG_DEBUG(Service_Time, "called"); IPC::ResponseBuilder rb{ctx, 2, 1}; rb.Push(RESULT_SUCCESS); - rb.PushCopyObjects(SharedFrom(&system.Kernel().GetTimeSharedMem())); + rb.PushCopyObjects(&system.Kernel().GetTimeSharedMem()); } Module::Interface::Interface(std::shared_ptr module_, Core::System& system_, diff --git a/src/core/hle/service/vi/display/vi_display.cpp b/src/core/hle/service/vi/display/vi_display.cpp index ac9e87338..9ffa71352 100644 --- a/src/core/hle/service/vi/display/vi_display.cpp +++ b/src/core/hle/service/vi/display/vi_display.cpp @@ -34,7 +34,7 @@ const Layer& Display::GetLayer(std::size_t index) const { } std::shared_ptr Display::GetVSyncEvent() const { - return vsync_event->GetReadableEvent(); + return SharedFrom(vsync_event->GetReadableEvent()); } void Display::SignalVSyncEvent() { diff --git a/src/core/hle/service/vi/vi.cpp b/src/core/hle/service/vi/vi.cpp index 7ae07d072..6e507bfb8 100644 --- a/src/core/hle/service/vi/vi.cpp +++ b/src/core/hle/service/vi/vi.cpp @@ -674,7 +674,7 @@ private: // TODO(Subv): Find out what this actually is. IPC::ResponseBuilder rb{ctx, 2, 1}; rb.Push(RESULT_SUCCESS); - rb.PushCopyObjects(buffer_queue.GetBufferWaitEvent()); + rb.PushCopyObjects(buffer_queue.GetBufferWaitEvent().get()); } NVFlinger::NVFlinger& nv_flinger; @@ -1209,7 +1209,7 @@ private: IPC::ResponseBuilder rb{ctx, 2, 1}; rb.Push(RESULT_SUCCESS); - rb.PushCopyObjects(vsync_event); + rb.PushCopyObjects(vsync_event.get()); } void ConvertScalingMode(Kernel::HLERequestContext& ctx) { -- cgit v1.2.3