From e86a7e36912b6f3fc64a594338d3c1ac768e3bb8 Mon Sep 17 00:00:00 2001 From: bunnei Date: Fri, 29 Jan 2021 22:48:06 -0800 Subject: hle: kernel: Rename ReadableEvent to KReadableEvent. --- src/core/hle/kernel/hle_ipc.cpp | 2 +- src/core/hle/kernel/hle_ipc.h | 2 +- src/core/hle/kernel/k_readable_event.cpp | 52 +++++++++++++++++++ src/core/hle/kernel/k_readable_event.h | 59 ++++++++++++++++++++++ src/core/hle/kernel/readable_event.cpp | 52 ------------------- src/core/hle/kernel/readable_event.h | 59 ---------------------- src/core/hle/kernel/svc.cpp | 6 +-- src/core/hle/kernel/writable_event.cpp | 6 +-- src/core/hle/kernel/writable_event.h | 10 ++-- src/core/hle/service/am/am.cpp | 6 +-- src/core/hle/service/am/am.h | 4 +- src/core/hle/service/am/applets/applets.cpp | 8 +-- src/core/hle/service/am/applets/applets.h | 6 +-- src/core/hle/service/aoc/aoc_u.cpp | 2 +- src/core/hle/service/audio/audout_u.cpp | 2 +- src/core/hle/service/audio/audren_u.cpp | 2 +- src/core/hle/service/bcat/backend/backend.cpp | 2 +- src/core/hle/service/bcat/backend/backend.h | 4 +- src/core/hle/service/bcat/module.cpp | 6 +-- src/core/hle/service/btdrv/btdrv.cpp | 2 +- src/core/hle/service/btm/btm.cpp | 2 +- src/core/hle/service/friend/friend.cpp | 2 +- src/core/hle/service/hid/controllers/npad.cpp | 5 +- src/core/hle/service/hid/controllers/npad.h | 2 +- src/core/hle/service/hid/hid.cpp | 2 +- src/core/hle/service/nfp/nfp.cpp | 4 +- src/core/hle/service/nfp/nfp.h | 4 +- src/core/hle/service/nifm/nifm.cpp | 2 +- src/core/hle/service/nim/nim.cpp | 2 +- src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp | 2 +- src/core/hle/service/nvdrv/interface.cpp | 2 +- src/core/hle/service/nvdrv/nvdrv.cpp | 4 +- src/core/hle/service/nvdrv/nvdrv.h | 2 +- src/core/hle/service/nvflinger/buffer_queue.cpp | 4 +- src/core/hle/service/nvflinger/buffer_queue.h | 2 +- src/core/hle/service/nvflinger/nvflinger.cpp | 4 +- src/core/hle/service/nvflinger/nvflinger.h | 4 +- src/core/hle/service/ptm/psm.cpp | 2 +- src/core/hle/service/vi/display/vi_display.cpp | 4 +- src/core/hle/service/vi/display/vi_display.h | 2 +- src/core/hle/service/vi/vi.cpp | 2 +- 41 files changed, 176 insertions(+), 175 deletions(-) create mode 100644 src/core/hle/kernel/k_readable_event.cpp create mode 100644 src/core/hle/kernel/k_readable_event.h delete mode 100644 src/core/hle/kernel/readable_event.cpp delete mode 100644 src/core/hle/kernel/readable_event.h (limited to 'src/core/hle') diff --git a/src/core/hle/kernel/hle_ipc.cpp b/src/core/hle/kernel/hle_ipc.cpp index c7b10ca7a..93b9f793e 100644 --- a/src/core/hle/kernel/hle_ipc.cpp +++ b/src/core/hle/kernel/hle_ipc.cpp @@ -17,13 +17,13 @@ #include "core/hle/kernel/errors.h" #include "core/hle/kernel/handle_table.h" #include "core/hle/kernel/hle_ipc.h" +#include "core/hle/kernel/k_readable_event.h" #include "core/hle/kernel/k_scheduler.h" #include "core/hle/kernel/k_scoped_scheduler_lock_and_sleep.h" #include "core/hle/kernel/k_thread.h" #include "core/hle/kernel/kernel.h" #include "core/hle/kernel/object.h" #include "core/hle/kernel/process.h" -#include "core/hle/kernel/readable_event.h" #include "core/hle/kernel/server_session.h" #include "core/hle/kernel/time_manager.h" #include "core/hle/kernel/writable_event.h" diff --git a/src/core/hle/kernel/hle_ipc.h b/src/core/hle/kernel/hle_ipc.h index 9f764c79a..89ae2a329 100644 --- a/src/core/hle/kernel/hle_ipc.h +++ b/src/core/hle/kernel/hle_ipc.h @@ -41,7 +41,7 @@ class KernelCore; class Process; class ServerSession; class KThread; -class ReadableEvent; +class KReadableEvent; class WritableEvent; enum class ThreadWakeupReason; diff --git a/src/core/hle/kernel/k_readable_event.cpp b/src/core/hle/kernel/k_readable_event.cpp new file mode 100644 index 000000000..e9e191bc6 --- /dev/null +++ b/src/core/hle/kernel/k_readable_event.cpp @@ -0,0 +1,52 @@ +// Copyright 2014 Citra Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#include +#include "common/assert.h" +#include "common/logging/log.h" +#include "core/hle/kernel/errors.h" +#include "core/hle/kernel/k_readable_event.h" +#include "core/hle/kernel/k_scheduler.h" +#include "core/hle/kernel/k_thread.h" +#include "core/hle/kernel/kernel.h" +#include "core/hle/kernel/object.h" + +namespace Kernel { + +KReadableEvent::KReadableEvent(KernelCore& kernel) : KSynchronizationObject{kernel} {} +KReadableEvent::~KReadableEvent() = default; + +void KReadableEvent::Signal() { + if (is_signaled) { + return; + } + + is_signaled = true; + NotifyAvailable(); +} + +bool KReadableEvent::IsSignaled() const { + ASSERT(kernel.GlobalSchedulerContext().IsLocked()); + + return is_signaled; +} + +void KReadableEvent::Clear() { + is_signaled = false; +} + +ResultCode KReadableEvent::Reset() { + KScopedSchedulerLock lock(kernel); + if (!is_signaled) { + LOG_TRACE(Kernel, "Handle is not signaled! object_id={}, object_type={}, object_name={}", + GetObjectId(), GetTypeName(), GetName()); + return ERR_INVALID_STATE; + } + + Clear(); + + return RESULT_SUCCESS; +} + +} // namespace Kernel diff --git a/src/core/hle/kernel/k_readable_event.h b/src/core/hle/kernel/k_readable_event.h new file mode 100644 index 000000000..50dfc60d3 --- /dev/null +++ b/src/core/hle/kernel/k_readable_event.h @@ -0,0 +1,59 @@ +// Copyright 2014 Citra Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +#include "core/hle/kernel/k_synchronization_object.h" +#include "core/hle/kernel/object.h" + +union ResultCode; + +namespace Kernel { + +class KernelCore; +class WritableEvent; + +class KReadableEvent final : public KSynchronizationObject { + friend class WritableEvent; + +public: + ~KReadableEvent() override; + + std::string GetTypeName() const override { + return "ReadableEvent"; + } + std::string GetName() const override { + return name; + } + + static constexpr HandleType HANDLE_TYPE = HandleType::ReadableEvent; + HandleType GetHandleType() const override { + return HANDLE_TYPE; + } + + /// Unconditionally clears the readable event's state. + void Clear(); + + /// Clears the readable event's state if and only if it + /// has already been signaled. + /// + /// @pre The event must be in a signaled state. If this event + /// is in an unsignaled state and this function is called, + /// then ERR_INVALID_STATE will be returned. + ResultCode Reset(); + + void Signal(); + + bool IsSignaled() const override; + + void Finalize() override {} + +private: + explicit KReadableEvent(KernelCore& kernel); + + bool is_signaled{}; + std::string name; ///< Name of event (optional) +}; + +} // namespace Kernel diff --git a/src/core/hle/kernel/readable_event.cpp b/src/core/hle/kernel/readable_event.cpp deleted file mode 100644 index 596d01479..000000000 --- a/src/core/hle/kernel/readable_event.cpp +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2014 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#include -#include "common/assert.h" -#include "common/logging/log.h" -#include "core/hle/kernel/errors.h" -#include "core/hle/kernel/k_scheduler.h" -#include "core/hle/kernel/k_thread.h" -#include "core/hle/kernel/kernel.h" -#include "core/hle/kernel/object.h" -#include "core/hle/kernel/readable_event.h" - -namespace Kernel { - -ReadableEvent::ReadableEvent(KernelCore& kernel) : KSynchronizationObject{kernel} {} -ReadableEvent::~ReadableEvent() = default; - -void ReadableEvent::Signal() { - if (is_signaled) { - return; - } - - is_signaled = true; - NotifyAvailable(); -} - -bool ReadableEvent::IsSignaled() const { - ASSERT(kernel.GlobalSchedulerContext().IsLocked()); - - return is_signaled; -} - -void ReadableEvent::Clear() { - is_signaled = false; -} - -ResultCode ReadableEvent::Reset() { - KScopedSchedulerLock lock(kernel); - if (!is_signaled) { - LOG_TRACE(Kernel, "Handle is not signaled! object_id={}, object_type={}, object_name={}", - GetObjectId(), GetTypeName(), GetName()); - return ERR_INVALID_STATE; - } - - Clear(); - - return RESULT_SUCCESS; -} - -} // namespace Kernel diff --git a/src/core/hle/kernel/readable_event.h b/src/core/hle/kernel/readable_event.h deleted file mode 100644 index 2195710c2..000000000 --- a/src/core/hle/kernel/readable_event.h +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright 2014 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#pragma once - -#include "core/hle/kernel/k_synchronization_object.h" -#include "core/hle/kernel/object.h" - -union ResultCode; - -namespace Kernel { - -class KernelCore; -class WritableEvent; - -class ReadableEvent final : public KSynchronizationObject { - friend class WritableEvent; - -public: - ~ReadableEvent() override; - - std::string GetTypeName() const override { - return "ReadableEvent"; - } - std::string GetName() const override { - return name; - } - - static constexpr HandleType HANDLE_TYPE = HandleType::ReadableEvent; - HandleType GetHandleType() const override { - return HANDLE_TYPE; - } - - /// Unconditionally clears the readable event's state. - void Clear(); - - /// Clears the readable event's state if and only if it - /// has already been signaled. - /// - /// @pre The event must be in a signaled state. If this event - /// is in an unsignaled state and this function is called, - /// then ERR_INVALID_STATE will be returned. - ResultCode Reset(); - - void Signal(); - - bool IsSignaled() const override; - - void Finalize() override {} - -private: - explicit ReadableEvent(KernelCore& kernel); - - bool is_signaled{}; - std::string name; ///< Name of event (optional) -}; - -} // namespace Kernel diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index 74eb90100..1d2a2c321 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp @@ -26,6 +26,7 @@ #include "core/hle/kernel/handle_table.h" #include "core/hle/kernel/k_address_arbiter.h" #include "core/hle/kernel/k_condition_variable.h" +#include "core/hle/kernel/k_readable_event.h" #include "core/hle/kernel/k_resource_limit.h" #include "core/hle/kernel/k_scheduler.h" #include "core/hle/kernel/k_scoped_scheduler_lock_and_sleep.h" @@ -37,7 +38,6 @@ #include "core/hle/kernel/memory/page_table.h" #include "core/hle/kernel/physical_core.h" #include "core/hle/kernel/process.h" -#include "core/hle/kernel/readable_event.h" #include "core/hle/kernel/shared_memory.h" #include "core/hle/kernel/svc.h" #include "core/hle/kernel/svc_results.h" @@ -1727,7 +1727,7 @@ static ResultCode ResetSignal(Core::System& system, Handle handle) { const auto& handle_table = system.Kernel().CurrentProcess()->GetHandleTable(); - auto event = handle_table.Get(handle); + auto event = handle_table.Get(handle); if (event) { return event->Reset(); } @@ -1909,7 +1909,7 @@ static ResultCode ClearEvent(Core::System& system, Handle handle) { return RESULT_SUCCESS; } - auto readable_event = handle_table.Get(handle); + auto readable_event = handle_table.Get(handle); if (readable_event) { readable_event->Clear(); return RESULT_SUCCESS; diff --git a/src/core/hle/kernel/writable_event.cpp b/src/core/hle/kernel/writable_event.cpp index 142212ee4..0d261e6e8 100644 --- a/src/core/hle/kernel/writable_event.cpp +++ b/src/core/hle/kernel/writable_event.cpp @@ -4,10 +4,10 @@ #include #include "common/assert.h" +#include "core/hle/kernel/k_readable_event.h" #include "core/hle/kernel/k_thread.h" #include "core/hle/kernel/kernel.h" #include "core/hle/kernel/object.h" -#include "core/hle/kernel/readable_event.h" #include "core/hle/kernel/writable_event.h" namespace Kernel { @@ -17,7 +17,7 @@ WritableEvent::~WritableEvent() = default; EventPair WritableEvent::CreateEventPair(KernelCore& kernel, std::string name) { std::shared_ptr writable_event(new WritableEvent(kernel)); - std::shared_ptr readable_event(new ReadableEvent(kernel)); + std::shared_ptr readable_event(new KReadableEvent(kernel)); writable_event->name = name + ":Writable"; writable_event->readable = readable_event; @@ -26,7 +26,7 @@ EventPair WritableEvent::CreateEventPair(KernelCore& kernel, std::string name) { return {std::move(readable_event), std::move(writable_event)}; } -std::shared_ptr WritableEvent::GetReadableEvent() const { +std::shared_ptr WritableEvent::GetReadableEvent() const { return readable; } diff --git a/src/core/hle/kernel/writable_event.h b/src/core/hle/kernel/writable_event.h index 467eb2c21..b288267c5 100644 --- a/src/core/hle/kernel/writable_event.h +++ b/src/core/hle/kernel/writable_event.h @@ -1,4 +1,4 @@ -// Copyright 2014 Citra Emulator Project +// Copyright 2021 yuzu Emulator Project // Licensed under GPLv2 or any later version // Refer to the license.txt file included. @@ -11,11 +11,11 @@ namespace Kernel { class KernelCore; -class ReadableEvent; +class KReadableEvent; class WritableEvent; struct EventPair { - std::shared_ptr readable; + std::shared_ptr readable; std::shared_ptr writable; }; @@ -42,7 +42,7 @@ public: return HANDLE_TYPE; } - std::shared_ptr GetReadableEvent() const; + std::shared_ptr GetReadableEvent() const; void Signal(); void Clear(); @@ -52,7 +52,7 @@ public: private: explicit WritableEvent(KernelCore& kernel); - std::shared_ptr readable; + std::shared_ptr readable; std::string name; ///< Name of event (optional) }; diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index 07a755599..8167bd89b 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp @@ -13,9 +13,9 @@ #include "core/file_sys/registered_cache.h" #include "core/file_sys/savedata_factory.h" #include "core/hle/ipc_helpers.h" +#include "core/hle/kernel/k_readable_event.h" #include "core/hle/kernel/kernel.h" #include "core/hle/kernel/process.h" -#include "core/hle/kernel/readable_event.h" #include "core/hle/kernel/transfer_memory.h" #include "core/hle/kernel/writable_event.h" #include "core/hle/service/acc/profile_manager.h" @@ -567,11 +567,11 @@ AppletMessageQueue::AppletMessageQueue(Kernel::KernelCore& kernel) { AppletMessageQueue::~AppletMessageQueue() = default; -const std::shared_ptr& AppletMessageQueue::GetMessageReceiveEvent() const { +const std::shared_ptr& AppletMessageQueue::GetMessageReceiveEvent() const { return on_new_message.readable; } -const std::shared_ptr& AppletMessageQueue::GetOperationModeChangedEvent() +const std::shared_ptr& AppletMessageQueue::GetOperationModeChangedEvent() const { return on_operation_mode_changed.readable; } diff --git a/src/core/hle/service/am/am.h b/src/core/hle/service/am/am.h index 154a48710..ff0510f36 100644 --- a/src/core/hle/service/am/am.h +++ b/src/core/hle/service/am/am.h @@ -55,8 +55,8 @@ public: explicit AppletMessageQueue(Kernel::KernelCore& kernel); ~AppletMessageQueue(); - const std::shared_ptr& GetMessageReceiveEvent() const; - const std::shared_ptr& GetOperationModeChangedEvent() const; + const std::shared_ptr& GetMessageReceiveEvent() const; + const std::shared_ptr& 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 08676c3fc..ac2f3f43a 100644 --- a/src/core/hle/service/am/applets/applets.cpp +++ b/src/core/hle/service/am/applets/applets.cpp @@ -11,7 +11,7 @@ #include "core/frontend/applets/profile_select.h" #include "core/frontend/applets/software_keyboard.h" #include "core/frontend/applets/web_browser.h" -#include "core/hle/kernel/readable_event.h" +#include "core/hle/kernel/k_readable_event.h" #include "core/hle/kernel/server_session.h" #include "core/hle/kernel/writable_event.h" #include "core/hle/service/am/am.h" @@ -112,15 +112,15 @@ void AppletDataBroker::SignalStateChanged() const { state_changed_event.writable->Signal(); } -std::shared_ptr AppletDataBroker::GetNormalDataEvent() const { +std::shared_ptr AppletDataBroker::GetNormalDataEvent() const { return pop_out_data_event.readable; } -std::shared_ptr AppletDataBroker::GetInteractiveDataEvent() const { +std::shared_ptr AppletDataBroker::GetInteractiveDataEvent() const { return pop_interactive_out_data_event.readable; } -std::shared_ptr AppletDataBroker::GetStateChangedEvent() const { +std::shared_ptr AppletDataBroker::GetStateChangedEvent() const { return state_changed_event.readable; } diff --git a/src/core/hle/service/am/applets/applets.h b/src/core/hle/service/am/applets/applets.h index 4fd792c05..af0ad8346 100644 --- a/src/core/hle/service/am/applets/applets.h +++ b/src/core/hle/service/am/applets/applets.h @@ -87,9 +87,9 @@ public: void SignalStateChanged() const; - std::shared_ptr GetNormalDataEvent() const; - std::shared_ptr GetInteractiveDataEvent() const; - std::shared_ptr GetStateChangedEvent() const; + std::shared_ptr GetNormalDataEvent() const; + std::shared_ptr GetInteractiveDataEvent() const; + std::shared_ptr GetStateChangedEvent() const; private: // Queues are named from applet's perspective diff --git a/src/core/hle/service/aoc/aoc_u.cpp b/src/core/hle/service/aoc/aoc_u.cpp index 23e28565b..d63bb2a04 100644 --- a/src/core/hle/service/aoc/aoc_u.cpp +++ b/src/core/hle/service/aoc/aoc_u.cpp @@ -14,9 +14,9 @@ #include "core/file_sys/patch_manager.h" #include "core/file_sys/registered_cache.h" #include "core/hle/ipc_helpers.h" +#include "core/hle/kernel/k_readable_event.h" #include "core/hle/kernel/kernel.h" #include "core/hle/kernel/process.h" -#include "core/hle/kernel/readable_event.h" #include "core/hle/kernel/writable_event.h" #include "core/hle/service/aoc/aoc_u.h" #include "core/loader/loader.h" diff --git a/src/core/hle/service/audio/audout_u.cpp b/src/core/hle/service/audio/audout_u.cpp index 273a46265..b4c8e5cf4 100644 --- a/src/core/hle/service/audio/audout_u.cpp +++ b/src/core/hle/service/audio/audout_u.cpp @@ -14,8 +14,8 @@ #include "core/core.h" #include "core/hle/ipc_helpers.h" #include "core/hle/kernel/hle_ipc.h" +#include "core/hle/kernel/k_readable_event.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/audio/audout_u.h" #include "core/hle/service/audio/errors.h" diff --git a/src/core/hle/service/audio/audren_u.cpp b/src/core/hle/service/audio/audren_u.cpp index c5c22d053..dee0df5b6 100644 --- a/src/core/hle/service/audio/audren_u.cpp +++ b/src/core/hle/service/audio/audren_u.cpp @@ -16,8 +16,8 @@ #include "core/core.h" #include "core/hle/ipc_helpers.h" #include "core/hle/kernel/hle_ipc.h" +#include "core/hle/kernel/k_readable_event.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/audio/audren_u.h" #include "core/hle/service/audio/errors.h" diff --git a/src/core/hle/service/bcat/backend/backend.cpp b/src/core/hle/service/bcat/backend/backend.cpp index 174388445..ebc18c123 100644 --- a/src/core/hle/service/bcat/backend/backend.cpp +++ b/src/core/hle/service/bcat/backend/backend.cpp @@ -16,7 +16,7 @@ ProgressServiceBackend::ProgressServiceBackend(Kernel::KernelCore& kernel, kernel, std::string("ProgressServiceBackend:UpdateEvent:").append(event_name)); } -std::shared_ptr ProgressServiceBackend::GetEvent() const { +std::shared_ptr ProgressServiceBackend::GetEvent() const { return event.readable; } diff --git a/src/core/hle/service/bcat/backend/backend.h b/src/core/hle/service/bcat/backend/backend.h index 48bbbe66f..fb398bd17 100644 --- a/src/core/hle/service/bcat/backend/backend.h +++ b/src/core/hle/service/bcat/backend/backend.h @@ -11,7 +11,7 @@ #include "common/common_types.h" #include "core/file_sys/vfs_types.h" -#include "core/hle/kernel/readable_event.h" +#include "core/hle/kernel/k_readable_event.h" #include "core/hle/kernel/writable_event.h" #include "core/hle/result.h" @@ -98,7 +98,7 @@ public: private: explicit ProgressServiceBackend(Kernel::KernelCore& kernel, std::string_view event_name); - std::shared_ptr GetEvent() const; + std::shared_ptr GetEvent() const; DeliveryCacheProgressImpl& GetImpl(); void SignalUpdate() const; diff --git a/src/core/hle/service/bcat/module.cpp b/src/core/hle/service/bcat/module.cpp index b8696a395..d7a77185f 100644 --- a/src/core/hle/service/bcat/module.cpp +++ b/src/core/hle/service/bcat/module.cpp @@ -11,8 +11,8 @@ #include "core/core.h" #include "core/file_sys/vfs.h" #include "core/hle/ipc_helpers.h" +#include "core/hle/kernel/k_readable_event.h" #include "core/hle/kernel/process.h" -#include "core/hle/kernel/readable_event.h" #include "core/hle/kernel/writable_event.h" #include "core/hle/service/bcat/backend/backend.h" #include "core/hle/service/bcat/bcat.h" @@ -89,7 +89,7 @@ struct DeliveryCacheDirectoryEntry { class IDeliveryCacheProgressService final : public ServiceFramework { public: explicit IDeliveryCacheProgressService(Core::System& system_, - std::shared_ptr event_, + std::shared_ptr event_, const DeliveryCacheProgressImpl& impl_) : ServiceFramework{system_, "IDeliveryCacheProgressService"}, event{std::move(event_)}, impl{impl_} { @@ -121,7 +121,7 @@ private: rb.Push(RESULT_SUCCESS); } - std::shared_ptr event; + std::shared_ptr event; const DeliveryCacheProgressImpl& impl; }; diff --git a/src/core/hle/service/btdrv/btdrv.cpp b/src/core/hle/service/btdrv/btdrv.cpp index 2de86f1f1..908d020e1 100644 --- a/src/core/hle/service/btdrv/btdrv.cpp +++ b/src/core/hle/service/btdrv/btdrv.cpp @@ -6,8 +6,8 @@ #include "core/core.h" #include "core/hle/ipc_helpers.h" #include "core/hle/kernel/hle_ipc.h" +#include "core/hle/kernel/k_readable_event.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" diff --git a/src/core/hle/service/btm/btm.cpp b/src/core/hle/service/btm/btm.cpp index 38b55300e..9ec4235a2 100644 --- a/src/core/hle/service/btm/btm.cpp +++ b/src/core/hle/service/btm/btm.cpp @@ -8,8 +8,8 @@ #include "core/core.h" #include "core/hle/ipc_helpers.h" #include "core/hle/kernel/hle_ipc.h" +#include "core/hle/kernel/k_readable_event.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/btm/btm.h" #include "core/hle/service/service.h" diff --git a/src/core/hle/service/friend/friend.cpp b/src/core/hle/service/friend/friend.cpp index c5b053c31..5513d3adf 100644 --- a/src/core/hle/service/friend/friend.cpp +++ b/src/core/hle/service/friend/friend.cpp @@ -7,7 +7,7 @@ #include "common/uuid.h" #include "core/core.h" #include "core/hle/ipc_helpers.h" -#include "core/hle/kernel/readable_event.h" +#include "core/hle/kernel/k_readable_event.h" #include "core/hle/kernel/writable_event.h" #include "core/hle/service/friend/errors.h" #include "core/hle/service/friend/friend.h" diff --git a/src/core/hle/service/hid/controllers/npad.cpp b/src/core/hle/service/hid/controllers/npad.cpp index 0c227b135..4c08ca2ca 100644 --- a/src/core/hle/service/hid/controllers/npad.cpp +++ b/src/core/hle/service/hid/controllers/npad.cpp @@ -12,8 +12,8 @@ #include "core/core.h" #include "core/core_timing.h" #include "core/frontend/input.h" +#include "core/hle/kernel/k_readable_event.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/hid/controllers/npad.h" #include "core/settings.h" @@ -872,7 +872,8 @@ 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 { +std::shared_ptr Controller_NPad::GetStyleSetChangedEvent( + u32 npad_id) const { const auto& styleset_event = styleset_changed_events[NPadIdToIndex(npad_id)]; return styleset_event.readable; } diff --git a/src/core/hle/service/hid/controllers/npad.h b/src/core/hle/service/hid/controllers/npad.h index 2e13922b9..944970766 100644 --- a/src/core/hle/service/hid/controllers/npad.h +++ b/src/core/hle/service/hid/controllers/npad.h @@ -187,7 +187,7 @@ public: bool IsVibrationDeviceMounted(const DeviceHandle& vibration_device_handle) const; - std::shared_ptr GetStyleSetChangedEvent(u32 npad_id) const; + std::shared_ptr 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 4cee4838c..ee12d8e19 100644 --- a/src/core/hle/service/hid/hid.cpp +++ b/src/core/hle/service/hid/hid.cpp @@ -14,8 +14,8 @@ #include "core/hle/ipc_helpers.h" #include "core/hle/kernel/client_port.h" #include "core/hle/kernel/client_session.h" +#include "core/hle/kernel/k_readable_event.h" #include "core/hle/kernel/kernel.h" -#include "core/hle/kernel/readable_event.h" #include "core/hle/kernel/shared_memory.h" #include "core/hle/kernel/writable_event.h" #include "core/hle/service/hid/errors.h" diff --git a/src/core/hle/service/nfp/nfp.cpp b/src/core/hle/service/nfp/nfp.cpp index a515fdc60..173ab341d 100644 --- a/src/core/hle/service/nfp/nfp.cpp +++ b/src/core/hle/service/nfp/nfp.cpp @@ -8,9 +8,9 @@ #include "common/logging/log.h" #include "core/core.h" #include "core/hle/ipc_helpers.h" +#include "core/hle/kernel/k_readable_event.h" #include "core/hle/kernel/k_thread.h" #include "core/hle/kernel/kernel.h" -#include "core/hle/kernel/readable_event.h" #include "core/hle/kernel/writable_event.h" #include "core/hle/lock.h" #include "core/hle/service/nfp/nfp.h" @@ -340,7 +340,7 @@ bool Module::Interface::LoadAmiibo(const std::vector& buffer) { return true; } -const std::shared_ptr& Module::Interface::GetNFCEvent() const { +const std::shared_ptr& Module::Interface::GetNFCEvent() const { return nfc_tag_load.readable; } diff --git a/src/core/hle/service/nfp/nfp.h b/src/core/hle/service/nfp/nfp.h index 295de535b..de510ff24 100644 --- a/src/core/hle/service/nfp/nfp.h +++ b/src/core/hle/service/nfp/nfp.h @@ -6,7 +6,7 @@ #include #include -#include "core/hle/kernel/readable_event.h" +#include "core/hle/kernel/k_readable_event.h" #include "core/hle/kernel/writable_event.h" #include "core/hle/service/service.h" @@ -35,7 +35,7 @@ public: void CreateUserInterface(Kernel::HLERequestContext& ctx); bool LoadAmiibo(const std::vector& buffer); - const std::shared_ptr& GetNFCEvent() const; + const std::shared_ptr& GetNFCEvent() const; const AmiiboFile& GetAmiiboBuffer() const; private: diff --git a/src/core/hle/service/nifm/nifm.cpp b/src/core/hle/service/nifm/nifm.cpp index 8372e170c..0a09c41ff 100644 --- a/src/core/hle/service/nifm/nifm.cpp +++ b/src/core/hle/service/nifm/nifm.cpp @@ -4,8 +4,8 @@ #include "core/core.h" #include "core/hle/ipc_helpers.h" +#include "core/hle/kernel/k_readable_event.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/nifm/nifm.h" #include "core/hle/service/service.h" diff --git a/src/core/hle/service/nim/nim.cpp b/src/core/hle/service/nim/nim.cpp index d16223064..bb681f0c7 100644 --- a/src/core/hle/service/nim/nim.cpp +++ b/src/core/hle/service/nim/nim.cpp @@ -6,8 +6,8 @@ #include #include "core/core.h" #include "core/hle/ipc_helpers.h" +#include "core/hle/kernel/k_readable_event.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/nim/nim.h" #include "core/hle/service/service.h" diff --git a/src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp b/src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp index 060599bab..1fd5504a8 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp @@ -8,7 +8,7 @@ #include "common/assert.h" #include "common/logging/log.h" #include "core/core.h" -#include "core/hle/kernel/readable_event.h" +#include "core/hle/kernel/k_readable_event.h" #include "core/hle/kernel/writable_event.h" #include "core/hle/service/nvdrv/devices/nvhost_ctrl.h" #include "video_core/gpu.h" diff --git a/src/core/hle/service/nvdrv/interface.cpp b/src/core/hle/service/nvdrv/interface.cpp index 1328b64d0..187501be8 100644 --- a/src/core/hle/service/nvdrv/interface.cpp +++ b/src/core/hle/service/nvdrv/interface.cpp @@ -6,9 +6,9 @@ #include "common/logging/log.h" #include "core/core.h" #include "core/hle/ipc_helpers.h" +#include "core/hle/kernel/k_readable_event.h" #include "core/hle/kernel/k_thread.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/nvdrv/interface.h" #include "core/hle/service/nvdrv/nvdata.h" diff --git a/src/core/hle/service/nvdrv/nvdrv.cpp b/src/core/hle/service/nvdrv/nvdrv.cpp index 620c18728..caeab0bd2 100644 --- a/src/core/hle/service/nvdrv/nvdrv.cpp +++ b/src/core/hle/service/nvdrv/nvdrv.cpp @@ -7,7 +7,7 @@ #include #include "core/core.h" #include "core/hle/ipc_helpers.h" -#include "core/hle/kernel/readable_event.h" +#include "core/hle/kernel/k_readable_event.h" #include "core/hle/kernel/writable_event.h" #include "core/hle/service/nvdrv/devices/nvdevice.h" #include "core/hle/service/nvdrv/devices/nvdisp_disp0.h" @@ -171,7 +171,7 @@ void Module::SignalSyncpt(const u32 syncpoint_id, const u32 value) { } } -std::shared_ptr Module::GetEvent(const u32 event_id) const { +std::shared_ptr Module::GetEvent(const u32 event_id) const { return events_interface.events[event_id].event.readable; } diff --git a/src/core/hle/service/nvdrv/nvdrv.h b/src/core/hle/service/nvdrv/nvdrv.h index 144e657e5..8a75c92ff 100644 --- a/src/core/hle/service/nvdrv/nvdrv.h +++ b/src/core/hle/service/nvdrv/nvdrv.h @@ -132,7 +132,7 @@ public: void SignalSyncpt(const u32 syncpoint_id, const u32 value); - std::shared_ptr GetEvent(u32 event_id) const; + std::shared_ptr GetEvent(u32 event_id) const; std::shared_ptr GetEventWriteable(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 5578181a4..b7fd75d57 100644 --- a/src/core/hle/service/nvflinger/buffer_queue.cpp +++ b/src/core/hle/service/nvflinger/buffer_queue.cpp @@ -7,8 +7,8 @@ #include "common/assert.h" #include "common/logging/log.h" #include "core/core.h" +#include "core/hle/kernel/k_readable_event.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/nvflinger/buffer_queue.h" @@ -192,7 +192,7 @@ std::shared_ptr BufferQueue::GetWritableBufferWaitEvent() return buffer_wait_event.writable; } -std::shared_ptr BufferQueue::GetBufferWaitEvent() const { +std::shared_ptr BufferQueue::GetBufferWaitEvent() const { return buffer_wait_event.readable; } diff --git a/src/core/hle/service/nvflinger/buffer_queue.h b/src/core/hle/service/nvflinger/buffer_queue.h index ad7469277..8386e42b1 100644 --- a/src/core/hle/service/nvflinger/buffer_queue.h +++ b/src/core/hle/service/nvflinger/buffer_queue.h @@ -115,7 +115,7 @@ public: std::shared_ptr GetWritableBufferWaitEvent() const; - std::shared_ptr GetBufferWaitEvent() const; + std::shared_ptr GetBufferWaitEvent() const; private: BufferQueue(const BufferQueue&) = delete; diff --git a/src/core/hle/service/nvflinger/nvflinger.cpp b/src/core/hle/service/nvflinger/nvflinger.cpp index ceaa93d28..ac2906e5b 100644 --- a/src/core/hle/service/nvflinger/nvflinger.cpp +++ b/src/core/hle/service/nvflinger/nvflinger.cpp @@ -14,8 +14,8 @@ #include "core/core_timing.h" #include "core/core_timing_util.h" #include "core/hardware_properties.h" +#include "core/hle/kernel/k_readable_event.h" #include "core/hle/kernel/kernel.h" -#include "core/hle/kernel/readable_event.h" #include "core/hle/service/nvdrv/devices/nvdisp_disp0.h" #include "core/hle/service/nvdrv/nvdrv.h" #include "core/hle/service/nvflinger/buffer_queue.h" @@ -165,7 +165,7 @@ std::optional NVFlinger::FindBufferQueueId(u64 display_id, u64 layer_id) co return layer->GetBufferQueue().GetId(); } -std::shared_ptr NVFlinger::FindVsyncEvent(u64 display_id) const { +std::shared_ptr NVFlinger::FindVsyncEvent(u64 display_id) const { const auto guard = Lock(); auto* const display = FindDisplay(display_id); diff --git a/src/core/hle/service/nvflinger/nvflinger.h b/src/core/hle/service/nvflinger/nvflinger.h index c6765259f..8ba9c64e3 100644 --- a/src/core/hle/service/nvflinger/nvflinger.h +++ b/src/core/hle/service/nvflinger/nvflinger.h @@ -26,7 +26,7 @@ struct EventType; } // namespace Core::Timing namespace Kernel { -class ReadableEvent; +class KReadableEvent; class WritableEvent; } // namespace Kernel @@ -72,7 +72,7 @@ public: /// Gets the vsync event for the specified display. /// /// If an invalid display ID is provided, then nullptr is returned. - [[nodiscard]] std::shared_ptr FindVsyncEvent(u64 display_id) const; + [[nodiscard]] std::shared_ptr FindVsyncEvent(u64 display_id) const; /// Obtains a buffer queue identified by the ID. [[nodiscard]] BufferQueue* FindBufferQueue(u32 id); diff --git a/src/core/hle/service/ptm/psm.cpp b/src/core/hle/service/ptm/psm.cpp index a7cfccda3..103595193 100644 --- a/src/core/hle/service/ptm/psm.cpp +++ b/src/core/hle/service/ptm/psm.cpp @@ -7,8 +7,8 @@ #include "common/logging/log.h" #include "core/core.h" #include "core/hle/ipc_helpers.h" +#include "core/hle/kernel/k_readable_event.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/ptm/psm.h" #include "core/hle/service/service.h" diff --git a/src/core/hle/service/vi/display/vi_display.cpp b/src/core/hle/service/vi/display/vi_display.cpp index 5a202ac81..a3fb26100 100644 --- a/src/core/hle/service/vi/display/vi_display.cpp +++ b/src/core/hle/service/vi/display/vi_display.cpp @@ -9,7 +9,7 @@ #include "common/assert.h" #include "core/core.h" -#include "core/hle/kernel/readable_event.h" +#include "core/hle/kernel/k_readable_event.h" #include "core/hle/service/vi/display/vi_display.h" #include "core/hle/service/vi/layer/vi_layer.h" @@ -31,7 +31,7 @@ const Layer& Display::GetLayer(std::size_t index) const { return *layers.at(index); } -std::shared_ptr Display::GetVSyncEvent() const { +std::shared_ptr Display::GetVSyncEvent() const { return vsync_event.readable; } diff --git a/src/core/hle/service/vi/display/vi_display.h b/src/core/hle/service/vi/display/vi_display.h index a3855d8cd..bf0d320d1 100644 --- a/src/core/hle/service/vi/display/vi_display.h +++ b/src/core/hle/service/vi/display/vi_display.h @@ -58,7 +58,7 @@ public: const Layer& GetLayer(std::size_t index) const; /// Gets the readable vsync event. - std::shared_ptr GetVSyncEvent() const; + std::shared_ptr GetVSyncEvent() const; /// Signals the internal vsync event. void SignalVSyncEvent(); diff --git a/src/core/hle/service/vi/vi.cpp b/src/core/hle/service/vi/vi.cpp index f3de2c428..c573d474e 100644 --- a/src/core/hle/service/vi/vi.cpp +++ b/src/core/hle/service/vi/vi.cpp @@ -18,8 +18,8 @@ #include "common/swap.h" #include "core/core_timing.h" #include "core/hle/ipc_helpers.h" +#include "core/hle/kernel/k_readable_event.h" #include "core/hle/kernel/k_thread.h" -#include "core/hle/kernel/readable_event.h" #include "core/hle/kernel/writable_event.h" #include "core/hle/service/nvdrv/nvdata.h" #include "core/hle/service/nvdrv/nvdrv.h" -- cgit v1.2.3