diff --git a/app/src/main/cpp/skyline/services/timesrv/core.h b/app/src/main/cpp/skyline/services/timesrv/core.h index cf723ecd..acab4b14 100644 --- a/app/src/main/cpp/skyline/services/timesrv/core.h +++ b/app/src/main/cpp/skyline/services/timesrv/core.h @@ -19,6 +19,7 @@ namespace skyline::service::timesrv::core { * @brief A steady clock provides a monotonically increasing timepoint calibrated from a specific base */ class SteadyClockCore { + private: bool rtcResetDetected{}; //!< True if the RTC this clock is based off has reset before this boot. bool initialized{}; //!< If this clock is calibrated with offsets etc and ready for use by applications @@ -32,6 +33,8 @@ namespace skyline::service::timesrv::core { } public: + virtual ~SteadyClockCore() = default; + bool IsRtcResetDetected() { return rtcResetDetected; } @@ -96,6 +99,7 @@ namespace skyline::service::timesrv::core { * @brief The standard steady clock is calibrated against system RTC time and is used as a base for all clocks aside from alarms and ephemeral */ class StandardSteadyClockCore : public SteadyClockCore { + private: std::mutex mutex; //!< Protects accesses to cachedValue TimeSpanType testOffset{}; TimeSpanType internalOffset{}; @@ -163,6 +167,8 @@ namespace skyline::service::timesrv::core { public: SystemClockCore(SteadyClockCore &steadyClock) : steadyClock(steadyClock) {} + virtual ~SystemClockCore() = default; + void AddOperationEvent(const std::shared_ptr &event) { updateCallback->AddOperationEvent(event); } @@ -254,7 +260,12 @@ namespace skyline::service::timesrv::core { public: std::shared_ptr automaticCorrectionUpdatedEvent; - StandardUserSystemClockCore(const DeviceState &state, StandardSteadyClockCore &standardSteadyClock, StandardLocalSystemClockCore &localSystemClock, StandardNetworkSystemClockCore &networkSystemClock, TimeSharedMemory &timeSharedMemory) : SystemClockCore(standardSteadyClock), localSystemClock(localSystemClock), networkSystemClock(networkSystemClock), automaticCorrectionUpdatedEvent(std::make_shared(state, false)), timeSharedMemory(timeSharedMemory) {} + StandardUserSystemClockCore(const DeviceState &state, StandardSteadyClockCore &standardSteadyClock, StandardLocalSystemClockCore &localSystemClock, StandardNetworkSystemClockCore &networkSystemClock, TimeSharedMemory &timeSharedMemory) + : SystemClockCore(standardSteadyClock), + localSystemClock(localSystemClock), + networkSystemClock(networkSystemClock), + automaticCorrectionUpdatedEvent(std::make_shared(state, false)), + timeSharedMemory(timeSharedMemory) {} void Setup(bool enableAutomaticCorrection, const SteadyClockTimePoint &automaticCorrectionUpdateTime); diff --git a/app/src/main/cpp/skyline/services/timesrv/time_shared_memory.h b/app/src/main/cpp/skyline/services/timesrv/time_shared_memory.h index 5422ffb4..7419efbb 100644 --- a/app/src/main/cpp/skyline/services/timesrv/time_shared_memory.h +++ b/app/src/main/cpp/skyline/services/timesrv/time_shared_memory.h @@ -63,6 +63,8 @@ namespace skyline::service::timesrv::core { void SignalOperationEvent(); public: + virtual ~SystemClockContextUpdateCallback() = default; + /** * @brief Adds an operation event to be siignalled on context updates */