Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/xscale Fix shadowed use of hz, and attempts to ...



details:   https://anonhg.NetBSD.org/src/rev/236add72d939
branches:  trunk
changeset: 581736:236add72d939
user:      rearnsha <rearnsha%NetBSD.org@localhost>
date:      Sat Jun 04 14:00:18 2005 +0000

description:
Fix shadowed use of hz, and attempts to cast away volatile on time.

diffstat:

 sys/arch/arm/xscale/becc_timer.c |  18 +++++++++++-------
 1 files changed, 11 insertions(+), 7 deletions(-)

diffs (72 lines):

diff -r 50b85e31ea7b -r 236add72d939 sys/arch/arm/xscale/becc_timer.c
--- a/sys/arch/arm/xscale/becc_timer.c  Sat Jun 04 13:48:35 2005 +0000
+++ b/sys/arch/arm/xscale/becc_timer.c  Sat Jun 04 14:00:18 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: becc_timer.c,v 1.6 2005/02/26 12:00:52 simonb Exp $    */
+/*     $NetBSD: becc_timer.c,v 1.7 2005/06/04 14:00:18 rearnsha Exp $  */
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: becc_timer.c,v 1.6 2005/02/26 12:00:52 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: becc_timer.c,v 1.7 2005/06/04 14:00:18 rearnsha Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -178,7 +178,7 @@
  *     recalculate the intervals here, but that would be a pain.
  */
 void
-setstatclockrate(int hz)
+setstatclockrate(int new_hz)
 {
 
        /*
@@ -291,6 +291,7 @@
 void
 inittodr(time_t base)
 {
+       struct timeval tv;
        time_t deltat;
        int badbase;
 
@@ -303,8 +304,7 @@
                badbase = 0;
 
        if (todr_handle == NULL ||
-           todr_gettime(todr_handle, (struct timeval *)&time) != 0 ||
-           time.tv_sec == 0) {
+           todr_gettime(todr_handle, &tv) != 0 || tv.tv_sec == 0) {
                /*
                 * Believe the time in the file system for lack of
                 * anything better, resetting the TODR.
@@ -316,6 +316,8 @@
                        resettodr();
                }
                goto bad;
+       } else {
+               time = tv;
        }
 
        if (!badbase) {
@@ -344,13 +346,15 @@
 void
 resettodr(void)
 {
+       struct timeval tv;
 
        if (time.tv_sec == 0)
                return;
 
-       if (todr_handle != NULL &&
-           todr_settime(todr_handle, (struct timeval *)&time) != 0)
+       if (todr_handle != NULL && todr_settime(todr_handle, &tv) != 0)
                printf("resettodr: failed to set time\n");
+       else
+               time = tv;
 }
 
 /*



Home | Main Index | Thread Index | Old Index