Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 Aug 2018 09:02:57 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r337232 - head/sys/compat/linuxkpi/common/include/linux
Message-ID:  <201808030902.w7392vWX010808@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Fri Aug  3 09:02:57 2018
New Revision: 337232
URL: https://svnweb.freebsd.org/changeset/base/337232

Log:
  Implement ktime_add_ms() and ktime_before() in the LinuxKPI.
  
  Submitted by:	Johannes Lundberg <johalun0@gmail.com>
  MFC after:	1 week
  Sponsored by:	Mellanox Technologies

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	Fri Aug  3 07:59:29 2018	(r337231)
+++ head/sys/compat/linuxkpi/common/include/linux/ktime.h	Fri Aug  3 09:02:57 2018	(r337232)
@@ -86,6 +86,13 @@ ktime_add_ns(ktime_t kt, int64_t ns)
 }
 
 static inline ktime_t
+ktime_add_ms(ktime_t kt, int64_t ms)
+{
+
+	return (ktime_add_ns(kt, ms * NSEC_PER_MSEC));
+}
+
+static inline ktime_t
 ktime_sub_ns(ktime_t kt, int64_t ns)
 {
 	return (kt - ns);
@@ -144,6 +151,13 @@ ktime_after(const ktime_t cmp1, const ktime_t cmp2)
 {
 
 	return (ktime_compare(cmp1, cmp2) > 0);
+}
+
+static inline bool
+ktime_before(const ktime_t cmp1, const ktime_t cmp2)
+{
+
+	return (ktime_compare(cmp1, cmp2) < 0);
 }
 
 static inline ktime_t



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201808030902.w7392vWX010808>