Date: Sun, 9 Jul 2017 23:13:08 +0000 (UTC) From: Mark Johnston <markj@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320853 - head/sys/compat/linuxkpi/common/include/linux Message-ID: <201707092313.v69ND8WA050950@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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 */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201707092313.v69ND8WA050950>