summaryrefslogtreecommitdiff
path: root/pfinet/mapped-time.h
diff options
context:
space:
mode:
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;
}