Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Feb 2024 21:33:00 GMT
From:      Vladimir Kondratyev <wulf@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: f3ce597171f0 - stable/14 - LinuxKPI: Add ktime_get_raw_fast_ns() to linux/ktime.h
Message-ID:  <202402172133.41HLX0UF020812@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/14 has been updated by wulf:

URL: https://cgit.FreeBSD.org/src/commit/?id=f3ce597171f0ed441f40df534555ee4493d6a728

commit f3ce597171f0ed441f40df534555ee4493d6a728
Author:     Vladimir Kondratyev <wulf@FreeBSD.org>
AuthorDate: 2023-12-24 08:19:59 +0000
Commit:     Vladimir Kondratyev <wulf@FreeBSD.org>
CommitDate: 2024-02-17 20:58:37 +0000

    LinuxKPI: Add ktime_get_raw_fast_ns() to linux/ktime.h
    
    It is implemented like ktime_get_raw_ns() function but uses less
    precise getnanouptime() call.
    
    Sponsored by:   Serenity Cyber Security, LLC
    Reviewed by:    manu, bz
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D42804
    
    (cherry picked from commit e964da141523e1eec2322082936cdb20ba0cf4a7)
---
 sys/compat/linuxkpi/common/include/linux/ktime.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/sys/compat/linuxkpi/common/include/linux/ktime.h b/sys/compat/linuxkpi/common/include/linux/ktime.h
index ae270d2ebd06..b13c7182bc61 100644
--- a/sys/compat/linuxkpi/common/include/linux/ktime.h
+++ b/sys/compat/linuxkpi/common/include/linux/ktime.h
@@ -262,4 +262,13 @@ ktime_get_raw_ns(void)
 	return (ktime_to_ns(timespec_to_ktime(ts)));
 }
 
+static inline uint64_t
+ktime_get_raw_fast_ns(void)
+{
+	struct timespec ts;
+
+	getnanouptime(&ts);
+	return (ktime_to_ns(timespec_to_ktime(ts)));
+}
+
 #endif /* _LINUXKPI_LINUX_KTIME_H */



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