mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-26 21:36:27 -05:00
WaitSynchronization: Added a result code for invalid result, fixed bug.
This commit is contained in:
parent
68ddaaa2f5
commit
731154f79e
1 changed files with 9 additions and 3 deletions
|
@ -29,6 +29,9 @@ using Kernel::SharedPtr;
|
||||||
|
|
||||||
namespace SVC {
|
namespace SVC {
|
||||||
|
|
||||||
|
/// An invalid result code that is meant to be overwritten when a thread resumes from waiting
|
||||||
|
const ResultCode RESULT_INVALID(0xDEADC0DE);
|
||||||
|
|
||||||
enum ControlMemoryOperation {
|
enum ControlMemoryOperation {
|
||||||
MEMORY_OPERATION_HEAP = 0x00000003,
|
MEMORY_OPERATION_HEAP = 0x00000003,
|
||||||
MEMORY_OPERATION_GSP_HEAP = 0x00010003,
|
MEMORY_OPERATION_GSP_HEAP = 0x00010003,
|
||||||
|
@ -132,10 +135,13 @@ static Result WaitSynchronization1(Handle handle, s64 nano_seconds) {
|
||||||
Kernel::WakeThreadAfterDelay(Kernel::GetCurrentThread(), nano_seconds);
|
Kernel::WakeThreadAfterDelay(Kernel::GetCurrentThread(), nano_seconds);
|
||||||
|
|
||||||
HLE::Reschedule(__func__);
|
HLE::Reschedule(__func__);
|
||||||
} else {
|
|
||||||
object->Acquire();
|
// NOTE: output of this SVC will be set later depending on how the thread resumes
|
||||||
|
return RESULT_INVALID.raw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
object->Acquire();
|
||||||
|
|
||||||
return RESULT_SUCCESS.raw;
|
return RESULT_SUCCESS.raw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -207,7 +213,7 @@ static Result WaitSynchronizationN(s32* out, Handle* handles, s32 handle_count,
|
||||||
HLE::Reschedule(__func__);
|
HLE::Reschedule(__func__);
|
||||||
|
|
||||||
// NOTE: output of this SVC will be set later depending on how the thread resumes
|
// NOTE: output of this SVC will be set later depending on how the thread resumes
|
||||||
return 0xDEADBEEF;
|
return RESULT_INVALID.raw;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Acquire objects if we did not wait...
|
// Acquire objects if we did not wait...
|
||||||
|
|
Loading…
Reference in a new issue