Kernel: Implement CLOCK_{PROCESS,THREAD}_CPUTIME_ID
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user