kern: update KHardwareTimer, move out of KCoreLocalRegion

This commit is contained in:
Michael Scire 2020-12-01 07:47:29 -08:00 committed by SciresM
parent 5cb237d030
commit bee629b8ad
5 changed files with 27 additions and 47 deletions

View file

@ -74,6 +74,7 @@ namespace ams::kern {
static KUnsafeMemory s_unsafe_memory;
static KWorkerTaskManager s_worker_task_managers[KWorkerTaskManager::WorkerType_Count];
static KInterruptManager s_interrupt_manager;
static KHardwareTimer s_hardware_timers[cpu::NumCores];
private:
static ALWAYS_INLINE KCoreLocalContext &GetCoreLocalContext() {
return reinterpret_cast<KCoreLocalRegion *>(cpu::GetCoreLocalRegionAddress())->current.context;
@ -114,7 +115,11 @@ namespace ams::kern {
}
static ALWAYS_INLINE KHardwareTimer &GetHardwareTimer() {
return GetCoreLocalContext(GetCurrentCoreId()).hardware_timer;
return s_hardware_timers[GetCurrentCoreId()];
}
static ALWAYS_INLINE KHardwareTimer &GetHardwareTimer(s32 core_id) {
return s_hardware_timers[core_id];
}
static ALWAYS_INLINE KResourceLimit &GetSystemResourceLimit() {