From 3097056b5091131b44591c849730d13fd6cca90a Mon Sep 17 00:00:00 2001 From: Damien Zammit Date: Fri, 26 Mar 2021 20:48:48 +1100 Subject: clock: Let timer proceed even before we have set threads Message-Id: <20210326094850.2606-4-damien@zamaudio.com> --- kern/mach_clock.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'kern') 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 */ -- cgit v1.2.3