2018-01-14 21:42:23 -05:00
|
|
|
// Copyright 2018 yuzu emulator team
|
|
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "core/hle/service/service.h"
|
2019-12-22 17:49:51 -05:00
|
|
|
#include "core/hle/service/time/clock_types.h"
|
|
|
|
|
#include "core/hle/service/time/time_manager.h"
|
2018-01-14 21:42:23 -05:00
|
|
|
|
2019-12-22 17:49:51 -05:00
|
|
|
namespace Core {
|
|
|
|
|
class System;
|
|
|
|
|
}
|
2018-12-29 18:02:31 -05:00
|
|
|
|
2019-12-22 17:49:51 -05:00
|
|
|
namespace Service::Time {
|
2018-11-10 01:25:56 +11:00
|
|
|
|
2018-01-18 10:58:29 -06:00
|
|
|
class Module final {
|
2018-01-17 13:33:38 -06:00
|
|
|
public:
|
2020-10-12 18:09:15 -07:00
|
|
|
Module() = default;
|
2019-12-22 17:49:51 -05:00
|
|
|
|
2018-01-18 10:58:29 -06:00
|
|
|
class Interface : public ServiceFramework<Interface> {
|
|
|
|
|
public:
|
2019-12-22 17:49:51 -05:00
|
|
|
explicit Interface(std::shared_ptr<Module> module, Core::System& system, const char* name);
|
2018-09-10 21:20:52 -04:00
|
|
|
~Interface() override;
|
2018-01-18 10:58:29 -06:00
|
|
|
|
|
|
|
|
void GetStandardUserSystemClock(Kernel::HLERequestContext& ctx);
|
|
|
|
|
void GetStandardNetworkSystemClock(Kernel::HLERequestContext& ctx);
|
|
|
|
|
void GetStandardSteadyClock(Kernel::HLERequestContext& ctx);
|
|
|
|
|
void GetTimeZoneService(Kernel::HLERequestContext& ctx);
|
2020-01-04 22:18:54 -05:00
|
|
|
void GetStandardLocalSystemClock(Kernel::HLERequestContext& ctx);
|
2019-12-22 18:10:59 -05:00
|
|
|
void IsStandardNetworkSystemClockAccuracySufficient(Kernel::HLERequestContext& ctx);
|
2019-12-22 17:49:51 -05:00
|
|
|
void CalculateMonotonicSystemClockBaseTimePoint(Kernel::HLERequestContext& ctx);
|
2018-11-10 01:25:56 +11:00
|
|
|
void GetClockSnapshot(Kernel::HLERequestContext& ctx);
|
2020-01-03 22:34:57 -05:00
|
|
|
void GetClockSnapshotFromSystemClockContext(Kernel::HLERequestContext& ctx);
|
2020-04-14 22:28:41 -04:00
|
|
|
void CalculateStandardUserSystemClockDifferenceByUser(Kernel::HLERequestContext& ctx);
|
2020-03-27 10:42:13 -04:00
|
|
|
void CalculateSpanBetween(Kernel::HLERequestContext& ctx);
|
2019-06-26 00:45:53 +10:00
|
|
|
void GetSharedMemoryNativeHandle(Kernel::HLERequestContext& ctx);
|
2019-12-22 17:49:51 -05:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
ResultCode GetClockSnapshotFromSystemClockContextInternal(
|
|
|
|
|
Kernel::Thread* thread, Clock::SystemClockContext user_context,
|
|
|
|
|
Clock::SystemClockContext network_context, u8 type,
|
|
|
|
|
Clock::ClockSnapshot& cloc_snapshot);
|
2018-01-18 10:58:29 -06:00
|
|
|
|
|
|
|
|
protected:
|
2019-12-22 17:49:51 -05:00
|
|
|
std::shared_ptr<Module> module;
|
2019-09-21 19:35:01 +10:00
|
|
|
Core::System& system;
|
2018-01-18 10:58:29 -06:00
|
|
|
};
|
2018-01-17 13:33:38 -06:00
|
|
|
};
|
|
|
|
|
|
2018-01-14 21:42:23 -05:00
|
|
|
/// Registers all Time services with the specified service manager.
|
2019-06-26 00:45:53 +10:00
|
|
|
void InstallInterfaces(Core::System& system);
|
2018-01-14 21:42:23 -05:00
|
|
|
|
2018-04-19 21:41:44 -04:00
|
|
|
} // namespace Service::Time
|