summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2017-12-29 06:36:22 +0100
committerbunnei <bunneidev@gmail.com>2017-12-29 06:36:22 +0100
commitdcdaac8a0b5ae5b8d251c3713d3024287b0720b1 (patch)
tree35cb5631e4d00d1582aa238cf93abdc73b6afa8a /src/core/hle/service
parentap, aoc_u: Minor cleanup. (diff)
downloadyuzu-dcdaac8a0b5ae5b8d251c3713d3024287b0720b1.tar
yuzu-dcdaac8a0b5ae5b8d251c3713d3024287b0720b1.tar.gz
yuzu-dcdaac8a0b5ae5b8d251c3713d3024287b0720b1.tar.bz2
yuzu-dcdaac8a0b5ae5b8d251c3713d3024287b0720b1.tar.lz
yuzu-dcdaac8a0b5ae5b8d251c3713d3024287b0720b1.tar.xz
yuzu-dcdaac8a0b5ae5b8d251c3713d3024287b0720b1.tar.zst
yuzu-dcdaac8a0b5ae5b8d251c3713d3024287b0720b1.zip
Diffstat (limited to 'src/core/hle/service')
-rw-r--r--src/core/hle/service/service.cpp13
-rw-r--r--src/core/hle/service/service.h2
-rw-r--r--src/core/hle/service/sm/controller.cpp18
3 files changed, 9 insertions, 24 deletions
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp
index 0fba224e1..3dfde8f39 100644
--- a/src/core/hle/service/service.cpp
+++ b/src/core/hle/service/service.cpp
@@ -13,7 +13,6 @@
#include "core/hle/kernel/handle_table.h"
#include "core/hle/kernel/process.h"
#include "core/hle/kernel/server_port.h"
-#include "core/hle/kernel/server_session.h"
#include "core/hle/kernel/thread.h"
#include "core/hle/service/am/am.h"
#include "core/hle/service/aoc/aoc_u.h"
@@ -29,7 +28,6 @@
using Kernel::ClientPort;
using Kernel::ServerPort;
-using Kernel::ServerSession;
using Kernel::SharedPtr;
namespace Service {
@@ -124,15 +122,7 @@ void ServiceFrameworkBase::InvokeRequest(Kernel::HLERequestContext& ctx) {
handler_invoker(this, info->handler_callback, ctx);
}
-ResultCode ServiceFrameworkBase::HandleSyncRequest(SharedPtr<ServerSession> server_session) {
- u32* cmd_buf = (u32*)Memory::GetPointer(Kernel::GetCurrentThread()->GetTLSAddress());
-
- // TODO(yuriks): The kernel should be the one handling this as part of translation after
- // everything else is migrated
- Kernel::HLERequestContext context(std::move(server_session));
- context.PopulateFromIncomingCommandBuffer(cmd_buf, *Kernel::g_current_process,
- Kernel::g_handle_table);
-
+ResultCode ServiceFrameworkBase::HandleSyncRequest(Kernel::HLERequestContext& context) {
switch (context.GetCommandType()) {
case IPC::CommandType::Close: {
IPC::RequestBuilder rb{context, 1};
@@ -151,6 +141,7 @@ ResultCode ServiceFrameworkBase::HandleSyncRequest(SharedPtr<ServerSession> serv
UNIMPLEMENTED_MSG("command_type=%d", context.GetCommandType());
}
+ u32* cmd_buf = (u32*)Memory::GetPointer(Kernel::GetCurrentThread()->GetTLSAddress());
context.WriteToOutgoingCommandBuffer(cmd_buf, *Kernel::g_current_process,
Kernel::g_handle_table);
diff --git a/src/core/hle/service/service.h b/src/core/hle/service/service.h
index ad5f95292..234a5c88d 100644
--- a/src/core/hle/service/service.h
+++ b/src/core/hle/service/service.h
@@ -63,7 +63,7 @@ public:
void InvokeRequest(Kernel::HLERequestContext& ctx);
- ResultCode HandleSyncRequest(Kernel::SharedPtr<Kernel::ServerSession> server_session) override;
+ ResultCode HandleSyncRequest(Kernel::HLERequestContext& context) override;
protected:
/// Member-function pointer type of SyncRequest handlers.
diff --git a/src/core/hle/service/sm/controller.cpp b/src/core/hle/service/sm/controller.cpp
index 414a7d809..1d7ab3a1c 100644
--- a/src/core/hle/service/sm/controller.cpp
+++ b/src/core/hle/service/sm/controller.cpp
@@ -4,27 +4,21 @@
#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 {
-/**
- * Controller::ConvertSessionToDomain service function
- * Inputs:
- * 0: 0x00000000
- * Outputs:
- * 0: ResultCode
- * 2: Handle of domain
- */
void Controller::ConvertSessionToDomain(Kernel::HLERequestContext& ctx) {
- ctx.Session()->ConvertToDomain();
+ auto domain = Kernel::Domain::CreateFromSession(*ctx.ServerSession()->parent).Unwrap();
+
IPC::RequestBuilder rb{ctx, 3};
rb.Push(RESULT_SUCCESS);
rb.Skip(1, true);
- Kernel::Handle handle = Kernel::g_handle_table.Create(ctx.Session()).Unwrap();
- rb.Push(handle);
- LOG_DEBUG(Service, "called, handle=0x%08x", handle);
+ rb.Push<u32>(static_cast<u32>(domain->request_handlers.size()));
+
+ LOG_DEBUG(Service, "called, domain=%d", domain->GetObjectId());
}
/**