diff options
| author | 2018-01-07 09:56:57 -0500 | |
|---|---|---|
| committer | 2018-01-07 17:11:54 -0500 | |
| commit | 80f6df5414517e575037661ffb903232bf3e590c (patch) | |
| tree | 8be1c03aab7a52034363beb19c541ff442ebfd2f /src/core | |
| parent | IPC: Add functions to read the input move/copy objects from an IPC request. (diff) | |
| download | yuzu-80f6df5414517e575037661ffb903232bf3e590c.tar.gz yuzu-80f6df5414517e575037661ffb903232bf3e590c.tar.xz yuzu-80f6df5414517e575037661ffb903232bf3e590c.zip | |
IPC: Fixed pushing ResultCodes into the command buffer.
They should have 32 bits of padding after the error code now.
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/hle/ipc_helpers.h | 12 | ||||
| -rw-r--r-- | src/core/hle/service/sm/sm.cpp | 4 |
2 files changed, 9 insertions, 7 deletions
diff --git a/src/core/hle/ipc_helpers.h b/src/core/hle/ipc_helpers.h index e5b296d60..b58e33a69 100644 --- a/src/core/hle/ipc_helpers.h +++ b/src/core/hle/ipc_helpers.h | |||
| @@ -143,6 +143,13 @@ void RequestBuilder::PushRaw(const T& value) { | |||
| 143 | } | 143 | } |
| 144 | 144 | ||
| 145 | template <> | 145 | template <> |
| 146 | inline void RequestBuilder::Push(ResultCode value) { | ||
| 147 | // Result codes are actually 64-bit in the IPC buffer, but only the high part is discarded. | ||
| 148 | Push(value.raw); | ||
| 149 | Push<u32>(0); | ||
| 150 | } | ||
| 151 | |||
| 152 | template <> | ||
| 146 | inline void RequestBuilder::Push(u8 value) { | 153 | inline void RequestBuilder::Push(u8 value) { |
| 147 | PushRaw(value); | 154 | PushRaw(value); |
| 148 | } | 155 | } |
| @@ -163,11 +170,6 @@ inline void RequestBuilder::Push(bool value) { | |||
| 163 | Push(static_cast<u8>(value)); | 170 | Push(static_cast<u8>(value)); |
| 164 | } | 171 | } |
| 165 | 172 | ||
| 166 | template <> | ||
| 167 | inline void RequestBuilder::Push(ResultCode value) { | ||
| 168 | Push(value.raw); | ||
| 169 | } | ||
| 170 | |||
| 171 | template <typename First, typename... Other> | 173 | template <typename First, typename... Other> |
| 172 | void RequestBuilder::Push(const First& first_value, const Other&... other_values) { | 174 | void RequestBuilder::Push(const First& first_value, const Other&... other_values) { |
| 173 | Push(first_value); | 175 | Push(first_value); |
diff --git a/src/core/hle/service/sm/sm.cpp b/src/core/hle/service/sm/sm.cpp index f1d93ea2b..509945136 100644 --- a/src/core/hle/service/sm/sm.cpp +++ b/src/core/hle/service/sm/sm.cpp | |||
| @@ -107,7 +107,7 @@ void SM::GetService(Kernel::HLERequestContext& ctx) { | |||
| 107 | 107 | ||
| 108 | auto client_port = service_manager->GetServicePort(name); | 108 | auto client_port = service_manager->GetServicePort(name); |
| 109 | if (client_port.Failed()) { | 109 | if (client_port.Failed()) { |
| 110 | IPC::RequestBuilder rb = rp.MakeBuilder(1, 0, 0); | 110 | IPC::RequestBuilder rb = rp.MakeBuilder(2, 0, 0); |
| 111 | rb.Push(client_port.Code()); | 111 | rb.Push(client_port.Code()); |
| 112 | LOG_ERROR(Service_SM, "called service=%s -> error 0x%08X", name.c_str(), | 112 | LOG_ERROR(Service_SM, "called service=%s -> error 0x%08X", name.c_str(), |
| 113 | client_port.Code().raw); | 113 | client_port.Code().raw); |
| @@ -120,7 +120,7 @@ void SM::GetService(Kernel::HLERequestContext& ctx) { | |||
| 120 | 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(), |
| 121 | (*session)->GetObjectId()); | 121 | (*session)->GetObjectId()); |
| 122 | IPC::RequestBuilder rb = rp.MakeBuilder(2, 0, 1); | 122 | IPC::RequestBuilder rb = rp.MakeBuilder(2, 0, 1); |
| 123 | rb.Push<u64>(0); | 123 | rb.Push(session.Code()); |
| 124 | rb.PushMoveObjects(std::move(session).Unwrap()); | 124 | rb.PushMoveObjects(std::move(session).Unwrap()); |
| 125 | } | 125 | } |
| 126 | } | 126 | } |