Module Name:    src
Committed By:   thorpej
Date:           Tue Sep 29 01:20:59 UTC 2020

Modified Files:
        src/sys/arch/alpha/alpha: mcclock.c

Log Message:
mcclock_init(): Only do our work if called on the primary CPU.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/alpha/alpha/mcclock.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/alpha/alpha/mcclock.c
diff -u src/sys/arch/alpha/alpha/mcclock.c:1.18 src/sys/arch/alpha/alpha/mcclock.c:1.19
--- src/sys/arch/alpha/alpha/mcclock.c:1.18	Mon Nov 21 19:50:37 2011
+++ src/sys/arch/alpha/alpha/mcclock.c	Tue Sep 29 01:20:59 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: mcclock.c,v 1.18 2011/11/21 19:50:37 christos Exp $ */
+/* $NetBSD: mcclock.c,v 1.19 2020/09/29 01:20:59 thorpej Exp $ */
 
 /*
  * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@@ -29,7 +29,7 @@
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: mcclock.c,v 1.18 2011/11/21 19:50:37 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mcclock.c,v 1.19 2020/09/29 01:20:59 thorpej Exp $");
 
 #include "opt_clock_compat_osf1.h"
 
@@ -37,6 +37,7 @@ __KERNEL_RCSID(0, "$NetBSD: mcclock.c,v 
 #include <sys/kernel.h>
 #include <sys/systm.h>
 #include <sys/device.h>
+#include <sys/lwp.h>
 
 #include <sys/bus.h>
 #include <machine/cpu_counter.h>
@@ -136,6 +137,11 @@ mcclock_init(void *dev)
 {
 	struct mc146818_softc *sc = dev;
 
+	/* Only do this on the primary CPU. */
+	if (! CPU_IS_PRIMARY(curcpu())) {
+		return;
+	}
+
 	/* enable interval clock interrupt */
 	(*sc->sc_mcwrite)(sc, MC_REGA, MC_BASE_32_KHz | MC_RATE_1024_Hz);
 	(*sc->sc_mcwrite)(sc, MC_REGB,

Reply via email to