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 Delay initialization of FPU related eve...



details:   https://anonhg.NetBSD.org/src/rev/240d58f389a3
branches:  trunk
changeset: 764308:240d58f389a3
user:      martin <martin%NetBSD.org@localhost>
date:      Fri Apr 15 20:52:36 2011 +0000

description:
Delay initialization of FPU related event counters to cpu_startup() - we
do not expect any events of this type before spinup of all cpus.

diffstat:

 sys/arch/alpha/alpha/machdep.c |  13 +++++++++++--
 sys/arch/alpha/alpha/trap.c    |  15 ++-------------
 2 files changed, 13 insertions(+), 15 deletions(-)

diffs (77 lines):

diff -r 463e66994564 -r 240d58f389a3 sys/arch/alpha/alpha/machdep.c
--- a/sys/arch/alpha/alpha/machdep.c    Fri Apr 15 19:41:11 2011 +0000
+++ b/sys/arch/alpha/alpha/machdep.c    Fri Apr 15 20:52:36 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.330 2011/03/04 22:25:24 joerg Exp $ */
+/* $NetBSD: machdep.c,v 1.331 2011/04/15 20:52:36 martin Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.330 2011/03/04 22:25:24 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.331 2011/04/15 20:52:36 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -803,6 +803,7 @@
 void
 cpu_startup(void)
 {
+       extern struct evcnt fpevent_use, fpevent_reuse;
        vaddr_t minaddr, maxaddr;
        char pbuf[9];
 #if defined(DEBUG)
@@ -865,6 +866,14 @@
         * CPUs.
         */
        hwrpb_primary_init();
+
+       /*
+        * Initialize some trap event counters.
+        */
+       evcnt_attach_dynamic(&fpevent_use, EVCNT_TYPE_MISC, NULL,
+           "FP", "proc use");
+       evcnt_attach_dynamic(&fpevent_reuse, EVCNT_TYPE_MISC, NULL,
+           "FP", "proc re-use");
 }
 
 /*
diff -r 463e66994564 -r 240d58f389a3 sys/arch/alpha/alpha/trap.c
--- a/sys/arch/alpha/alpha/trap.c       Fri Apr 15 19:41:11 2011 +0000
+++ b/sys/arch/alpha/alpha/trap.c       Fri Apr 15 20:52:36 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.124 2010/12/20 00:25:24 matt Exp $ */
+/* $NetBSD: trap.c,v 1.125 2011/04/15 20:52:36 martin Exp $ */
 
 /*-
  * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@@ -93,7 +93,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.124 2010/12/20 00:25:24 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.125 2011/04/15 20:52:36 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -149,17 +149,6 @@
         */
        alpha_pal_wrmces(alpha_pal_rdmces() &
            ~(ALPHA_MCES_DSC|ALPHA_MCES_DPC));
-
-       /*
-        * If this is the primary processor, initialize some trap
-        * event counters.
-        */
-       if (cpu_number() == hwrpb->rpb_primary_cpu_id) {
-               evcnt_attach_dynamic(&fpevent_use, EVCNT_TYPE_MISC, NULL,
-                   "FP", "proc use");
-               evcnt_attach_dynamic(&fpevent_reuse, EVCNT_TYPE_MISC, NULL,
-                   "FP", "proc re-use");
-       }
 }
 
 static void



Home | Main Index | Thread Index | Old Index