From ff610103b58b3e0dd39fafb539a1cc0bc0fae577 Mon Sep 17 00:00:00 2001 From: Zach Hilman Date: Mon, 26 Nov 2018 18:34:07 -0500 Subject: core: Port all current usages of Event to Readable/WritableEvent --- src/core/hle/service/btdrv/btdrv.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/core/hle/service/btdrv/btdrv.cpp') diff --git a/src/core/hle/service/btdrv/btdrv.cpp b/src/core/hle/service/btdrv/btdrv.cpp index 2eadcdd05..04c78e81a 100644 --- a/src/core/hle/service/btdrv/btdrv.cpp +++ b/src/core/hle/service/btdrv/btdrv.cpp @@ -4,8 +4,10 @@ #include "common/logging/log.h" #include "core/hle/ipc_helpers.h" -#include "core/hle/kernel/event.h" #include "core/hle/kernel/hle_ipc.h" +#include "core/hle/kernel/kernel.h" +#include "core/hle/kernel/readable_event.h" +#include "core/hle/kernel/writable_event.h" #include "core/hle/service/btdrv/btdrv.h" #include "core/hle/service/service.h" #include "core/hle/service/sm/sm.h" @@ -30,20 +32,22 @@ public: }; // clang-format on RegisterHandlers(functions); + + auto& kernel = Core::System::GetInstance().Kernel(); + register_event = Kernel::WritableEvent::CreateRegisteredEventPair( + kernel, Kernel::ResetType::OneShot, "BT:RegisterEvent"); } private: void RegisterEvent(Kernel::HLERequestContext& ctx) { LOG_WARNING(Service_BTM, "(STUBBED) called"); - auto& kernel = Core::System::GetInstance().Kernel(); - register_event = - Kernel::Event::Create(kernel, Kernel::ResetType::OneShot, "BT:RegisterEvent"); IPC::ResponseBuilder rb{ctx, 2, 1}; rb.Push(RESULT_SUCCESS); - rb.PushCopyObjects(register_event); + const auto& event{Core::System::GetInstance().Kernel().FindNamedEvent("BT:RegisterEvent")}; + rb.PushCopyObjects(event->second); } - Kernel::SharedPtr register_event; + Kernel::SharedPtr register_event; }; class BtDrv final : public ServiceFramework { -- cgit v1.2.3