service: Migrate to the new UUID implementation
This commit is contained in:
parent
cb30fe50cd
commit
ee0547e4c4
9 changed files with 36 additions and 45 deletions
|
@ -6,7 +6,7 @@
|
|||
|
||||
#include "common/common_funcs.h"
|
||||
#include "common/common_types.h"
|
||||
#include "common/uuid.h"
|
||||
#include "common/new_uuid.h"
|
||||
#include "core/hle/service/time/errors.h"
|
||||
#include "core/hle/service/time/time_zone_types.h"
|
||||
|
||||
|
@ -21,7 +21,7 @@ enum class TimeType : u8 {
|
|||
/// https://switchbrew.org/wiki/Glue_services#SteadyClockTimePoint
|
||||
struct SteadyClockTimePoint {
|
||||
s64 time_point;
|
||||
Common::UUID clock_source_id;
|
||||
Common::NewUUID clock_source_id;
|
||||
|
||||
ResultCode GetSpanBetween(SteadyClockTimePoint other, s64& span) const {
|
||||
span = 0;
|
||||
|
@ -36,7 +36,7 @@ struct SteadyClockTimePoint {
|
|||
}
|
||||
|
||||
static SteadyClockTimePoint GetRandom() {
|
||||
return {0, Common::UUID::Generate()};
|
||||
return {0, Common::NewUUID::MakeRandom()};
|
||||
}
|
||||
};
|
||||
static_assert(sizeof(SteadyClockTimePoint) == 0x18, "SteadyClockTimePoint is incorrect size");
|
||||
|
@ -45,7 +45,7 @@ static_assert(std::is_trivially_copyable_v<SteadyClockTimePoint>,
|
|||
|
||||
struct SteadyClockContext {
|
||||
u64 internal_offset;
|
||||
Common::UUID steady_time_point;
|
||||
Common::NewUUID steady_time_point;
|
||||
};
|
||||
static_assert(sizeof(SteadyClockContext) == 0x18, "SteadyClockContext is incorrect size");
|
||||
static_assert(std::is_trivially_copyable_v<SteadyClockContext>,
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "common/uuid.h"
|
||||
#include "common/new_uuid.h"
|
||||
#include "core/hle/service/time/clock_types.h"
|
||||
|
||||
namespace Core {
|
||||
|
@ -18,11 +18,11 @@ public:
|
|||
SteadyClockCore() = default;
|
||||
virtual ~SteadyClockCore() = default;
|
||||
|
||||
const Common::UUID& GetClockSourceId() const {
|
||||
const Common::NewUUID& GetClockSourceId() const {
|
||||
return clock_source_id;
|
||||
}
|
||||
|
||||
void SetClockSourceId(const Common::UUID& value) {
|
||||
void SetClockSourceId(const Common::NewUUID& value) {
|
||||
clock_source_id = value;
|
||||
}
|
||||
|
||||
|
@ -49,7 +49,7 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
Common::UUID clock_source_id{Common::UUID::Generate()};
|
||||
Common::NewUUID clock_source_id{Common::NewUUID::MakeRandom()};
|
||||
bool is_initialized{};
|
||||
};
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ struct TimeManager::Impl final {
|
|||
time_zone_content_manager{system} {
|
||||
|
||||
const auto system_time{Clock::TimeSpanType::FromSeconds(GetExternalRtcValue())};
|
||||
SetupStandardSteadyClock(system, Common::UUID::Generate(), system_time, {}, {});
|
||||
SetupStandardSteadyClock(system, Common::NewUUID::MakeRandom(), system_time, {}, {});
|
||||
SetupStandardLocalSystemClock(system, {}, system_time.ToSeconds());
|
||||
|
||||
Clock::SystemClockContext clock_context{};
|
||||
|
@ -132,7 +132,7 @@ struct TimeManager::Impl final {
|
|||
return 0;
|
||||
}
|
||||
|
||||
void SetupStandardSteadyClock(Core::System& system_, Common::UUID clock_source_id,
|
||||
void SetupStandardSteadyClock(Core::System& system_, Common::NewUUID clock_source_id,
|
||||
Clock::TimeSpanType setup_value,
|
||||
Clock::TimeSpanType internal_offset, bool is_rtc_reset_detected) {
|
||||
standard_steady_clock_core.SetClockSourceId(clock_source_id);
|
||||
|
|
|
@ -20,7 +20,7 @@ SharedMemory::SharedMemory(Core::System& system_) : system(system_) {
|
|||
|
||||
SharedMemory::~SharedMemory() = default;
|
||||
|
||||
void SharedMemory::SetupStandardSteadyClock(const Common::UUID& clock_source_id,
|
||||
void SharedMemory::SetupStandardSteadyClock(const Common::NewUUID& clock_source_id,
|
||||
Clock::TimeSpanType current_time_point) {
|
||||
const Clock::TimeSpanType ticks_time_span{Clock::TimeSpanType::FromTicks(
|
||||
system.CoreTiming().GetClockTicks(), Core::Hardware::CNTFREQ)};
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "common/common_types.h"
|
||||
#include "common/uuid.h"
|
||||
#include "common/new_uuid.h"
|
||||
#include "core/hle/kernel/k_shared_memory.h"
|
||||
#include "core/hle/service/time/clock_types.h"
|
||||
|
||||
|
@ -52,7 +52,7 @@ public:
|
|||
};
|
||||
static_assert(sizeof(Format) == 0xd8, "Format is an invalid size");
|
||||
|
||||
void SetupStandardSteadyClock(const Common::UUID& clock_source_id,
|
||||
void SetupStandardSteadyClock(const Common::NewUUID& clock_source_id,
|
||||
Clock::TimeSpanType current_time_point);
|
||||
void UpdateLocalSystemClockContext(const Clock::SystemClockContext& context);
|
||||
void UpdateNetworkSystemClockContext(const Clock::SystemClockContext& context);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue