Compare commits

...

1 Commits

Author SHA1 Message Date
Luke Street
2c53402dd4 svc: Return success from SleepThread 2018-12-04 02:42:40 -05:00
2 changed files with 8 additions and 7 deletions

View File

@@ -1171,13 +1171,13 @@ static void ExitThread() {
}
/// Sleep the current thread
static void SleepThread(s64 nanoseconds) {
static ResultCode SleepThread(s64 nanoseconds) {
LOG_TRACE(Kernel_SVC, "called nanoseconds={}", nanoseconds);
// Don't attempt to yield execution if there are no available threads to run,
// this way we avoid a useless reschedule to the idle thread.
if (nanoseconds == 0 && !Core::System::GetInstance().CurrentScheduler().HaveReadyThreads())
return;
return RESULT_SUCCESS;
// Sleep current thread and check for next thread to schedule
WaitCurrentThread_Sleep();
@@ -1186,6 +1186,7 @@ static void SleepThread(s64 nanoseconds) {
GetCurrentThread()->WakeAfterDelay(nanoseconds);
Core::System::GetInstance().PrepareReschedule();
return RESULT_SUCCESS;
}
/// Wait process wide key atomic

View File

@@ -33,6 +33,11 @@ void SvcWrap() {
FuncReturn(func(Param(0)).raw);
}
template <ResultCode func(s64)>
void SvcWrap() {
FuncReturn(func(static_cast<s64>(Param(0))).raw);
}
template <ResultCode func(u32)>
void SvcWrap() {
FuncReturn(func(static_cast<u32>(Param(0))).raw);
@@ -248,11 +253,6 @@ void SvcWrap() {
func();
}
template <void func(s64)>
void SvcWrap() {
func(static_cast<s64>(Param(0)));
}
template <void func(u64, u64 len)>
void SvcWrap() {
func(Param(0), Param(1));