kern/KScheduler: implement special yields

This commit is contained in:
Michael Scire
2020-07-11 00:48:26 -07:00
parent ca9327a120
commit 4a7ce9dd75
3 changed files with 179 additions and 3 deletions

View File

@@ -185,6 +185,8 @@ namespace ams::kern {
constexpr KProcessAddress GetProcessLocalRegionAddress() const { return this->plr_address; }
void AddCpuTime(s64 diff) { this->cpu_time += diff; }
constexpr s64 GetScheduledCount() const { return this->schedule_count; }
void IncrementScheduledCount() { ++this->schedule_count; }
void IncrementThreadCount();

View File

@@ -349,6 +349,9 @@ namespace ams::kern {
constexpr s64 GetLastScheduledTick() const { return this->last_scheduled_tick; }
constexpr void SetLastScheduledTick(s64 tick) { this->last_scheduled_tick = tick; }
constexpr s64 GetYieldScheduleCount() const { return this->schedule_count; }
constexpr void SetYieldScheduleCount(s64 count) { this->schedule_count = count; }
constexpr KProcess *GetOwnerProcess() const { return this->parent; }
constexpr bool IsUserThread() const { return this->parent != nullptr; }