Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/riastradh-drm2]: src/sys/external/bsd/drm2/include/linux Add timespec_to...
details: https://anonhg.NetBSD.org/src/rev/85d59c252c29
branches: riastradh-drm2
changeset: 788163:85d59c252c29
user: riastradh <riastradh%NetBSD.org@localhost>
date: Wed Jul 24 02:31:08 2013 +0000
description:
Add timespec_to_ns and timeval_to_ns to <linux/ktime.h>.
Not quite the right place, but this'll do for now.
diffstat:
sys/external/bsd/drm2/include/linux/ktime.h | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletions(-)
diffs (28 lines):
diff -r 6c328122ecad -r 85d59c252c29 sys/external/bsd/drm2/include/linux/ktime.h
--- a/sys/external/bsd/drm2/include/linux/ktime.h Wed Jul 24 02:30:54 2013 +0000
+++ b/sys/external/bsd/drm2/include/linux/ktime.h Wed Jul 24 02:31:08 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ktime.h,v 1.1.2.1 2013/07/24 02:29:27 riastradh Exp $ */
+/* $NetBSD: ktime.h,v 1.1.2.2 2013/07/24 02:31:08 riastradh Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -79,6 +79,18 @@
return ns_to_ktime(ktime_to_ns(a) - nsec);
}
+static inline int64_t
+timespec_to_ns(struct timespec *t)
+{
+ return (t->tv_sec * 1000000000ul) + t->tv_nsec;
+}
+
+static inline int64_t
+timeval_to_ns(struct timeval *tv)
+{
+ return (tv->tv_sec * 1000000000ul) + (tv->tv_usec * 1000ul);
+}
+
static inline struct timespec
ns_to_timespec(int64_t nsec)
{
Home |
Main Index |
Thread Index |
Old Index