Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sparc/sparc use local junk variables instead of a g...



details:   https://anonhg.NetBSD.org/src/rev/c783b048c3a2
branches:  trunk
changeset: 588129:c783b048c3a2
user:      macallan <macallan%NetBSD.org@localhost>
date:      Wed Feb 08 22:17:18 2006 +0000

description:
use local junk variables instead of a global one

diffstat:

 sys/arch/sparc/sparc/timer_msiiep.c |  13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diffs (56 lines):

diff -r 443c7279f8c9 -r c783b048c3a2 sys/arch/sparc/sparc/timer_msiiep.c
--- a/sys/arch/sparc/sparc/timer_msiiep.c       Wed Feb 08 21:52:36 2006 +0000
+++ b/sys/arch/sparc/sparc/timer_msiiep.c       Wed Feb 08 22:17:18 2006 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: timer_msiiep.c,v 1.18 2006/02/08 17:56:55 macallan Exp $       */
+/*     $NetBSD: timer_msiiep.c,v 1.19 2006/02/08 22:17:18 macallan Exp $       */
 
 /*
  * Copyright (c) 1992, 1993
@@ -58,7 +58,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: timer_msiiep.c,v 1.18 2006/02/08 17:56:55 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: timer_msiiep.c,v 1.19 2006/02/08 22:17:18 macallan Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -93,7 +93,6 @@
  * counter is reset to 1 when new limit is written.
  */
 #define        tmr_ustolimIIep(n)      ((n) * 25 + 1)
-uint32_t junk;
 
 static int
 timermatch_msiiep(struct device *parent, struct cfdata *cf, void *aux)
@@ -123,7 +122,9 @@
         */
        for (timerblurb = 1; ; ++timerblurb) {
                int t;
+               volatile uint32_t junk;
 
+               /* we need 'junk' to keep the read from getting eliminated */
                junk = mspcic_read_4(pcic_pclr); /* clear the limit bit */
                mspcic_write_4(pcic_pclr, 0); /* reset to 1, free run */
                delay(100);
@@ -179,7 +180,8 @@
 static int
 clockintr_msiiep(void *cap)
 {
-
+       volatile uint32_t junk;
+       
        junk = mspcic_read_4(pcic_sclr); /* clear the interrupt */
        hardclock((struct clockframe *)cap);
        return (1);
@@ -194,7 +196,8 @@
 {
        struct clockframe *frame = cap;
        u_long newint;
-
+       volatile uint32_t junk;
+       
        junk = mspcic_read_4(pcic_pclr); /* clear the interrupt */
 
        statclock(frame);



Home | Main Index | Thread Index | Old Index