summaryrefslogtreecommitdiffstats
path: root/src/core/hle/svc.cpp
diff options
context:
space:
mode:
authorYuri Kunde Schlesner <yuriks@yuriks.net>2017-06-22 02:19:24 +0200
committerYuri Kunde Schlesner <yuriks@yuriks.net>2017-06-22 09:39:27 +0200
commitf94093d0fd50e547256643734b67550de538860f (patch)
tree1baf48fb477ec6054a376c6afa1a44c700ab5772 /src/core/hle/svc.cpp
parentMerge pull request #2792 from wwylele/lutlutlut (diff)
downloadyuzu-f94093d0fd50e547256643734b67550de538860f.tar
yuzu-f94093d0fd50e547256643734b67550de538860f.tar.gz
yuzu-f94093d0fd50e547256643734b67550de538860f.tar.bz2
yuzu-f94093d0fd50e547256643734b67550de538860f.tar.lz
yuzu-f94093d0fd50e547256643734b67550de538860f.tar.xz
yuzu-f94093d0fd50e547256643734b67550de538860f.tar.zst
yuzu-f94093d0fd50e547256643734b67550de538860f.zip
Diffstat (limited to '')
-rw-r--r--src/core/hle/svc.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp
index e68b9f16a..f459b1314 100644
--- a/src/core/hle/svc.cpp
+++ b/src/core/hle/svc.cpp
@@ -36,8 +36,9 @@
////////////////////////////////////////////////////////////////////////////////////////////////////
// Namespace SVC
-using Kernel::SharedPtr;
using Kernel::ERR_INVALID_HANDLE;
+using Kernel::Handle;
+using Kernel::SharedPtr;
namespace SVC {
@@ -933,7 +934,6 @@ static ResultCode CreatePort(Kernel::Handle* server_port, Kernel::Handle* client
using Kernel::ServerPort;
using Kernel::ClientPort;
- using Kernel::SharedPtr;
auto ports = ServerPort::CreatePortPair(max_sessions);
CASCADE_RESULT(*client_port, Kernel::g_handle_table.Create(
@@ -947,6 +947,19 @@ static ResultCode CreatePort(Kernel::Handle* server_port, Kernel::Handle* client
return RESULT_SUCCESS;
}
+static ResultCode CreateSession(Handle* server_session, Handle* client_session) {
+ auto sessions = Kernel::ServerSession::CreateSessionPair();
+
+ auto& server = std::get<SharedPtr<Kernel::ServerSession>>(sessions);
+ CASCADE_RESULT(*server_session, Kernel::g_handle_table.Create(std::move(server)));
+
+ auto& client = std::get<SharedPtr<Kernel::ClientSession>>(sessions);
+ CASCADE_RESULT(*client_session, Kernel::g_handle_table.Create(std::move(client)));
+
+ LOG_TRACE(Kernel_SVC, "called");
+ return RESULT_SUCCESS;
+}
+
static ResultCode GetSystemInfo(s64* out, u32 type, s32 param) {
using Kernel::MemoryRegion;
@@ -1122,7 +1135,7 @@ static const FunctionDef SVC_Table[] = {
{0x46, nullptr, "Unknown"},
{0x47, HLE::Wrap<CreatePort>, "CreatePort"},
{0x48, nullptr, "CreateSessionToPort"},
- {0x49, nullptr, "CreateSession"},
+ {0x49, HLE::Wrap<CreateSession>, "CreateSession"},
{0x4A, nullptr, "AcceptSession"},
{0x4B, nullptr, "ReplyAndReceive1"},
{0x4C, nullptr, "ReplyAndReceive2"},