Date: Thu, 16 Aug 2018 08:08:30 +0000 (UTC) From: Hans Petter Selasky <hselasky@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337894 - stable/11/sys/compat/linuxkpi/common/include/linux Message-ID: <201808160808.w7G88UdZ015903@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hselasky Date: Thu Aug 16 08:08:30 2018 New Revision: 337894 URL: https://svnweb.freebsd.org/changeset/base/337894 Log: MFC r337232: Implement ktime_add_ms() and ktime_before() in the LinuxKPI. Submitted by: Johannes Lundberg <johalun0@gmail.com> Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/ktime.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/ktime.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/ktime.h Thu Aug 16 08:05:04 2018 (r337893) +++ stable/11/sys/compat/linuxkpi/common/include/linux/ktime.h Thu Aug 16 08:08:30 2018 (r337894) @@ -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?201808160808.w7G88UdZ015903>