diff options
Diffstat (limited to '')
4 files changed, 18 insertions, 6 deletions
diff --git a/src/core/hle/service/time/standard_user_system_clock_core.cpp b/src/core/hle/service/time/standard_user_system_clock_core.cpp index ef79ab917..e94220a44 100644 --- a/src/core/hle/service/time/standard_user_system_clock_core.cpp +++ b/src/core/hle/service/time/standard_user_system_clock_core.cpp @@ -4,6 +4,7 @@ #include "common/assert.h" #include "core/core.h" +#include "core/hle/kernel/k_event.h" #include "core/hle/service/time/standard_local_system_clock_core.h" #include "core/hle/service/time/standard_network_system_clock_core.h" #include "core/hle/service/time/standard_user_system_clock_core.h" @@ -16,10 +17,15 @@ StandardUserSystemClockCore::StandardUserSystemClockCore( : SystemClockCore(local_system_clock_core_.GetSteadyClockCore()), local_system_clock_core{local_system_clock_core_}, network_system_clock_core{network_system_clock_core_}, - auto_correction_time{SteadyClockTimePoint::GetRandom()}, auto_correction_event{ - system_.Kernel()} { - Kernel::KAutoObject::Create(std::addressof(auto_correction_event)); - auto_correction_event.Initialize("StandardUserSystemClockCore:AutoCorrectionEvent"); + auto_correction_time{SteadyClockTimePoint::GetRandom()}, service_context{ + system_, + "StandardUserSystemClockCore"} { + auto_correction_event = + service_context.CreateEvent("StandardUserSystemClockCore:AutoCorrectionEvent"); +} + +StandardUserSystemClockCore::~StandardUserSystemClockCore() { + service_context.CloseEvent(auto_correction_event); } ResultCode StandardUserSystemClockCore::SetAutomaticCorrectionEnabled(Core::System& system, diff --git a/src/core/hle/service/time/standard_user_system_clock_core.h b/src/core/hle/service/time/standard_user_system_clock_core.h index bf9ec5e42..b7cb2b045 100644 --- a/src/core/hle/service/time/standard_user_system_clock_core.h +++ b/src/core/hle/service/time/standard_user_system_clock_core.h @@ -4,7 +4,7 @@ #pragma once -#include "core/hle/kernel/k_event.h" +#include "core/hle/service/kernel_helpers.h" #include "core/hle/service/time/clock_types.h" #include "core/hle/service/time/system_clock_core.h" @@ -27,6 +27,8 @@ public: StandardNetworkSystemClockCore& network_system_clock_core_, Core::System& system_); + ~StandardUserSystemClockCore() override; + ResultCode SetAutomaticCorrectionEnabled(Core::System& system, bool value); ResultCode GetClockContext(Core::System& system, SystemClockContext& ctx) const override; @@ -55,7 +57,8 @@ private: StandardNetworkSystemClockCore& network_system_clock_core; bool auto_correction_enabled{}; SteadyClockTimePoint auto_correction_time; - Kernel::KEvent auto_correction_event; + KernelHelpers::ServiceContext service_context; + Kernel::KEvent* auto_correction_event; }; } // namespace Service::Time::Clock diff --git a/src/core/hle/service/time/system_clock_context_update_callback.h b/src/core/hle/service/time/system_clock_context_update_callback.h index 797954958..6936397a5 100644 --- a/src/core/hle/service/time/system_clock_context_update_callback.h +++ b/src/core/hle/service/time/system_clock_context_update_callback.h @@ -4,6 +4,7 @@ #pragma once +#include <memory> #include <vector> #include "core/hle/service/time/clock_types.h" diff --git a/src/core/hle/service/time/system_clock_core.h b/src/core/hle/service/time/system_clock_core.h index 83d0e5d62..b9237ad28 100644 --- a/src/core/hle/service/time/system_clock_core.h +++ b/src/core/hle/service/time/system_clock_core.h @@ -4,6 +4,8 @@ #pragma once +#include <memory> + #include "common/common_types.h" #include "core/hle/service/time/clock_types.h" |