summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Zammit <damien@zamaudio.com>2021-03-26 20:48:48 +1100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2021-03-27 16:22:39 +0100
commit3097056b5091131b44591c849730d13fd6cca90a (patch)
treee4d591557e710a951286d8fe2eff4fd76c543905
parent70155c3a8a657994ad3f80697d3beb1365acde51 (diff)
clock: Let timer proceed even before we have set threads
Message-Id: <20210326094850.2606-4-damien@zamaudio.com>
-rw-r--r--kern/mach_clock.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/kern/mach_clock.c b/kern/mach_clock.c
index e4d44f57..3a568647 100644
--- a/kern/mach_clock.c
+++ b/kern/mach_clock.c
@@ -152,7 +152,9 @@ void clock_interrupt(
timer_bump(&thread->user_timer, usec);
}
else {
- timer_bump(&thread->system_timer, usec);
+ /* Only bump timer if threads are initialized */
+ if (thread)
+ timer_bump(&thread->system_timer, usec);
}
#endif /* STAT_TIME */
@@ -189,6 +191,7 @@ void clock_interrupt(
if (usermode)
#endif
{
+ if (thread)
take_pc_sample_macro(thread, SAMPLED_PC_PERIODIC, usermode, pc);
}
#endif /* MACH_PCSAMPLE */