summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-01-25 05:52:21 +0100
committerbunnei <bunneidev@gmail.com>2018-01-26 03:29:39 +0100
commit3258db29da499f88c0d85983272f30871c75a59f (patch)
tree6209962cde074c9435999dbeda7af9f02b9d6da1 /src/core/hle/service
parentMerge pull request #137 from bunnei/improve-ipc (diff)
downloadyuzu-3258db29da499f88c0d85983272f30871c75a59f.tar
yuzu-3258db29da499f88c0d85983272f30871c75a59f.tar.gz
yuzu-3258db29da499f88c0d85983272f30871c75a59f.tar.bz2
yuzu-3258db29da499f88c0d85983272f30871c75a59f.tar.lz
yuzu-3258db29da499f88c0d85983272f30871c75a59f.tar.xz
yuzu-3258db29da499f88c0d85983272f30871c75a59f.tar.zst
yuzu-3258db29da499f88c0d85983272f30871c75a59f.zip
Diffstat (limited to 'src/core/hle/service')
-rw-r--r--src/core/hle/service/time/time.cpp17
-rw-r--r--src/core/hle/service/time/time.h6
2 files changed, 22 insertions, 1 deletions
diff --git a/src/core/hle/service/time/time.cpp b/src/core/hle/service/time/time.cpp
index 96ccee50d..5802f6f6c 100644
--- a/src/core/hle/service/time/time.cpp
+++ b/src/core/hle/service/time/time.cpp
@@ -4,6 +4,7 @@
#include <chrono>
#include "common/logging/log.h"
+#include "core/core_timing.h"
#include "core/hle/ipc_helpers.h"
#include "core/hle/kernel/client_port.h"
#include "core/hle/kernel/client_session.h"
@@ -45,7 +46,21 @@ private:
class ISteadyClock final : public ServiceFramework<ISteadyClock> {
public:
- ISteadyClock() : ServiceFramework("ISteadyClock") {}
+ ISteadyClock() : ServiceFramework("ISteadyClock") {
+ static const FunctionInfo functions[] = {
+ {0, &ISteadyClock::GetCurrentTimePoint, "GetCurrentTimePoint"},
+ };
+ RegisterHandlers(functions);
+ }
+
+private:
+ void GetCurrentTimePoint(Kernel::HLERequestContext& ctx) {
+ LOG_DEBUG(Service, "called");
+ SteadyClockTimePoint steady_clock_time_point{cyclesToMs(CoreTiming::GetTicks()) / 1000};
+ IPC::ResponseBuilder rb{ctx, (sizeof(SteadyClockTimePoint) / 4) + 2};
+ rb.Push(RESULT_SUCCESS);
+ rb.PushRaw(steady_clock_time_point);
+ }
};
class ITimeZoneService final : public ServiceFramework<ITimeZoneService> {
diff --git a/src/core/hle/service/time/time.h b/src/core/hle/service/time/time.h
index cd936a50c..1cbbadb21 100644
--- a/src/core/hle/service/time/time.h
+++ b/src/core/hle/service/time/time.h
@@ -40,6 +40,12 @@ struct SystemClockContext {
static_assert(sizeof(SystemClockContext) == 0x20,
"SystemClockContext structure has incorrect size");
+struct SteadyClockTimePoint {
+ u64 value;
+ INSERT_PADDING_WORDS(4);
+};
+static_assert(sizeof(SteadyClockTimePoint) == 0x18, "SteadyClockTimePoint is incorrect size");
+
class Module final {
public:
class Interface : public ServiceFramework<Interface> {