diff options
| author | 2017-10-04 11:49:29 -0500 | |
|---|---|---|
| committer | 2017-10-04 12:30:33 -0500 | |
| commit | 0cfb231e002629172337c048e8cabc8c653e34e3 (patch) | |
| tree | 217133327f9817305d592cd4eee1d8bed53c8784 /src | |
| parent | SVC: Replace GetPointer usage with Read32 in WaitSynchronizationN. (diff) | |
| download | yuzu-0cfb231e002629172337c048e8cabc8c653e34e3.tar.gz yuzu-0cfb231e002629172337c048e8cabc8c653e34e3.tar.xz yuzu-0cfb231e002629172337c048e8cabc8c653e34e3.zip | |
SVC: Replace GetPointer usage with Read32 in ReplyAndReceive.
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/function_wrappers.h | 5 | ||||
| -rw-r--r-- | src/core/hle/svc.cpp | 8 |
2 files changed, 6 insertions, 7 deletions
diff --git a/src/core/hle/function_wrappers.h b/src/core/hle/function_wrappers.h index 17892d81c..cd500e83d 100644 --- a/src/core/hle/function_wrappers.h +++ b/src/core/hle/function_wrappers.h | |||
| @@ -69,11 +69,10 @@ void Wrap() { | |||
| 69 | FuncReturn(retval); | 69 | FuncReturn(retval); |
| 70 | } | 70 | } |
| 71 | 71 | ||
| 72 | template <ResultCode func(s32*, u32*, s32, u32)> | 72 | template <ResultCode func(s32*, VAddr, s32, u32)> |
| 73 | void Wrap() { | 73 | void Wrap() { |
| 74 | s32 param_1 = 0; | 74 | s32 param_1 = 0; |
| 75 | u32 retval = | 75 | u32 retval = func(¶m_1, PARAM(1), (s32)PARAM(2), PARAM(3)).raw; |
| 76 | func(¶m_1, (Kernel::Handle*)Memory::GetPointer(PARAM(1)), (s32)PARAM(2), PARAM(3)).raw; | ||
| 77 | 76 | ||
| 78 | Core::CPU().SetReg(1, (u32)param_1); | 77 | Core::CPU().SetReg(1, (u32)param_1); |
| 79 | FuncReturn(retval); | 78 | FuncReturn(retval); |
diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp index 9edce7ab7..61360bede 100644 --- a/src/core/hle/svc.cpp +++ b/src/core/hle/svc.cpp | |||
| @@ -452,10 +452,9 @@ static ResultCode WaitSynchronizationN(s32* out, VAddr handles_address, s32 hand | |||
| 452 | } | 452 | } |
| 453 | 453 | ||
| 454 | /// In a single operation, sends a IPC reply and waits for a new request. | 454 | /// In a single operation, sends a IPC reply and waits for a new request. |
| 455 | static ResultCode ReplyAndReceive(s32* index, Kernel::Handle* handles, s32 handle_count, | 455 | static ResultCode ReplyAndReceive(s32* index, VAddr handles_address, s32 handle_count, |
| 456 | Kernel::Handle reply_target) { | 456 | Kernel::Handle reply_target) { |
| 457 | // 'handles' has to be a valid pointer even if 'handle_count' is 0. | 457 | if (!Memory::IsValidVirtualAddress(handles_address)) |
| 458 | if (handles == nullptr) | ||
| 459 | return Kernel::ERR_INVALID_POINTER; | 458 | return Kernel::ERR_INVALID_POINTER; |
| 460 | 459 | ||
| 461 | // Check if 'handle_count' is invalid | 460 | // Check if 'handle_count' is invalid |
| @@ -466,7 +465,8 @@ static ResultCode ReplyAndReceive(s32* index, Kernel::Handle* handles, s32 handl | |||
| 466 | std::vector<ObjectPtr> objects(handle_count); | 465 | std::vector<ObjectPtr> objects(handle_count); |
| 467 | 466 | ||
| 468 | for (int i = 0; i < handle_count; ++i) { | 467 | for (int i = 0; i < handle_count; ++i) { |
| 469 | auto object = Kernel::g_handle_table.Get<Kernel::WaitObject>(handles[i]); | 468 | Kernel::Handle handle = Memory::Read32(handles_address + i * sizeof(Kernel::Handle)); |
| 469 | auto object = Kernel::g_handle_table.Get<Kernel::WaitObject>(handle); | ||
| 470 | if (object == nullptr) | 470 | if (object == nullptr) |
| 471 | return ERR_INVALID_HANDLE; | 471 | return ERR_INVALID_HANDLE; |
| 472 | objects[i] = object; | 472 | objects[i] = object; |