diff options
author | bunnei <bunneidev@gmail.com> | 2018-01-25 05:09:03 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-25 05:09:03 +0100 |
commit | 748c0de539674dc8ca4a5a8aadd2a61b0eabe652 (patch) | |
tree | ae56efe8654d3aa3a5e75ec04bd9dfdcc06023a9 /src/core/hle/service/sm/controller.cpp | |
parent | audout:u OpenAudioOut and IAudioOut (#138) (diff) | |
parent | audout_u: Various cleanups. (diff) | |
download | yuzu-748c0de539674dc8ca4a5a8aadd2a61b0eabe652.tar yuzu-748c0de539674dc8ca4a5a8aadd2a61b0eabe652.tar.gz yuzu-748c0de539674dc8ca4a5a8aadd2a61b0eabe652.tar.bz2 yuzu-748c0de539674dc8ca4a5a8aadd2a61b0eabe652.tar.lz yuzu-748c0de539674dc8ca4a5a8aadd2a61b0eabe652.tar.xz yuzu-748c0de539674dc8ca4a5a8aadd2a61b0eabe652.tar.zst yuzu-748c0de539674dc8ca4a5a8aadd2a61b0eabe652.zip |
Diffstat (limited to 'src/core/hle/service/sm/controller.cpp')
-rw-r--r-- | src/core/hle/service/sm/controller.cpp | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/core/hle/service/sm/controller.cpp b/src/core/hle/service/sm/controller.cpp index 7b1c8ee37..a81ff9f49 100644 --- a/src/core/hle/service/sm/controller.cpp +++ b/src/core/hle/service/sm/controller.cpp @@ -4,30 +4,26 @@ #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 { 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}; + IPC::ResponseBuilder rb{ctx, 3}; rb.Push(RESULT_SUCCESS); - rb.Push(static_cast<u32>(domain->request_handlers.size())); + rb.Push<u32>(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}; + IPC::ResponseBuilder rb{ctx, 2, 0, 1, IPC::ResponseBuilder::Flags::AlwaysMoveHandles}; 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"); } @@ -39,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<u32>(0x500); |