summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/psc/time/service_manager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/service/psc/time/service_manager.cpp')
-rw-r--r--src/core/hle/service/psc/time/service_manager.cpp32
1 files changed, 12 insertions, 20 deletions
diff --git a/src/core/hle/service/psc/time/service_manager.cpp b/src/core/hle/service/psc/time/service_manager.cpp
index ec906b723..ed9fb32cd 100644
--- a/src/core/hle/service/psc/time/service_manager.cpp
+++ b/src/core/hle/service/psc/time/service_manager.cpp
@@ -78,8 +78,9 @@ Result ServiceManager::GetStaticServiceAsServiceManager(OutInterface<StaticServi
}
Result ServiceManager::SetupStandardSteadyClockCore(bool is_rtc_reset_detected,
- Common::UUID& clock_source_id, s64 rtc_offset,
- s64 internal_offset, s64 test_offset) {
+ const Common::UUID& clock_source_id,
+ s64 rtc_offset, s64 internal_offset,
+ s64 test_offset) {
LOG_DEBUG(Service_Time,
"called. is_rtc_reset_detected={} clock_source_id={} rtc_offset={} "
"internal_offset={} test_offset={}",
@@ -102,7 +103,8 @@ Result ServiceManager::SetupStandardSteadyClockCore(bool is_rtc_reset_detected,
R_SUCCEED();
}
-Result ServiceManager::SetupStandardLocalSystemClockCore(SystemClockContext& context, s64 time) {
+Result ServiceManager::SetupStandardLocalSystemClockCore(const SystemClockContext& context,
+ s64 time) {
LOG_DEBUG(Service_Time,
"called. context={} context.steady_time_point.clock_source_id={} time={}", context,
context.steady_time_point.clock_source_id.RawString(), time);
@@ -114,17 +116,14 @@ Result ServiceManager::SetupStandardLocalSystemClockCore(SystemClockContext& con
R_SUCCEED();
}
-Result ServiceManager::SetupStandardNetworkSystemClockCore(SystemClockContext& context,
+Result ServiceManager::SetupStandardNetworkSystemClockCore(SystemClockContext context,
s64 accuracy) {
LOG_DEBUG(Service_Time, "called. context={} steady_time_point.clock_source_id={} accuracy={}",
context, context.steady_time_point.clock_source_id.RawString(), accuracy);
// TODO this is a hack! The network clock should be updated independently, from the ntc service
- // and maybe elsewhere. We do not do that, so fix the clock to the local clock on first boot
- // to avoid it being stuck at 0.
- if (context == Service::PSC::Time::SystemClockContext{}) {
- m_local_system_clock.GetContext(context);
- }
+ // and maybe elsewhere. We do not do that, so fix the clock to the local clock.
+ m_local_system_clock.GetContext(context);
m_network_system_clock.SetContextWriter(m_network_system_context_writer);
m_network_system_clock.Initialize(context, accuracy);
@@ -134,17 +133,10 @@ Result ServiceManager::SetupStandardNetworkSystemClockCore(SystemClockContext& c
}
Result ServiceManager::SetupStandardUserSystemClockCore(bool automatic_correction,
- SteadyClockTimePoint& time_point) {
+ SteadyClockTimePoint time_point) {
LOG_DEBUG(Service_Time, "called. automatic_correction={} time_point={} clock_source_id={}",
automatic_correction, time_point, time_point.clock_source_id.RawString());
- // TODO this is a hack! The user clock should be updated independently, from the ntc service
- // and maybe elsewhere. We do not do that, so fix the clock to the local clock on first boot
- // to avoid it being stuck at 0.
- if (time_point == Service::PSC::Time::SteadyClockTimePoint{}) {
- m_local_system_clock.GetCurrentTimePoint(time_point);
- }
-
m_user_system_clock.SetAutomaticCorrection(automatic_correction);
m_user_system_clock.SetTimePointAndSignal(time_point);
m_user_system_clock.SetInitialized();
@@ -154,9 +146,9 @@ Result ServiceManager::SetupStandardUserSystemClockCore(bool automatic_correctio
R_SUCCEED();
}
-Result ServiceManager::SetupTimeZoneServiceCore(LocationName& name, RuleVersion& rule_version,
- u32 location_count,
- SteadyClockTimePoint& time_point,
+Result ServiceManager::SetupTimeZoneServiceCore(const LocationName& name,
+ const RuleVersion& rule_version, u32 location_count,
+ const SteadyClockTimePoint& time_point,
InBuffer<BufferAttr_HipcAutoSelect> rule_buffer) {
LOG_DEBUG(Service_Time,
"called. name={} rule_version={} location_count={} time_point={} "