summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-01-29 11:29:22 +0000
committerphk <phk@FreeBSD.org>2003-01-29 11:29:22 +0000
commit13e0104093cd42571839d9306eaa407ea60dbe4e (patch)
tree96535f7d70e9000f66a44f3658200b49db882ffd
parent6284753cacd2c35b53f3bc80834127aefbc758e4 (diff)
downloadFreeBSD-src-13e0104093cd42571839d9306eaa407ea60dbe4e.zip
FreeBSD-src-13e0104093cd42571839d9306eaa407ea60dbe4e.tar.gz
Move timecounters notion of frequency to 64 bits.
[WARNING: CPUs in the distant future may be closer than they appear!]
-rw-r--r--sys/kern/kern_tc.c7
-rw-r--r--sys/sys/timetc.h4
2 files changed, 6 insertions, 5 deletions
diff --git a/sys/kern/kern_tc.c b/sys/kern/kern_tc.c
index 93b50a0..44d8986 100644
--- a/sys/kern/kern_tc.c
+++ b/sys/kern/kern_tc.c
@@ -12,6 +12,7 @@
#include "opt_ntp.h"
#include <sys/param.h>
+#include <sys/stdint.h>
#include <sys/kernel.h>
#include <sys/sysctl.h>
#include <sys/systm.h>
@@ -282,8 +283,8 @@ tc_init(struct timecounter *tc)
{
unsigned u;
- printf("Timecounter \"%s\" frequency %lu Hz",
- tc->tc_name, (u_long)tc->tc_frequency);
+ printf("Timecounter \"%s\" frequency %ju Hz",
+ tc->tc_name, (intmax_t)tc->tc_frequency);
u = tc->tc_frequency / tc->tc_counter_mask;
if (u > hz) {
@@ -299,7 +300,7 @@ tc_init(struct timecounter *tc)
}
/* Report the frequency of the current timecounter. */
-u_int32_t
+u_int64_t
tc_getfrequency(void)
{
diff --git a/sys/sys/timetc.h b/sys/sys/timetc.h
index f0d70d5..bc6a472 100644
--- a/sys/sys/timetc.h
+++ b/sys/sys/timetc.h
@@ -47,7 +47,7 @@ struct timecounter {
*/
u_int tc_counter_mask;
/* This mask should mask off any unimplemented bits. */
- u_int32_t tc_frequency;
+ u_int64_t tc_frequency;
/* Frequency of the counter in Hz. */
char *tc_name;
/* Name of the timecounter. */
@@ -59,7 +59,7 @@ struct timecounter {
extern struct timecounter *timecounter;
-u_int32_t tc_getfrequency(void);
+u_int64_t tc_getfrequency(void);
void tc_init(struct timecounter *tc);
void tc_setclock(struct timespec *ts);
void tc_ticktock(void);
OpenPOWER on IntegriCloud