summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Subv2017-10-04 11:40:40 -0500
committerGravatar Subv2017-10-04 12:30:32 -0500
commitb863d6c86043226c8c88749c4e0eecaf9865c569 (patch)
treeb73ef73e6a2f7f7cb7fc0cb9c33ff1f7a5b00291 /src
parentMemory: Remove all GetPointer usages from the GDB stub. (diff)
downloadyuzu-b863d6c86043226c8c88749c4e0eecaf9865c569.tar.gz
yuzu-b863d6c86043226c8c88749c4e0eecaf9865c569.tar.xz
yuzu-b863d6c86043226c8c88749c4e0eecaf9865c569.zip
SVC: Replace GetPointer usage with Read32 in WaitSynchronizationN.
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/function_wrappers.h8
-rw-r--r--src/core/hle/svc.cpp8
2 files changed, 8 insertions, 8 deletions
diff --git a/src/core/hle/function_wrappers.h b/src/core/hle/function_wrappers.h
index 5e6002f4e..17892d81c 100644
--- a/src/core/hle/function_wrappers.h
+++ b/src/core/hle/function_wrappers.h
@@ -58,12 +58,12 @@ void Wrap() {
58 FuncReturn(retval); 58 FuncReturn(retval);
59} 59}
60 60
61template <ResultCode func(s32*, u32*, s32, bool, s64)> 61template <ResultCode func(s32*, VAddr, s32, bool, s64)>
62void Wrap() { 62void Wrap() {
63 s32 param_1 = 0; 63 s32 param_1 = 0;
64 s32 retval = func(&param_1, (Kernel::Handle*)Memory::GetPointer(PARAM(1)), (s32)PARAM(2), 64 s32 retval =
65 (PARAM(3) != 0), (((s64)PARAM(4) << 32) | PARAM(0))) 65 func(&param_1, PARAM(1), (s32)PARAM(2), (PARAM(3) != 0), (((s64)PARAM(4) << 32) | PARAM(0)))
66 .raw; 66 .raw;
67 67
68 Core::CPU().SetReg(1, (u32)param_1); 68 Core::CPU().SetReg(1, (u32)param_1);
69 FuncReturn(retval); 69 FuncReturn(retval);
diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp
index 6be5db13f..9edce7ab7 100644
--- a/src/core/hle/svc.cpp
+++ b/src/core/hle/svc.cpp
@@ -303,12 +303,11 @@ static ResultCode WaitSynchronization1(Kernel::Handle handle, s64 nano_seconds)
303} 303}
304 304
305/// Wait for the given handles to synchronize, timeout after the specified nanoseconds 305/// Wait for the given handles to synchronize, timeout after the specified nanoseconds
306static ResultCode WaitSynchronizationN(s32* out, Kernel::Handle* handles, s32 handle_count, 306static ResultCode WaitSynchronizationN(s32* out, VAddr handles_address, s32 handle_count,
307 bool wait_all, s64 nano_seconds) { 307 bool wait_all, s64 nano_seconds) {
308 Kernel::Thread* thread = Kernel::GetCurrentThread(); 308 Kernel::Thread* thread = Kernel::GetCurrentThread();
309 309
310 // Check if 'handles' is invalid 310 if (!Memory::IsValidVirtualAddress(handles_address))
311 if (handles == nullptr)
312 return Kernel::ERR_INVALID_POINTER; 311 return Kernel::ERR_INVALID_POINTER;
313 312
314 // NOTE: on real hardware, there is no nullptr check for 'out' (tested with firmware 4.4). If 313 // NOTE: on real hardware, there is no nullptr check for 'out' (tested with firmware 4.4). If
@@ -323,7 +322,8 @@ static ResultCode WaitSynchronizationN(s32* out, Kernel::Handle* handles, s32 ha
323 std::vector<ObjectPtr> objects(handle_count); 322 std::vector<ObjectPtr> objects(handle_count);
324 323
325 for (int i = 0; i < handle_count; ++i) { 324 for (int i = 0; i < handle_count; ++i) {
326 auto object = Kernel::g_handle_table.Get<Kernel::WaitObject>(handles[i]); 325 Kernel::Handle handle = Memory::Read32(handles_address + i * sizeof(Kernel::Handle));
326 auto object = Kernel::g_handle_table.Get<Kernel::WaitObject>(handle);
327 if (object == nullptr) 327 if (object == nullptr)
328 return ERR_INVALID_HANDLE; 328 return ERR_INVALID_HANDLE;
329 objects[i] = object; 329 objects[i] = object;