Module Name: src
Committed By: martin
Date: Tue Feb 21 15:41:24 UTC 2012
Modified Files:
src/sys/kern: kern_tc.c
src/sys/sys: timevar.h
Log Message:
Make time_second and time_uptime volatile, so the compiler knows they
may change during loops. Fixes the macppc build, which previously
died with:
src/sys/arch/macppc/dev/dbdma.c:62:6: error: assuming signed overflow does not
occur when assuming that (X + c) < X is always false
To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/kern/kern_tc.c
cvs rdiff -u -r1.30 -r1.31 src/sys/sys/timevar.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/kern/kern_tc.c
diff -u src/sys/kern/kern_tc.c:1.42 src/sys/kern/kern_tc.c:1.43
--- src/sys/kern/kern_tc.c:1.42 Tue Apr 13 22:46:10 2010
+++ src/sys/kern/kern_tc.c Tue Feb 21 15:41:24 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_tc.c,v 1.42 2010/04/13 22:46:10 pooka Exp $ */
+/* $NetBSD: kern_tc.c,v 1.43 2012/02/21 15:41:24 martin Exp $ */
/*-
* Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
#include <sys/cdefs.h>
/* __FBSDID("$FreeBSD: src/sys/kern/kern_tc.c,v 1.166 2005/09/19 22:16:31 andre Exp $"); */
-__KERNEL_RCSID(0, "$NetBSD: kern_tc.c,v 1.42 2010/04/13 22:46:10 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_tc.c,v 1.43 2012/02/21 15:41:24 martin Exp $");
#ifdef _KERNEL_OPT
#include "opt_ntp.h"
@@ -126,8 +126,8 @@ static struct timehands *volatile timeha
struct timecounter *timecounter = &dummy_timecounter;
static struct timecounter *timecounters = &dummy_timecounter;
-time_t time_second = 1;
-time_t time_uptime = 1;
+volatile time_t time_second = 1;
+volatile time_t time_uptime = 1;
static struct bintime timebasebin;
Index: src/sys/sys/timevar.h
diff -u src/sys/sys/timevar.h:1.30 src/sys/sys/timevar.h:1.31
--- src/sys/sys/timevar.h:1.30 Sun Dec 18 22:30:25 2011
+++ src/sys/sys/timevar.h Tue Feb 21 15:41:24 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: timevar.h,v 1.30 2011/12/18 22:30:25 christos Exp $ */
+/* $NetBSD: timevar.h,v 1.31 2012/02/21 15:41:24 martin Exp $ */
/*
* Copyright (c) 2005, 2008 The NetBSD Foundation.
@@ -184,7 +184,7 @@ void time_init(void);
void time_init2(void);
bool time_wraps(struct timespec *, struct timespec *);
-extern time_t time_second; /* current second in the epoch */
-extern time_t time_uptime; /* system uptime in seconds */
+extern volatile time_t time_second; /* current second in the epoch */
+extern volatile time_t time_uptime; /* system uptime in seconds */
#endif /* !_SYS_TIMEVAR_H_ */