mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2024-11-16 02:20:05 +00:00
Time: Don't create unnecessary ports when retrieving the clock service sessions.
This commit is contained in:
parent
1003996e80
commit
7efa6e8801
@ -83,45 +83,39 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
void Module::Interface::GetStandardUserSystemClock(Kernel::HLERequestContext& ctx) {
|
void Module::Interface::GetStandardUserSystemClock(Kernel::HLERequestContext& ctx) {
|
||||||
auto client_port = std::make_shared<ISystemClock>()->CreatePort();
|
auto system_clock = std::make_shared<ISystemClock>();
|
||||||
auto session = client_port->Connect();
|
auto sessions = Kernel::ServerSession::CreateSessionPair(system_clock->GetServiceName());
|
||||||
if (session.Succeeded()) {
|
auto server = std::get<Kernel::SharedPtr<Kernel::ServerSession>>(sessions);
|
||||||
LOG_DEBUG(Service, "called, initialized ISystemClock -> session=%u",
|
auto client = std::get<Kernel::SharedPtr<Kernel::ClientSession>>(sessions);
|
||||||
(*session)->GetObjectId());
|
system_clock->ClientConnected(server);
|
||||||
|
LOG_DEBUG(Service, "called, initialized ISystemClock -> session=%u", client->GetObjectId());
|
||||||
IPC::RequestBuilder rb{ctx, 2, 0, 1};
|
IPC::RequestBuilder rb{ctx, 2, 0, 1};
|
||||||
rb.Push(RESULT_SUCCESS);
|
rb.Push(RESULT_SUCCESS);
|
||||||
rb.PushMoveObjects(std::move(session).Unwrap());
|
rb.PushMoveObjects(std::move(client));
|
||||||
} else {
|
|
||||||
UNIMPLEMENTED();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Module::Interface::GetStandardNetworkSystemClock(Kernel::HLERequestContext& ctx) {
|
void Module::Interface::GetStandardNetworkSystemClock(Kernel::HLERequestContext& ctx) {
|
||||||
auto client_port = std::make_shared<ISystemClock>()->CreatePort();
|
auto system_clock = std::make_shared<ISystemClock>();
|
||||||
auto session = client_port->Connect();
|
auto sessions = Kernel::ServerSession::CreateSessionPair(system_clock->GetServiceName());
|
||||||
if (session.Succeeded()) {
|
auto server = std::get<Kernel::SharedPtr<Kernel::ServerSession>>(sessions);
|
||||||
LOG_DEBUG(Service, "called, initialized ISystemClock -> session=%u",
|
auto client = std::get<Kernel::SharedPtr<Kernel::ClientSession>>(sessions);
|
||||||
(*session)->GetObjectId());
|
system_clock->ClientConnected(server);
|
||||||
|
LOG_DEBUG(Service, "called, initialized ISystemClock -> session=%u", client->GetObjectId());
|
||||||
IPC::RequestBuilder rb{ctx, 2, 0, 1};
|
IPC::RequestBuilder rb{ctx, 2, 0, 1};
|
||||||
rb.Push(RESULT_SUCCESS);
|
rb.Push(RESULT_SUCCESS);
|
||||||
rb.PushMoveObjects(std::move(session).Unwrap());
|
rb.PushMoveObjects(std::move(client));
|
||||||
} else {
|
|
||||||
UNIMPLEMENTED();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Module::Interface::GetStandardSteadyClock(Kernel::HLERequestContext& ctx) {
|
void Module::Interface::GetStandardSteadyClock(Kernel::HLERequestContext& ctx) {
|
||||||
auto client_port = std::make_shared<ISteadyClock>()->CreatePort();
|
auto steady_clock = std::make_shared<ISteadyClock>();
|
||||||
auto session = client_port->Connect();
|
auto sessions = Kernel::ServerSession::CreateSessionPair(steady_clock->GetServiceName());
|
||||||
if (session.Succeeded()) {
|
auto server = std::get<Kernel::SharedPtr<Kernel::ServerSession>>(sessions);
|
||||||
LOG_DEBUG(Service, "called, initialized ISteadyClock -> session=%u",
|
auto client = std::get<Kernel::SharedPtr<Kernel::ClientSession>>(sessions);
|
||||||
(*session)->GetObjectId());
|
steady_clock->ClientConnected(server);
|
||||||
|
LOG_DEBUG(Service, "called, initialized ISteadyClock -> session=%u", client->GetObjectId());
|
||||||
IPC::RequestBuilder rb{ctx, 2, 0, 1};
|
IPC::RequestBuilder rb{ctx, 2, 0, 1};
|
||||||
rb.Push(RESULT_SUCCESS);
|
rb.Push(RESULT_SUCCESS);
|
||||||
rb.PushMoveObjects(std::move(session).Unwrap());
|
rb.PushMoveObjects(std::move(client));
|
||||||
} else {
|
|
||||||
UNIMPLEMENTED();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Module::Interface::GetTimeZoneService(Kernel::HLERequestContext& ctx) {
|
void Module::Interface::GetTimeZoneService(Kernel::HLERequestContext& ctx) {
|
||||||
|
Loading…
Reference in New Issue
Block a user