Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Dec 2023 08:23:06 GMT
From:      Vladimir Kondratyev <wulf@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: e964da141523 - main - LinuxKPI: Add ktime_get_raw_fast_ns() to linux/ktime.h
Message-ID:  <202312240823.3BO8N65N087083@gitrepo.freebsd.org>

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

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

commit e964da141523e1eec2322082936cdb20ba0cf4a7
Author:     Vladimir Kondratyev <wulf@FreeBSD.org>
AuthorDate: 2023-12-24 08:19:59 +0000
Commit:     Vladimir Kondratyev <wulf@FreeBSD.org>
CommitDate: 2023-12-24 08:19:59 +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
---
 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?202312240823.3BO8N65N087083>