kern: write cpu tick differential to tls +0x108 on thread switch
This commit is contained in:
@@ -270,7 +270,13 @@ namespace ams::kern {
|
||||
m_current_thread = next_thread;
|
||||
|
||||
/* Set the new Thread Local region. */
|
||||
cpu::SwitchThreadLocalRegion(GetInteger(next_thread->GetThreadLocalRegionAddress()));
|
||||
const auto tls_address = GetInteger(next_thread->GetThreadLocalRegionAddress());
|
||||
cpu::SwitchThreadLocalRegion(tls_address);
|
||||
|
||||
/* Update the thread's cpu time differential in TLS, if relevant. */
|
||||
if (tls_address != 0) {
|
||||
static_cast<ams::svc::ThreadLocalRegion *>(next_thread->GetThreadLocalRegionHeapAddress())->thread_cpu_time = next_thread->GetCpuTime() - cur_tick;
|
||||
}
|
||||
}
|
||||
|
||||
void KScheduler::ClearPreviousThread(KThread *thread) {
|
||||
|
||||
Reference in New Issue
Block a user