summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/psc/time/steady_clock.h
diff options
context:
space:
mode:
authorKelebek1 <eeeedddccc@hotmail.co.uk>2023-10-29 14:50:55 +0100
committerKelebek1 <eeeedddccc@hotmail.co.uk>2024-01-24 05:26:55 +0100
commite4915fb7d2077584a11a15141bc81d28ed2b0125 (patch)
tree1783055dc2e98eaf9099e8e7b194b55f8f607747 /src/core/hle/service/psc/time/steady_clock.h
parentMerge pull request #12678 from german77/settings_impl (diff)
downloadyuzu-e4915fb7d2077584a11a15141bc81d28ed2b0125.tar
yuzu-e4915fb7d2077584a11a15141bc81d28ed2b0125.tar.gz
yuzu-e4915fb7d2077584a11a15141bc81d28ed2b0125.tar.bz2
yuzu-e4915fb7d2077584a11a15141bc81d28ed2b0125.tar.lz
yuzu-e4915fb7d2077584a11a15141bc81d28ed2b0125.tar.xz
yuzu-e4915fb7d2077584a11a15141bc81d28ed2b0125.tar.zst
yuzu-e4915fb7d2077584a11a15141bc81d28ed2b0125.zip
Diffstat (limited to 'src/core/hle/service/psc/time/steady_clock.h')
-rw-r--r--src/core/hle/service/psc/time/steady_clock.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/core/hle/service/psc/time/steady_clock.h b/src/core/hle/service/psc/time/steady_clock.h
new file mode 100644
index 000000000..115e9b138
--- /dev/null
+++ b/src/core/hle/service/psc/time/steady_clock.h
@@ -0,0 +1,49 @@
+// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#pragma once
+
+#include "core/hle/service/ipc_helpers.h"
+#include "core/hle/service/psc/time/common.h"
+#include "core/hle/service/psc/time/manager.h"
+#include "core/hle/service/server_manager.h"
+#include "core/hle/service/service.h"
+
+namespace Core {
+class System;
+}
+
+namespace Service::PSC::Time {
+
+class SteadyClock final : public ServiceFramework<SteadyClock> {
+public:
+ explicit SteadyClock(Core::System& system, std::shared_ptr<TimeManager> manager,
+ bool can_write_steady_clock, bool can_write_uninitialized_clock);
+
+ ~SteadyClock() override = default;
+
+ Result GetCurrentTimePoint(SteadyClockTimePoint& out_time_point);
+ Result GetTestOffset(s64& out_test_offset);
+ Result SetTestOffset(s64 test_offset);
+ Result GetRtcValue(s64& out_rtc_value);
+ Result IsRtcResetDetected(bool& out_is_detected);
+ Result GetSetupResultValue(Result& out_result);
+ Result GetInternalOffset(s64& out_internal_offset);
+
+private:
+ void Handle_GetCurrentTimePoint(HLERequestContext& ctx);
+ void Handle_GetTestOffset(HLERequestContext& ctx);
+ void Handle_SetTestOffset(HLERequestContext& ctx);
+ void Handle_GetRtcValue(HLERequestContext& ctx);
+ void Handle_IsRtcResetDetected(HLERequestContext& ctx);
+ void Handle_GetSetupResultValue(HLERequestContext& ctx);
+ void Handle_GetInternalOffset(HLERequestContext& ctx);
+
+ Core::System& m_system;
+
+ StandardSteadyClockCore& m_clock_core;
+ bool m_can_write_steady_clock;
+ bool m_can_write_uninitialized_clock;
+};
+
+} // namespace Service::PSC::Time