From 67758857e4203cebc9a5815c6b0293c0aad0e598 Mon Sep 17 00:00:00 2001 From: bunnei Date: Tue, 23 Jan 2018 16:13:19 -0500 Subject: hle: Remove Domain and SyncObject kernel objects. --- src/core/hle/service/sm/controller.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src/core/hle/service/sm/controller.cpp') diff --git a/src/core/hle/service/sm/controller.cpp b/src/core/hle/service/sm/controller.cpp index 7b1c8ee37..e91d9d856 100644 --- a/src/core/hle/service/sm/controller.cpp +++ b/src/core/hle/service/sm/controller.cpp @@ -4,7 +4,6 @@ #include "common/logging/log.h" #include "core/hle/ipc_helpers.h" -#include "core/hle/kernel/domain.h" #include "core/hle/service/sm/controller.h" namespace Service { -- cgit v1.2.3 From 27bad0598a3ddce0417388c3945368200150d413 Mon Sep 17 00:00:00 2001 From: bunnei Date: Tue, 23 Jan 2018 18:03:09 -0500 Subject: hle: Integrate Domain handling into ServerSession. --- src/core/hle/service/sm/controller.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/core/hle/service/sm/controller.cpp') diff --git a/src/core/hle/service/sm/controller.cpp b/src/core/hle/service/sm/controller.cpp index e91d9d856..3eead315a 100644 --- a/src/core/hle/service/sm/controller.cpp +++ b/src/core/hle/service/sm/controller.cpp @@ -10,23 +10,21 @@ namespace Service { namespace SM { void Controller::ConvertSessionToDomain(Kernel::HLERequestContext& ctx) { - auto domain = Kernel::Domain::CreateFromSession(*ctx.ServerSession()->parent).Unwrap(); + ASSERT_MSG(!ctx.Session()->IsDomain(), "session is alread a domain"); + ctx.Session()->ConvertToDomain(); IPC::RequestBuilder rb{ctx, 3}; rb.Push(RESULT_SUCCESS); - rb.Push(static_cast(domain->request_handlers.size())); + rb.Push(1); // Converted sessions start with 1 request handler - LOG_DEBUG(Service, "called, domain=%d", domain->GetObjectId()); + LOG_DEBUG(Service, "called, server_session=%d", ctx.Session()->GetObjectId()); } void Controller::DuplicateSession(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb{ctx, 2, 0, 1}; rb.Push(RESULT_SUCCESS); // TODO(Subv): Check if this is correct - if (ctx.IsDomain()) - rb.PushMoveObjects(ctx.Domain()); - else - rb.PushMoveObjects(ctx.ServerSession()); + rb.PushMoveObjects(ctx.Session()); LOG_DEBUG(Service, "called"); } -- cgit v1.2.3 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/sm/controller.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/core/hle/service/sm/controller.cpp') diff --git a/src/core/hle/service/sm/controller.cpp b/src/core/hle/service/sm/controller.cpp index 3eead315a..1c1da9bbc 100644 --- a/src/core/hle/service/sm/controller.cpp +++ b/src/core/hle/service/sm/controller.cpp @@ -21,9 +21,8 @@ void Controller::ConvertSessionToDomain(Kernel::HLERequestContext& ctx) { } void Controller::DuplicateSession(Kernel::HLERequestContext& ctx) { - IPC::RequestBuilder rb{ctx, 2, 0, 1}; + IPC::RequestBuilder rb{ctx, 2, 0, 1, true}; rb.Push(RESULT_SUCCESS); - // TODO(Subv): Check if this is correct rb.PushMoveObjects(ctx.Session()); 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/sm/controller.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/core/hle/service/sm/controller.cpp') diff --git a/src/core/hle/service/sm/controller.cpp b/src/core/hle/service/sm/controller.cpp index 1c1da9bbc..79700b7b2 100644 --- a/src/core/hle/service/sm/controller.cpp +++ b/src/core/hle/service/sm/controller.cpp @@ -13,7 +13,7 @@ void Controller::ConvertSessionToDomain(Kernel::HLERequestContext& ctx) { ASSERT_MSG(!ctx.Session()->IsDomain(), "session is alread a domain"); ctx.Session()->ConvertToDomain(); - IPC::RequestBuilder rb{ctx, 3}; + IPC::ResponseBuilder rb{ctx, 3}; rb.Push(RESULT_SUCCESS); rb.Push(1); // Converted sessions start with 1 request handler @@ -21,7 +21,7 @@ void Controller::ConvertSessionToDomain(Kernel::HLERequestContext& ctx) { } void Controller::DuplicateSession(Kernel::HLERequestContext& ctx) { - IPC::RequestBuilder rb{ctx, 2, 0, 1, true}; + IPC::ResponseBuilder rb{ctx, 2, 0, 1, true}; rb.Push(RESULT_SUCCESS); rb.PushMoveObjects(ctx.Session()); @@ -35,7 +35,7 @@ void Controller::DuplicateSessionEx(Kernel::HLERequestContext& ctx) { } void Controller::QueryPointerBufferSize(Kernel::HLERequestContext& ctx) { - IPC::RequestBuilder rb{ctx, 3}; + IPC::ResponseBuilder rb{ctx, 3}; rb.Push(RESULT_SUCCESS); rb.Push(0x500); -- cgit v1.2.3 From 714a57611397abecf95cdfbe8295ece64e66b3b7 Mon Sep 17 00:00:00 2001 From: bunnei Date: Tue, 23 Jan 2018 22:33:30 -0500 Subject: ResponseBuilder: Use a bit field for customizing instead of always_move_handles. --- src/core/hle/service/sm/controller.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core/hle/service/sm/controller.cpp') diff --git a/src/core/hle/service/sm/controller.cpp b/src/core/hle/service/sm/controller.cpp index 79700b7b2..a81ff9f49 100644 --- a/src/core/hle/service/sm/controller.cpp +++ b/src/core/hle/service/sm/controller.cpp @@ -21,7 +21,7 @@ void Controller::ConvertSessionToDomain(Kernel::HLERequestContext& ctx) { } void Controller::DuplicateSession(Kernel::HLERequestContext& ctx) { - IPC::ResponseBuilder rb{ctx, 2, 0, 1, true}; + IPC::ResponseBuilder rb{ctx, 2, 0, 1, IPC::ResponseBuilder::Flags::AlwaysMoveHandles}; rb.Push(RESULT_SUCCESS); rb.PushMoveObjects(ctx.Session()); -- cgit v1.2.3