Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/alpha/alpha mcclock_init(): Only do our work if cal...



details:   https://anonhg.NetBSD.org/src/rev/13731dbd36ab
branches:  trunk
changeset: 1014692:13731dbd36ab
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Tue Sep 29 01:20:59 2020 +0000

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

diffstat:

 sys/arch/alpha/alpha/mcclock.c |  10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diffs (38 lines):

diff -r 890557145469 -r 13731dbd36ab sys/arch/alpha/alpha/mcclock.c
--- a/sys/arch/alpha/alpha/mcclock.c    Tue Sep 29 01:19:52 2020 +0000
+++ b/sys/arch/alpha/alpha/mcclock.c    Tue Sep 29 01:20:59 2020 +0000
@@ -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 @@
 #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 @@
 {
        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,



Home | Main Index | Thread Index | Old Index