summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Yuri Kunde Schlesner2017-06-22 23:54:36 -0700
committerGravatar Yuri Kunde Schlesner2017-06-23 11:22:02 -0700
commitaa0f3047d367819acdd4333c8290992b99433073 (patch)
tree39d0e56e7657b2325c182ffb39697d2eb14b7246 /src
parentMerge pull request #2798 from yuriks/svc-create-session (diff)
downloadyuzu-aa0f3047d367819acdd4333c8290992b99433073.tar.gz
yuzu-aa0f3047d367819acdd4333c8290992b99433073.tar.xz
yuzu-aa0f3047d367819acdd4333c8290992b99433073.zip
Kernel: Implement CreateSessionToPort SVC
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/svc.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp
index f459b1314..2e11d41ce 100644
--- a/src/core/hle/svc.cpp
+++ b/src/core/hle/svc.cpp
@@ -947,6 +947,17 @@ static ResultCode CreatePort(Kernel::Handle* server_port, Kernel::Handle* client
947 return RESULT_SUCCESS; 947 return RESULT_SUCCESS;
948} 948}
949 949
950static ResultCode CreateSessionToPort(Handle* out_client_session, Handle client_port_handle) {
951 using Kernel::ClientPort;
952 SharedPtr<ClientPort> client_port = Kernel::g_handle_table.Get<ClientPort>(client_port_handle);
953 if (client_port == nullptr)
954 return ERR_INVALID_HANDLE;
955
956 CASCADE_RESULT(auto session, client_port->Connect());
957 CASCADE_RESULT(*out_client_session, Kernel::g_handle_table.Create(std::move(session)));
958 return RESULT_SUCCESS;
959}
960
950static ResultCode CreateSession(Handle* server_session, Handle* client_session) { 961static ResultCode CreateSession(Handle* server_session, Handle* client_session) {
951 auto sessions = Kernel::ServerSession::CreateSessionPair(); 962 auto sessions = Kernel::ServerSession::CreateSessionPair();
952 963
@@ -1134,7 +1145,7 @@ static const FunctionDef SVC_Table[] = {
1134 {0x45, nullptr, "Unknown"}, 1145 {0x45, nullptr, "Unknown"},
1135 {0x46, nullptr, "Unknown"}, 1146 {0x46, nullptr, "Unknown"},
1136 {0x47, HLE::Wrap<CreatePort>, "CreatePort"}, 1147 {0x47, HLE::Wrap<CreatePort>, "CreatePort"},
1137 {0x48, nullptr, "CreateSessionToPort"}, 1148 {0x48, HLE::Wrap<CreateSessionToPort>, "CreateSessionToPort"},
1138 {0x49, HLE::Wrap<CreateSession>, "CreateSession"}, 1149 {0x49, HLE::Wrap<CreateSession>, "CreateSession"},
1139 {0x4A, nullptr, "AcceptSession"}, 1150 {0x4A, nullptr, "AcceptSession"},
1140 {0x4B, nullptr, "ReplyAndReceive1"}, 1151 {0x4B, nullptr, "ReplyAndReceive1"},