summaryrefslogtreecommitdiff
path: root/pfinet/mapped-time.h
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1995-08-09 16:49:05 +0000
committerMichael I. Bushnell <mib@gnu.org>1995-08-09 16:49:05 +0000
commit0e1c60661f6ff504aaa4e37a0f75ff3db9dcb86e (patch)
treef4b3370afa983f5d4296a7bcf81862a5a2c85283 /pfinet/mapped-time.h
parent6c8a9ee254197348539ab8e70f866651350fe4c5 (diff)
Initial revision
Diffstat (limited to 'pfinet/mapped-time.h')
-rw-r--r--pfinet/mapped-time.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/pfinet/mapped-time.h b/pfinet/mapped-time.h
new file mode 100644
index 00000000..d0fccee8
--- /dev/null
+++ b/pfinet/mapped-time.h
@@ -0,0 +1,40 @@
+#ifndef _MAPPED_TIME_H_
+#define _MAPPED_TIME_H_
+
+#define HZ 100
+
+extern volatile struct mapped_time_value *mapped_time;
+
+extern inline int
+read_mapped_secs ()
+{
+ return mapped_time->seconds;
+}
+
+extern inline void
+fill_timeval (struct timeval *tp)
+{
+ do
+ {
+ tp->tv_secs = mapped_time->seconds;
+ tp->tv_usecs = mapped_time->microseconds;
+ }
+ while (tp->tv_secs != mapped_time->check_seconds);
+}
+
+extern inline int
+fetch_jiffies ()
+{
+ int secs, usecs;
+ do
+ {
+ secs = mapped_time->seconds;
+ usecs = mapped_time->microseconds;
+ }
+ while (secs != mapped_time->check_seconds);
+
+ return (secs * HZ) + microseconds * HZ / 1000.0;
+}
+
+
+#endif