summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2018-01-22 23:42:11 +0100
committerSubv <subv2112@gmail.com>2018-01-22 23:42:11 +0100
commit7efa6e8801866da8ed4dca97fa25d2451dcb042e (patch)
treec49b6905e02497ec4efd9cfd0a52add7ab221e71 /src
parentHID: Don't create an unnecessary port in CreateAppletResource. (diff)
downloadyuzu-7efa6e8801866da8ed4dca97fa25d2451dcb042e.tar
yuzu-7efa6e8801866da8ed4dca97fa25d2451dcb042e.tar.gz
yuzu-7efa6e8801866da8ed4dca97fa25d2451dcb042e.tar.bz2
yuzu-7efa6e8801866da8ed4dca97fa25d2451dcb042e.tar.lz
yuzu-7efa6e8801866da8ed4dca97fa25d2451dcb042e.tar.xz
yuzu-7efa6e8801866da8ed4dca97fa25d2451dcb042e.tar.zst
yuzu-7efa6e8801866da8ed4dca97fa25d2451dcb042e.zip
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/time/time.cpp60
1 files changed, 27 insertions, 33 deletions
diff --git a/src/core/hle/service/time/time.cpp b/src/core/hle/service/time/time.cpp
index 9fed89246..9039a4cec 100644
--- a/src/core/hle/service/time/time.cpp
+++ b/src/core/hle/service/time/time.cpp
@@ -83,45 +83,39 @@ private:
};
void Module::Interface::GetStandardUserSystemClock(Kernel::HLERequestContext& ctx) {
- auto client_port = std::make_shared<ISystemClock>()->CreatePort();
- auto session = client_port->Connect();
- if (session.Succeeded()) {
- LOG_DEBUG(Service, "called, initialized ISystemClock -> session=%u",
- (*session)->GetObjectId());
- IPC::RequestBuilder rb{ctx, 2, 0, 1};
- rb.Push(RESULT_SUCCESS);
- rb.PushMoveObjects(std::move(session).Unwrap());
- } else {
- UNIMPLEMENTED();
- }
+ auto system_clock = std::make_shared<ISystemClock>();
+ auto sessions = Kernel::ServerSession::CreateSessionPair(system_clock->GetServiceName());
+ auto server = std::get<Kernel::SharedPtr<Kernel::ServerSession>>(sessions);
+ auto client = std::get<Kernel::SharedPtr<Kernel::ClientSession>>(sessions);
+ system_clock->ClientConnected(server);
+ LOG_DEBUG(Service, "called, initialized ISystemClock -> session=%u", client->GetObjectId());
+ IPC::RequestBuilder rb{ctx, 2, 0, 1};
+ rb.Push(RESULT_SUCCESS);
+ rb.PushMoveObjects(std::move(client));
}
void Module::Interface::GetStandardNetworkSystemClock(Kernel::HLERequestContext& ctx) {
- auto client_port = std::make_shared<ISystemClock>()->CreatePort();
- auto session = client_port->Connect();
- if (session.Succeeded()) {
- LOG_DEBUG(Service, "called, initialized ISystemClock -> session=%u",
- (*session)->GetObjectId());
- IPC::RequestBuilder rb{ctx, 2, 0, 1};
- rb.Push(RESULT_SUCCESS);
- rb.PushMoveObjects(std::move(session).Unwrap());
- } else {
- UNIMPLEMENTED();
- }
+ auto system_clock = std::make_shared<ISystemClock>();
+ auto sessions = Kernel::ServerSession::CreateSessionPair(system_clock->GetServiceName());
+ auto server = std::get<Kernel::SharedPtr<Kernel::ServerSession>>(sessions);
+ auto client = std::get<Kernel::SharedPtr<Kernel::ClientSession>>(sessions);
+ system_clock->ClientConnected(server);
+ LOG_DEBUG(Service, "called, initialized ISystemClock -> session=%u", client->GetObjectId());
+ IPC::RequestBuilder rb{ctx, 2, 0, 1};
+ rb.Push(RESULT_SUCCESS);
+ rb.PushMoveObjects(std::move(client));
}
void Module::Interface::GetStandardSteadyClock(Kernel::HLERequestContext& ctx) {
- auto client_port = std::make_shared<ISteadyClock>()->CreatePort();
- auto session = client_port->Connect();
- if (session.Succeeded()) {
- LOG_DEBUG(Service, "called, initialized ISteadyClock -> session=%u",
- (*session)->GetObjectId());
- IPC::RequestBuilder rb{ctx, 2, 0, 1};
- rb.Push(RESULT_SUCCESS);
- rb.PushMoveObjects(std::move(session).Unwrap());
- } else {
- UNIMPLEMENTED();
- }
+ auto steady_clock = std::make_shared<ISteadyClock>();
+ auto sessions = Kernel::ServerSession::CreateSessionPair(steady_clock->GetServiceName());
+ auto server = std::get<Kernel::SharedPtr<Kernel::ServerSession>>(sessions);
+ auto client = std::get<Kernel::SharedPtr<Kernel::ClientSession>>(sessions);
+ steady_clock->ClientConnected(server);
+ LOG_DEBUG(Service, "called, initialized ISteadyClock -> session=%u", client->GetObjectId());
+ IPC::RequestBuilder rb{ctx, 2, 0, 1};
+ rb.Push(RESULT_SUCCESS);
+ rb.PushMoveObjects(std::move(client));
}
void Module::Interface::GetTimeZoneService(Kernel::HLERequestContext& ctx) {