aboutsummaryrefslogtreecommitdiff
path: root/pfinet/mapped-time.h
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2000-01-29 01:27:31 +0000
committerRoland McGrath <roland@gnu.org>2000-01-29 01:27:31 +0000
commit157a341929576a1867e15ba7d270e1e3cbe3c4a8 (patch)
treec58b872ed1a402c594ca0dd23c8876ef143bf1b0 /pfinet/mapped-time.h
parent1e53886378dbb4ac7a83c1d1ce78833500ec6b62 (diff)
downloadhurd-157a341929576a1867e15ba7d270e1e3cbe3c4a8.tar.gz
hurd-157a341929576a1867e15ba7d270e1e3cbe3c4a8.tar.bz2
hurd-157a341929576a1867e15ba7d270e1e3cbe3c4a8.zip
2000-01-27 Roland McGrath <roland@baalperazim.frob.com>
* mapped-time.h: Include <maptime.h>. (fill_timeval): Function removed. (fetch_jiffies): Use maptime_read. * timer-emul.c (init_time): Use maptime_map and maptime_read. * linux/sched.h (fetch_xtime): Use maptime_read. * linux/time.h (do_gettimeofday): Likewise.
Diffstat (limited to 'pfinet/mapped-time.h')
-rw-r--r--pfinet/mapped-time.h27
1 files changed, 7 insertions, 20 deletions
diff --git a/pfinet/mapped-time.h b/pfinet/mapped-time.h
index 2877f386..bcbfc6d4 100644
--- a/pfinet/mapped-time.h
+++ b/pfinet/mapped-time.h
@@ -1,6 +1,8 @@
#ifndef _MAPPED_TIME_H_
#define _MAPPED_TIME_H_
+#include <maptime.h>
+
#define HZ 100
extern volatile struct mapped_time_value *mapped_time;
@@ -12,30 +14,15 @@ read_mapped_secs ()
return mapped_time->seconds;
}
-extern inline void
-fill_timeval (struct timeval *tp)
-{
- do
- {
- tp->tv_sec = mapped_time->seconds;
- tp->tv_usec = mapped_time->microseconds;
- }
- while (tp->tv_sec != mapped_time->check_seconds);
-}
-
extern inline int
fetch_jiffies ()
{
- int secs, usecs;
+ struct timeval tv;
long long j;
- do
- {
- secs = mapped_time->seconds;
- usecs = mapped_time->microseconds;
- }
- while (secs != mapped_time->check_seconds);
-
- j = (long long) secs * HZ + ((long long) usecs * HZ) / 1000000;
+
+ maptime_read (mapped_time, &tv);
+
+ j = (long long) tv.tv_sec * HZ + ((long long) tv.tv_usec * HZ) / 1000000;
return j - root_jiffies;
}