svn commit: r320853 - head/sys/compat/linuxkpi/common/include/linux
Mark Johnston
markj at FreeBSD.org
Sun Jul 9 23:13:10 UTC 2017
Author: markj
Date: Sun Jul 9 23:13:08 2017
New Revision: 320853
URL: https://svnweb.freebsd.org/changeset/base/320853
Log:
Add a few functions to ktime.h in the LinuxKPI, and fix nearby style.
Reviewed by: hselasky
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D11534
Modified:
head/sys/compat/linuxkpi/common/include/linux/ktime.h
Modified: head/sys/compat/linuxkpi/common/include/linux/ktime.h
==============================================================================
--- head/sys/compat/linuxkpi/common/include/linux/ktime.h Sun Jul 9 22:57:00 2017 (r320852)
+++ head/sys/compat/linuxkpi/common/include/linux/ktime.h Sun Jul 9 23:13:08 2017 (r320853)
@@ -26,8 +26,9 @@
*
* $FreeBSD$
*/
+
#ifndef _LINUX_KTIME_H
-#define _LINUX_KTIME_H
+#define _LINUX_KTIME_H
#include <linux/types.h>
#include <linux/time.h>
@@ -153,7 +154,7 @@ timeval_to_ktime(struct timeval tv)
#define ktime_to_timeval(kt) ns_to_timeval((kt).tv64)
#define ktime_to_ns(kt) ((kt).tv64)
-static inline s64
+static inline int64_t
ktime_get_ns(void)
{
struct timespec ts;
@@ -164,6 +165,8 @@ ktime_get_ns(void)
return (ktime_to_ns(kt));
}
+#define ktime_get_raw_ns() ktime_get_ns()
+
static inline ktime_t
ktime_get(void)
{
@@ -173,4 +176,22 @@ ktime_get(void)
return (timespec_to_ktime(ts));
}
-#endif /* _LINUX_KTIME_H */
+static inline ktime_t
+ktime_get_boottime(void)
+{
+ struct timespec ts;
+
+ nanouptime(&ts);
+ return (timespec_to_ktime(ts));
+}
+
+static inline ktime_t
+ktime_get_real(void)
+{
+ struct timespec ts;
+
+ nanotime(&ts);
+ return (timespec_to_ktime(ts));
+}
+
+#endif /* _LINUX_KTIME_H */
More information about the svn-src-head
mailing list