aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/kern_clock.c
diff options
context:
space:
mode:
authorNathan Whitehorn <nwhitehorn@FreeBSD.org>2017-11-25 23:41:05 +0000
committerNathan Whitehorn <nwhitehorn@FreeBSD.org>2017-11-25 23:41:05 +0000
commitefe67753ccbbbba0013dac241c79d2dc124d76a2 (patch)
tree4be85fd57c569410684dbdb83ad09998aa8530c4 /sys/kern/kern_clock.c
parent91419bdafdfee515afb4e20e5c92035cc19074bb (diff)
downloadsrc-efe67753ccbbbba0013dac241c79d2dc124d76a2.tar.gz
src-efe67753ccbbbba0013dac241c79d2dc124d76a2.zip
Remove some, but not all, assumptions that the BSP is CPU 0 and that CPUs
are numbered densely from there to n_cpus. MFC after: 1 month
Notes
Notes: svn path=/head/; revision=326218
Diffstat (limited to 'sys/kern/kern_clock.c')
-rw-r--r--sys/kern/kern_clock.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c
index 396f98fbd413..509885d2cd62 100644
--- a/sys/kern/kern_clock.c
+++ b/sys/kern/kern_clock.c
@@ -573,7 +573,9 @@ hardclock_cnt(int cnt, int usermode)
void
hardclock_sync(int cpu)
{
- int *t = DPCPU_ID_PTR(cpu, pcputicks);
+ int *t;
+ KASSERT(!CPU_ABSENT(cpu), ("Absent CPU %d", cpu));
+ t = DPCPU_ID_PTR(cpu, pcputicks);
*t = ticks;
}