From f9dae990066cb0fa3730a811353781e9e7bffa19 Mon Sep 17 00:00:00 2001 From: bunnei Date: Tue, 23 Jan 2018 19:43:59 -0500 Subject: service: Fix all incorrect IPC response headers. --- src/core/hle/service/time/time.cpp | 35 +++++++---------------------------- 1 file changed, 7 insertions(+), 28 deletions(-) (limited to 'src/core/hle/service/time/time.cpp') diff --git a/src/core/hle/service/time/time.cpp b/src/core/hle/service/time/time.cpp index 448ef8544..9816a33d0 100644 --- a/src/core/hle/service/time/time.cpp +++ b/src/core/hle/service/time/time.cpp @@ -83,49 +83,28 @@ private: }; void Module::Interface::GetStandardUserSystemClock(Kernel::HLERequestContext& ctx) { - // TODO(Subv): Verify if this should return the interface as a domain object when called from - // within a domain. - auto system_clock = std::make_shared(); - auto sessions = Kernel::ServerSession::CreateSessionPair(system_clock->GetServiceName()); - auto server = std::get>(sessions); - auto client = std::get>(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)); + rb.PushIpcInterface(); + LOG_DEBUG(Service, "called"); } void Module::Interface::GetStandardNetworkSystemClock(Kernel::HLERequestContext& ctx) { - // TODO(Subv): Verify if this should return the interface as a domain object when called from - // within a domain. - auto system_clock = std::make_shared(); - auto sessions = Kernel::ServerSession::CreateSessionPair(system_clock->GetServiceName()); - auto server = std::get>(sessions); - auto client = std::get>(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)); + rb.PushIpcInterface(); + LOG_DEBUG(Service, "called"); } void Module::Interface::GetStandardSteadyClock(Kernel::HLERequestContext& ctx) { - // TODO(Subv): Verify if this should return the interface as a domain object when called from - // within a domain. - auto steady_clock = std::make_shared(); - auto sessions = Kernel::ServerSession::CreateSessionPair(steady_clock->GetServiceName()); - auto server = std::get>(sessions); - auto client = std::get>(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)); + rb.PushIpcInterface(); + LOG_DEBUG(Service, "called"); } void Module::Interface::GetTimeZoneService(Kernel::HLERequestContext& ctx) { - IPC::RequestBuilder rb{ctx, 2, 0, 0, 1}; + IPC::RequestBuilder rb{ctx, 2, 0, 1}; rb.Push(RESULT_SUCCESS); rb.PushIpcInterface(); LOG_DEBUG(Service, "called"); -- cgit v1.2.3 From 1b1d399e5f9018e7e4c5da9dfa0932eacfc392e9 Mon Sep 17 00:00:00 2001 From: bunnei Date: Tue, 23 Jan 2018 19:52:18 -0500 Subject: hle: Rename RequestBuilder to ResponseBuilder. --- src/core/hle/service/time/time.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/core/hle/service/time/time.cpp') diff --git a/src/core/hle/service/time/time.cpp b/src/core/hle/service/time/time.cpp index 9816a33d0..d6f3ae043 100644 --- a/src/core/hle/service/time/time.cpp +++ b/src/core/hle/service/time/time.cpp @@ -28,7 +28,7 @@ private: const s64 time_since_epoch{std::chrono::duration_cast( std::chrono::system_clock::now().time_since_epoch()) .count()}; - IPC::RequestBuilder rb{ctx, 4}; + IPC::ResponseBuilder rb{ctx, 4}; rb.Push(RESULT_SUCCESS); rb.Push(time_since_epoch); LOG_DEBUG(Service, "called"); @@ -55,14 +55,14 @@ private: void GetDeviceLocationName(Kernel::HLERequestContext& ctx) { LOG_WARNING(Service, "(STUBBED) called"); LocationName location_name{}; - IPC::RequestBuilder rb{ctx, (sizeof(LocationName) / 4) + 2}; + IPC::ResponseBuilder rb{ctx, (sizeof(LocationName) / 4) + 2}; rb.Push(RESULT_SUCCESS); rb.PushRaw(location_name); } void GetTotalLocationNameCount(Kernel::HLERequestContext& ctx) { LOG_WARNING(Service, "(STUBBED) called"); - IPC::RequestBuilder rb{ctx, 3}; + IPC::ResponseBuilder rb{ctx, 3}; rb.Push(RESULT_SUCCESS); rb.Push(0); } @@ -75,7 +75,7 @@ private: CalendarTime calendar_time{2018, 1, 1, 0, 0, 0}; CalendarAdditionalInfo additional_info{}; - IPC::RequestBuilder rb{ctx, 10}; + IPC::ResponseBuilder rb{ctx, 10}; rb.Push(RESULT_SUCCESS); rb.PushRaw(calendar_time); rb.PushRaw(additional_info); @@ -83,28 +83,28 @@ private: }; void Module::Interface::GetStandardUserSystemClock(Kernel::HLERequestContext& ctx) { - IPC::RequestBuilder rb{ctx, 2, 0, 1}; + IPC::ResponseBuilder rb{ctx, 2, 0, 1}; rb.Push(RESULT_SUCCESS); rb.PushIpcInterface(); LOG_DEBUG(Service, "called"); } void Module::Interface::GetStandardNetworkSystemClock(Kernel::HLERequestContext& ctx) { - IPC::RequestBuilder rb{ctx, 2, 0, 1}; + IPC::ResponseBuilder rb{ctx, 2, 0, 1}; rb.Push(RESULT_SUCCESS); rb.PushIpcInterface(); LOG_DEBUG(Service, "called"); } void Module::Interface::GetStandardSteadyClock(Kernel::HLERequestContext& ctx) { - IPC::RequestBuilder rb{ctx, 2, 0, 1}; + IPC::ResponseBuilder rb{ctx, 2, 0, 1}; rb.Push(RESULT_SUCCESS); rb.PushIpcInterface(); LOG_DEBUG(Service, "called"); } void Module::Interface::GetTimeZoneService(Kernel::HLERequestContext& ctx) { - IPC::RequestBuilder rb{ctx, 2, 0, 1}; + IPC::ResponseBuilder rb{ctx, 2, 0, 1}; rb.Push(RESULT_SUCCESS); rb.PushIpcInterface(); LOG_DEBUG(Service, "called"); -- cgit v1.2.3 From f0b6baf3adde14f9ccfc4660a6eaa412a81d644d Mon Sep 17 00:00:00 2001 From: bunnei Date: Tue, 23 Jan 2018 22:02:14 -0500 Subject: time: Stub GetSystemClockContext function. --- src/core/hle/service/time/time.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/core/hle/service/time/time.cpp') diff --git a/src/core/hle/service/time/time.cpp b/src/core/hle/service/time/time.cpp index d6f3ae043..96ccee50d 100644 --- a/src/core/hle/service/time/time.cpp +++ b/src/core/hle/service/time/time.cpp @@ -19,7 +19,7 @@ public: ISystemClock() : ServiceFramework("ISystemClock") { static const FunctionInfo functions[] = { {0, &ISystemClock::GetCurrentTime, "GetCurrentTime"}, - }; + {2, &ISystemClock::GetSystemClockContext, "GetSystemClockContext"}}; RegisterHandlers(functions); } @@ -28,10 +28,18 @@ private: const s64 time_since_epoch{std::chrono::duration_cast( std::chrono::system_clock::now().time_since_epoch()) .count()}; + LOG_DEBUG(Service, "called"); IPC::ResponseBuilder rb{ctx, 4}; rb.Push(RESULT_SUCCESS); rb.Push(time_since_epoch); - LOG_DEBUG(Service, "called"); + } + + void GetSystemClockContext(Kernel::HLERequestContext& ctx) { + LOG_WARNING(Service, "(STUBBED) called"); + SystemClockContext system_clock_ontext{}; + IPC::ResponseBuilder rb{ctx, (sizeof(SystemClockContext) / 4) + 2}; + rb.Push(RESULT_SUCCESS); + rb.PushRaw(system_clock_ontext); } }; -- cgit v1.2.3