Kernel: Implement CLOCK_{PROCESS,THREAD}_CPUTIME_ID

This commit is contained in:
2025-06-26 13:38:50 +03:00
parent 4fa40de557
commit 83c0ef3514
5 changed files with 63 additions and 4 deletions

View File

@@ -382,6 +382,9 @@ namespace Kernel
}
}
if (!scheduler().is_idle())
Thread::current().set_cpu_time_stop();
#if ARCH(x86_64)
asm volatile(
"movq %%rsp, %%rcx;"
@@ -412,6 +415,9 @@ namespace Kernel
processor_info.m_start_ns = SystemTimer::get().ns_since_boot();
if (!scheduler().is_idle())
Thread::current().set_cpu_time_start();
Processor::set_interrupt_state(state);
}