summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/glue/time/standard_steady_clock_resource.h
diff options
context:
space:
mode:
authorliamwhite <liamwhite@users.noreply.github.com>2024-01-25 20:19:01 +0100
committerGitHub <noreply@github.com>2024-01-25 20:19:01 +0100
commitd45561ace069024f47ed710d1165b607644d1ec3 (patch)
treea316f59c5a722dc15fe5c49b3641d9801c264970 /src/core/hle/service/glue/time/standard_steady_clock_resource.h
parentMerge pull request #12781 from goldenx86/dozen (diff)
parentRework time service to fix time passing offline. (diff)
downloadyuzu-d45561ace069024f47ed710d1165b607644d1ec3.tar
yuzu-d45561ace069024f47ed710d1165b607644d1ec3.tar.gz
yuzu-d45561ace069024f47ed710d1165b607644d1ec3.tar.bz2
yuzu-d45561ace069024f47ed710d1165b607644d1ec3.tar.lz
yuzu-d45561ace069024f47ed710d1165b607644d1ec3.tar.xz
yuzu-d45561ace069024f47ed710d1165b607644d1ec3.tar.zst
yuzu-d45561ace069024f47ed710d1165b607644d1ec3.zip
Diffstat (limited to 'src/core/hle/service/glue/time/standard_steady_clock_resource.h')
-rw-r--r--src/core/hle/service/glue/time/standard_steady_clock_resource.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/core/hle/service/glue/time/standard_steady_clock_resource.h b/src/core/hle/service/glue/time/standard_steady_clock_resource.h
new file mode 100644
index 000000000..978d6b63b
--- /dev/null
+++ b/src/core/hle/service/glue/time/standard_steady_clock_resource.h
@@ -0,0 +1,41 @@
+// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#pragma once
+
+#include <mutex>
+
+#include "common/common_types.h"
+#include "core/hle/result.h"
+#include "core/hle/service/psc/time/common.h"
+
+namespace Core {
+class System;
+}
+
+namespace Service::Glue::Time {
+class StandardSteadyClockResource {
+public:
+ StandardSteadyClockResource(Core::System& system);
+
+ void Initialize(Common::UUID* out_source_id, Common::UUID* external_source_id);
+
+ s64 GetTime() const {
+ return m_time;
+ }
+
+ bool GetResetDetected();
+ Result SetCurrentTime();
+ Result GetRtcTimeInSeconds(s64& out_time);
+ void UpdateTime();
+
+private:
+ Core::System& m_system;
+
+ std::mutex m_mutex;
+ Service::PSC::Time::ClockSourceId m_clock_source_id{};
+ s64 m_time{};
+ Result m_set_time_result;
+ bool m_rtc_reset;
+};
+} // namespace Service::Glue::Time