summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Subv2018-01-06 23:19:42 -0500
committerGravatar bunnei2018-01-07 17:11:45 -0500
commitb0ceb4df70c8a387e12e2df0d1031421493ad744 (patch)
treefbe37a5849d34de75250fd12bc7403cc3c1ea4ad /src
parentIPC: Use the correct size when pushing raw data to the command buffer and fix... (diff)
downloadyuzu-b0ceb4df70c8a387e12e2df0d1031421493ad744.tar.gz
yuzu-b0ceb4df70c8a387e12e2df0d1031421493ad744.tar.xz
yuzu-b0ceb4df70c8a387e12e2df0d1031421493ad744.zip
IPC: Skip the entire u64 of the command id when receiving an IPC request.
Service code now doesn't have to deal with this.
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/kernel/hle_ipc.cpp3
-rw-r--r--src/core/hle/service/sm/sm.cpp17
2 files changed, 5 insertions, 15 deletions
diff --git a/src/core/hle/kernel/hle_ipc.cpp b/src/core/hle/kernel/hle_ipc.cpp
index e784d59cc..ac81dbf3f 100644
--- a/src/core/hle/kernel/hle_ipc.cpp
+++ b/src/core/hle/kernel/hle_ipc.cpp
@@ -107,8 +107,9 @@ void HLERequestContext::ParseCommandBuffer(u32_le* src_cmdbuf, bool incoming) {
107 ASSERT(data_payload_header->magic == Common::MakeMagic('S', 'F', 'C', 'O')); 107 ASSERT(data_payload_header->magic == Common::MakeMagic('S', 'F', 'C', 'O'));
108 } 108 }
109 109
110 data_payload_offset = rp.GetCurrentOffset();
111 command = rp.Pop<u32_le>(); 110 command = rp.Pop<u32_le>();
111 rp.Skip(1, false); // The command is actually an u64, but we don't use the high part.
112 data_payload_offset = rp.GetCurrentOffset();
112} 113}
113 114
114ResultCode HLERequestContext::PopulateFromIncomingCommandBuffer(u32_le* src_cmdbuf, 115ResultCode HLERequestContext::PopulateFromIncomingCommandBuffer(u32_le* src_cmdbuf,
diff --git a/src/core/hle/service/sm/sm.cpp b/src/core/hle/service/sm/sm.cpp
index a976385ac..279908cae 100644
--- a/src/core/hle/service/sm/sm.cpp
+++ b/src/core/hle/service/sm/sm.cpp
@@ -100,8 +100,6 @@ void SM::Initialize(Kernel::HLERequestContext& ctx) {
100 */ 100 */
101void SM::GetService(Kernel::HLERequestContext& ctx) { 101void SM::GetService(Kernel::HLERequestContext& ctx) {
102 IPC::RequestParser rp{ctx}; 102 IPC::RequestParser rp{ctx};
103 u32 unk1 = rp.Pop<u32>();
104 u32 unk2 = rp.Pop<u32>();
105 auto name_buf = rp.PopRaw<std::array<char, 9>>(); 103 auto name_buf = rp.PopRaw<std::array<char, 9>>();
106 std::string name(name_buf.data()); 104 std::string name(name_buf.data());
107 105
@@ -117,22 +115,13 @@ void SM::GetService(Kernel::HLERequestContext& ctx) {
117 } 115 }
118 116
119 auto session = client_port.Unwrap()->Connect(); 117 auto session = client_port.Unwrap()->Connect();
118 ASSERT(session.Succeeded());
120 if (session.Succeeded()) { 119 if (session.Succeeded()) {
121 LOG_DEBUG(Service_SM, "called service=%s -> session=%u", name.c_str(), 120 LOG_DEBUG(Service_SM, "called service=%s -> session=%u", name.c_str(),
122 (*session)->GetObjectId()); 121 (*session)->GetObjectId());
123 IPC::RequestBuilder rb = rp.MakeBuilder(1, 0, 1); 122 IPC::RequestBuilder rb = rp.MakeBuilder(2, 0, 1);
124 rb.Push(session.Code()); 123 rb.Push<u64>(0);
125 rb.PushObjects(std::move(session).Unwrap()); 124 rb.PushObjects(std::move(session).Unwrap());
126 } else if (session.Code() == Kernel::ERR_MAX_CONNECTIONS_REACHED /*&& return_port_on_failure*/) {
127 LOG_WARNING(Service_SM, "called service=%s -> ERR_MAX_CONNECTIONS_REACHED, *port*=%u",
128 name.c_str(), (*client_port)->GetObjectId());
129 IPC::RequestBuilder rb = rp.MakeBuilder(1, 0, 1);
130 rb.Push(ERR_MAX_CONNECTIONS_REACHED);
131 rb.PushObjects(std::move(client_port).Unwrap());
132 } else {
133 LOG_ERROR(Service_SM, "called service=%s -> error 0x%08X", name.c_str(), session.Code());
134 IPC::RequestBuilder rb = rp.MakeBuilder(1, 0, 0);
135 rb.Push(session.Code());
136 } 125 }
137} 126}
138 127