NetBSD-Bugs archive

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

Re: port-alpha/44502: eventcounters initialized too early



The following reply was made to PR port-alpha/44502; it has been noted by GNATS.

From: Martin Husemann <martin%duskware.de@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: port-alpha/44502: eventcounters initialized too early
Date: Wed, 2 Feb 2011 12:56:35 +0100

 --YZ5djTAD1cGYuMQK
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 This patch avoids the problem. OK to commit?
 
 Martin
 
 --YZ5djTAD1cGYuMQK
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename="alpha.patch"
 
 Index: machdep.c
 ===================================================================
 RCS file: /cvsroot/src/sys/arch/alpha/alpha/machdep.c,v
 retrieving revision 1.328
 diff -u -p -r1.328 machdep.c
 --- machdep.c  10 Nov 2010 09:27:21 -0000      1.328
 +++ machdep.c  2 Feb 2011 11:52:35 -0000
 @@ -803,6 +803,7 @@ consinit(void)
  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 @@ cpu_startup(void)
         * 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");
  }
  
  /*
 Index: trap.c
 ===================================================================
 RCS file: /cvsroot/src/sys/arch/alpha/alpha/trap.c,v
 retrieving revision 1.124
 diff -u -p -r1.124 trap.c
 --- trap.c     20 Dec 2010 00:25:24 -0000      1.124
 +++ trap.c     2 Feb 2011 11:52:36 -0000
 @@ -149,17 +149,6 @@ trap_init(void)
         */
        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
 
 --YZ5djTAD1cGYuMQK--
 


Home | Main Index | Thread Index | Old Index