From 3dc772aeedfdf4921ced1599b4f9cc33a4506e42 Mon Sep 17 00:00:00 2001 From: Seung-Woo Kim Date: Wed, 1 Jul 2020 11:05:44 +0900 Subject: [PATCH] Support Linux kernel v5.4 To support rpi4 kernel based on Linux kernel v5.4, add wrapper for changed function name. With the Linux mainline commit 9285ec4c8b61 ("timekeeping: Use proper clock specifier names in functions") in v5.3, function ktime_get_boot_ns() is changed to ktime_get_boottime_ns(). Change-Id: I80e00592adea9e888daaef035f2332e5e7528eef Ref: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9285ec4c8b61d4930a575081abeba2cd4f449a74 Signed-off-by: Seung-Woo Kim --- kernel/proc-tsm.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/kernel/proc-tsm.c b/kernel/proc-tsm.c index a23ec38..e86ec82 100644 --- a/kernel/proc-tsm.c +++ b/kernel/proc-tsm.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -48,6 +49,13 @@ static int blacklist_c = 0; module_param_array(blacklist, charp, &blacklist_c, 0000); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0) +/* ktime_get_boot_ns() is renamed to ktime_get_boottime_ns() from v5.3 */ +static inline u64 ktime_get_boot_ns(void) { + return ktime_get_boottime_ns(); +} +#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0) */ + static u64 time_now(void) { return div64_ul(ktime_get_boot_ns(), NSEC_PER_USEC); -- 2.34.1