summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/time
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/service/time')
-rw-r--r--src/core/hle/service/time/ephemeral_network_system_clock_core.h4
-rw-r--r--src/core/hle/service/time/local_system_clock_context_writer.h4
-rw-r--r--src/core/hle/service/time/network_system_clock_context_writer.h4
-rw-r--r--src/core/hle/service/time/standard_local_system_clock_core.h4
-rw-r--r--src/core/hle/service/time/standard_network_system_clock_core.h10
-rw-r--r--src/core/hle/service/time/standard_user_system_clock_core.cpp29
-rw-r--r--src/core/hle/service/time/standard_user_system_clock_core.h11
-rw-r--r--src/core/hle/service/time/system_clock_core.cpp4
-rw-r--r--src/core/hle/service/time/system_clock_core.h2
-rw-r--r--src/core/hle/service/time/time.cpp5
-rw-r--r--src/core/hle/service/time/time_manager.cpp2
-rw-r--r--src/core/hle/service/time/time_manager.h2
-rw-r--r--src/core/hle/service/time/time_sharedmemory.cpp17
-rw-r--r--src/core/hle/service/time/time_sharedmemory.h6
-rw-r--r--src/core/hle/service/time/time_zone_content_manager.cpp4
-rw-r--r--src/core/hle/service/time/time_zone_content_manager.h2
16 files changed, 50 insertions, 60 deletions
diff --git a/src/core/hle/service/time/ephemeral_network_system_clock_core.h b/src/core/hle/service/time/ephemeral_network_system_clock_core.h
index 4c6cdef86..d12cb5335 100644
--- a/src/core/hle/service/time/ephemeral_network_system_clock_core.h
+++ b/src/core/hle/service/time/ephemeral_network_system_clock_core.h
@@ -10,8 +10,8 @@ namespace Service::Time::Clock {
class EphemeralNetworkSystemClockCore final : public SystemClockCore {
public:
- explicit EphemeralNetworkSystemClockCore(SteadyClockCore& steady_clock_core)
- : SystemClockCore{steady_clock_core} {}
+ explicit EphemeralNetworkSystemClockCore(SteadyClockCore& steady_clock_core_)
+ : SystemClockCore{steady_clock_core_} {}
};
} // namespace Service::Time::Clock
diff --git a/src/core/hle/service/time/local_system_clock_context_writer.h b/src/core/hle/service/time/local_system_clock_context_writer.h
index 7050844c6..490d0ef3e 100644
--- a/src/core/hle/service/time/local_system_clock_context_writer.h
+++ b/src/core/hle/service/time/local_system_clock_context_writer.h
@@ -12,8 +12,8 @@ namespace Service::Time::Clock {
class LocalSystemClockContextWriter final : public SystemClockContextUpdateCallback {
public:
- explicit LocalSystemClockContextWriter(SharedMemory& shared_memory)
- : SystemClockContextUpdateCallback{}, shared_memory{shared_memory} {}
+ explicit LocalSystemClockContextWriter(SharedMemory& shared_memory_)
+ : SystemClockContextUpdateCallback{}, shared_memory{shared_memory_} {}
protected:
ResultCode Update() override {
diff --git a/src/core/hle/service/time/network_system_clock_context_writer.h b/src/core/hle/service/time/network_system_clock_context_writer.h
index 94d8788ff..e2920b8eb 100644
--- a/src/core/hle/service/time/network_system_clock_context_writer.h
+++ b/src/core/hle/service/time/network_system_clock_context_writer.h
@@ -12,8 +12,8 @@ namespace Service::Time::Clock {
class NetworkSystemClockContextWriter final : public SystemClockContextUpdateCallback {
public:
- explicit NetworkSystemClockContextWriter(SharedMemory& shared_memory)
- : SystemClockContextUpdateCallback{}, shared_memory{shared_memory} {}
+ explicit NetworkSystemClockContextWriter(SharedMemory& shared_memory_)
+ : SystemClockContextUpdateCallback{}, shared_memory{shared_memory_} {}
protected:
ResultCode Update() override {
diff --git a/src/core/hle/service/time/standard_local_system_clock_core.h b/src/core/hle/service/time/standard_local_system_clock_core.h
index 8c1882eb1..6320c7af1 100644
--- a/src/core/hle/service/time/standard_local_system_clock_core.h
+++ b/src/core/hle/service/time/standard_local_system_clock_core.h
@@ -10,8 +10,8 @@ namespace Service::Time::Clock {
class StandardLocalSystemClockCore final : public SystemClockCore {
public:
- explicit StandardLocalSystemClockCore(SteadyClockCore& steady_clock_core)
- : SystemClockCore{steady_clock_core} {}
+ explicit StandardLocalSystemClockCore(SteadyClockCore& steady_clock_core_)
+ : SystemClockCore{steady_clock_core_} {}
};
} // namespace Service::Time::Clock
diff --git a/src/core/hle/service/time/standard_network_system_clock_core.h b/src/core/hle/service/time/standard_network_system_clock_core.h
index c993bdf79..9d0aeaedb 100644
--- a/src/core/hle/service/time/standard_network_system_clock_core.h
+++ b/src/core/hle/service/time/standard_network_system_clock_core.h
@@ -16,21 +16,21 @@ namespace Service::Time::Clock {
class StandardNetworkSystemClockCore final : public SystemClockCore {
public:
- explicit StandardNetworkSystemClockCore(SteadyClockCore& steady_clock_core)
- : SystemClockCore{steady_clock_core} {}
+ explicit StandardNetworkSystemClockCore(SteadyClockCore& steady_clock_core_)
+ : SystemClockCore{steady_clock_core_} {}
void SetStandardNetworkClockSufficientAccuracy(TimeSpanType value) {
standard_network_clock_sufficient_accuracy = value;
}
bool IsStandardNetworkSystemClockAccuracySufficient(Core::System& system) const {
- SystemClockContext context{};
- if (GetClockContext(system, context) != RESULT_SUCCESS) {
+ SystemClockContext clock_ctx{};
+ if (GetClockContext(system, clock_ctx) != RESULT_SUCCESS) {
return {};
}
s64 span{};
- if (context.steady_time_point.GetSpanBetween(
+ if (clock_ctx.steady_time_point.GetSpanBetween(
GetSteadyClockCore().GetCurrentTimePoint(system), span) != RESULT_SUCCESS) {
return {};
}
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 3172acc5a..41bc01abd 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,7 +4,6 @@
#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"
@@ -12,15 +11,15 @@
namespace Service::Time::Clock {
StandardUserSystemClockCore::StandardUserSystemClockCore(
- StandardLocalSystemClockCore& local_system_clock_core,
- StandardNetworkSystemClockCore& network_system_clock_core, Core::System& system)
- : SystemClockCore(local_system_clock_core.GetSteadyClockCore()),
- local_system_clock_core{local_system_clock_core},
- network_system_clock_core{network_system_clock_core}, auto_correction_enabled{},
- auto_correction_time{SteadyClockTimePoint::GetRandom()},
- auto_correction_event{Kernel::KEvent::Create(
- system.Kernel(), "StandardUserSystemClockCore:AutoCorrectionEvent")} {
- auto_correction_event->Initialize();
+ StandardLocalSystemClockCore& local_system_clock_core_,
+ StandardNetworkSystemClockCore& network_system_clock_core_, Core::System& system_)
+ : 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");
}
ResultCode StandardUserSystemClockCore::SetAutomaticCorrectionEnabled(Core::System& system,
@@ -36,13 +35,13 @@ ResultCode StandardUserSystemClockCore::SetAutomaticCorrectionEnabled(Core::Syst
}
ResultCode StandardUserSystemClockCore::GetClockContext(Core::System& system,
- SystemClockContext& context) const {
+ SystemClockContext& ctx) const {
if (const ResultCode result{ApplyAutomaticCorrection(system, false)};
result != RESULT_SUCCESS) {
return result;
}
- return local_system_clock_core.GetClockContext(system, context);
+ return local_system_clock_core.GetClockContext(system, ctx);
}
ResultCode StandardUserSystemClockCore::Flush(const SystemClockContext&) {
@@ -65,13 +64,13 @@ ResultCode StandardUserSystemClockCore::ApplyAutomaticCorrection(Core::System& s
return ERROR_UNINITIALIZED_CLOCK;
}
- SystemClockContext context{};
- if (const ResultCode result{network_system_clock_core.GetClockContext(system, context)};
+ SystemClockContext ctx{};
+ if (const ResultCode result{network_system_clock_core.GetClockContext(system, ctx)};
result != RESULT_SUCCESS) {
return result;
}
- local_system_clock_core.SetClockContext(context);
+ local_system_clock_core.SetClockContext(ctx);
return RESULT_SUCCESS;
}
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 5bc8bf5c2..bf9ec5e42 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,6 +4,7 @@
#pragma once
+#include "core/hle/kernel/k_event.h"
#include "core/hle/service/time/clock_types.h"
#include "core/hle/service/time/system_clock_core.h"
@@ -22,13 +23,13 @@ class StandardNetworkSystemClockCore;
class StandardUserSystemClockCore final : public SystemClockCore {
public:
- StandardUserSystemClockCore(StandardLocalSystemClockCore& local_system_clock_core,
- StandardNetworkSystemClockCore& network_system_clock_core,
- Core::System& system);
+ StandardUserSystemClockCore(StandardLocalSystemClockCore& local_system_clock_core_,
+ StandardNetworkSystemClockCore& network_system_clock_core_,
+ Core::System& system_);
ResultCode SetAutomaticCorrectionEnabled(Core::System& system, bool value);
- ResultCode GetClockContext(Core::System& system, SystemClockContext& context) const override;
+ ResultCode GetClockContext(Core::System& system, SystemClockContext& ctx) const override;
bool IsAutomaticCorrectionEnabled() const {
return auto_correction_enabled;
@@ -54,7 +55,7 @@ private:
StandardNetworkSystemClockCore& network_system_clock_core;
bool auto_correction_enabled{};
SteadyClockTimePoint auto_correction_time;
- std::shared_ptr<Kernel::KEvent> auto_correction_event;
+ Kernel::KEvent auto_correction_event;
};
} // namespace Service::Time::Clock
diff --git a/src/core/hle/service/time/system_clock_core.cpp b/src/core/hle/service/time/system_clock_core.cpp
index 46fc8c6c3..2ef442b56 100644
--- a/src/core/hle/service/time/system_clock_core.cpp
+++ b/src/core/hle/service/time/system_clock_core.cpp
@@ -8,8 +8,8 @@
namespace Service::Time::Clock {
-SystemClockCore::SystemClockCore(SteadyClockCore& steady_clock_core)
- : steady_clock_core{steady_clock_core} {
+SystemClockCore::SystemClockCore(SteadyClockCore& steady_clock_core_)
+ : steady_clock_core{steady_clock_core_} {
context.steady_time_point.clock_source_id = steady_clock_core.GetClockSourceId();
}
diff --git a/src/core/hle/service/time/system_clock_core.h b/src/core/hle/service/time/system_clock_core.h
index 82a8b79ff..b8e6122bf 100644
--- a/src/core/hle/service/time/system_clock_core.h
+++ b/src/core/hle/service/time/system_clock_core.h
@@ -21,7 +21,7 @@ class SystemClockContextUpdateCallback;
class SystemClockCore {
public:
- explicit SystemClockCore(SteadyClockCore& steady_clock_core);
+ explicit SystemClockCore(SteadyClockCore& steady_clock_core_);
virtual ~SystemClockCore();
SteadyClockCore& GetSteadyClockCore() const {
diff --git a/src/core/hle/service/time/time.cpp b/src/core/hle/service/time/time.cpp
index 32f372d71..e7991012b 100644
--- a/src/core/hle/service/time/time.cpp
+++ b/src/core/hle/service/time/time.cpp
@@ -8,8 +8,7 @@
#include "core/core_timing_util.h"
#include "core/hardware_properties.h"
#include "core/hle/ipc_helpers.h"
-#include "core/hle/kernel/client_port.h"
-#include "core/hle/kernel/client_session.h"
+#include "core/hle/kernel/k_client_port.h"
#include "core/hle/kernel/k_scheduler.h"
#include "core/hle/kernel/kernel.h"
#include "core/hle/service/time/interface.h"
@@ -393,7 +392,7 @@ void Module::Interface::GetSharedMemoryNativeHandle(Kernel::HLERequestContext& c
LOG_DEBUG(Service_Time, "called");
IPC::ResponseBuilder rb{ctx, 2, 1};
rb.Push(RESULT_SUCCESS);
- rb.PushCopyObjects(SharedFrom(&system.Kernel().GetTimeSharedMem()));
+ rb.PushCopyObjects(&system.Kernel().GetTimeSharedMem());
}
Module::Interface::Interface(std::shared_ptr<Module> module_, Core::System& system_,
diff --git a/src/core/hle/service/time/time_manager.cpp b/src/core/hle/service/time/time_manager.cpp
index fe01a3739..4f9684de8 100644
--- a/src/core/hle/service/time/time_manager.cpp
+++ b/src/core/hle/service/time/time_manager.cpp
@@ -223,7 +223,7 @@ struct TimeManager::Impl final {
TimeZone::TimeZoneContentManager time_zone_content_manager;
};
-TimeManager::TimeManager(Core::System& system) : system{system} {}
+TimeManager::TimeManager(Core::System& system_) : system{system_} {}
TimeManager::~TimeManager() = default;
diff --git a/src/core/hle/service/time/time_manager.h b/src/core/hle/service/time/time_manager.h
index 4db8cc0e1..3af868d87 100644
--- a/src/core/hle/service/time/time_manager.h
+++ b/src/core/hle/service/time/time_manager.h
@@ -30,7 +30,7 @@ class NetworkSystemClockContextWriter;
class TimeManager final {
public:
- explicit TimeManager(Core::System& system);
+ explicit TimeManager(Core::System& system_);
~TimeManager();
void Initialize();
diff --git a/src/core/hle/service/time/time_sharedmemory.cpp b/src/core/hle/service/time/time_sharedmemory.cpp
index 018ce94ed..176ad0eee 100644
--- a/src/core/hle/service/time/time_sharedmemory.cpp
+++ b/src/core/hle/service/time/time_sharedmemory.cpp
@@ -15,17 +15,12 @@ namespace Service::Time {
static constexpr std::size_t SHARED_MEMORY_SIZE{0x1000};
-SharedMemory::SharedMemory(Core::System& system) : system(system) {
- shared_memory_holder = SharedFrom(&system.Kernel().GetTimeSharedMem());
- std::memset(shared_memory_holder->GetPointer(), 0, SHARED_MEMORY_SIZE);
+SharedMemory::SharedMemory(Core::System& system_) : system(system_) {
+ std::memset(system.Kernel().GetTimeSharedMem().GetPointer(), 0, SHARED_MEMORY_SIZE);
}
SharedMemory::~SharedMemory() = default;
-std::shared_ptr<Kernel::KSharedMemory> SharedMemory::GetSharedMemoryHolder() const {
- return shared_memory_holder;
-}
-
void SharedMemory::SetupStandardSteadyClock(const Common::UUID& clock_source_id,
Clock::TimeSpanType current_time_point) {
const Clock::TimeSpanType ticks_time_span{Clock::TimeSpanType::FromTicks(
@@ -34,22 +29,22 @@ void SharedMemory::SetupStandardSteadyClock(const Common::UUID& clock_source_id,
static_cast<u64>(current_time_point.nanoseconds - ticks_time_span.nanoseconds),
clock_source_id};
shared_memory_format.standard_steady_clock_timepoint.StoreData(
- shared_memory_holder->GetPointer(), context);
+ system.Kernel().GetTimeSharedMem().GetPointer(), context);
}
void SharedMemory::UpdateLocalSystemClockContext(const Clock::SystemClockContext& context) {
shared_memory_format.standard_local_system_clock_context.StoreData(
- shared_memory_holder->GetPointer(), context);
+ system.Kernel().GetTimeSharedMem().GetPointer(), context);
}
void SharedMemory::UpdateNetworkSystemClockContext(const Clock::SystemClockContext& context) {
shared_memory_format.standard_network_system_clock_context.StoreData(
- shared_memory_holder->GetPointer(), context);
+ system.Kernel().GetTimeSharedMem().GetPointer(), context);
}
void SharedMemory::SetAutomaticCorrectionEnabled(bool is_enabled) {
shared_memory_format.standard_user_system_clock_automatic_correction.StoreData(
- shared_memory_holder->GetPointer(), is_enabled);
+ system.Kernel().GetTimeSharedMem().GetPointer(), is_enabled);
}
} // namespace Service::Time
diff --git a/src/core/hle/service/time/time_sharedmemory.h b/src/core/hle/service/time/time_sharedmemory.h
index 3bc749114..d471b5d18 100644
--- a/src/core/hle/service/time/time_sharedmemory.h
+++ b/src/core/hle/service/time/time_sharedmemory.h
@@ -14,12 +14,9 @@ namespace Service::Time {
class SharedMemory final {
public:
- explicit SharedMemory(Core::System& system);
+ explicit SharedMemory(Core::System& system_);
~SharedMemory();
- // Return the shared memory handle
- std::shared_ptr<Kernel::KSharedMemory> GetSharedMemoryHolder() const;
-
// TODO(ogniK): We have to properly simulate memory barriers, how are we going to do this?
template <typename T, std::size_t Offset>
struct MemoryBarrier {
@@ -63,7 +60,6 @@ public:
void SetAutomaticCorrectionEnabled(bool is_enabled);
private:
- std::shared_ptr<Kernel::KSharedMemory> shared_memory_holder;
Core::System& system;
Format shared_memory_format{};
};
diff --git a/src/core/hle/service/time/time_zone_content_manager.cpp b/src/core/hle/service/time/time_zone_content_manager.cpp
index 3c8e71a3c..57f71e6f0 100644
--- a/src/core/hle/service/time/time_zone_content_manager.cpp
+++ b/src/core/hle/service/time/time_zone_content_manager.cpp
@@ -68,8 +68,8 @@ static std::vector<std::string> BuildLocationNameCache(Core::System& system) {
return location_name_cache;
}
-TimeZoneContentManager::TimeZoneContentManager(Core::System& system)
- : system{system}, location_name_cache{BuildLocationNameCache(system)} {}
+TimeZoneContentManager::TimeZoneContentManager(Core::System& system_)
+ : system{system_}, location_name_cache{BuildLocationNameCache(system)} {}
void TimeZoneContentManager::Initialize(TimeManager& time_manager) {
std::string location_name;
diff --git a/src/core/hle/service/time/time_zone_content_manager.h b/src/core/hle/service/time/time_zone_content_manager.h
index 52dd1a020..cfa601084 100644
--- a/src/core/hle/service/time/time_zone_content_manager.h
+++ b/src/core/hle/service/time/time_zone_content_manager.h
@@ -21,7 +21,7 @@ namespace Service::Time::TimeZone {
class TimeZoneContentManager final {
public:
- explicit TimeZoneContentManager(Core::System& system);
+ explicit TimeZoneContentManager(Core::System& system_);
void Initialize(TimeManager& time_manager);