Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

timekeeping: Provide ktime_get_ntp_seconds()

ntp_adjtimex() requires access to the actual time keeper per timekeeper
ID. Provide an interface.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/20250519083026.411809421@linutronix.de


+12
+9
kernel/time/timekeeping.c
··· 2627 2627 return ret; 2628 2628 } 2629 2629 2630 + /* 2631 + * Invoked from NTP with the time keeper lock held, so lockless access is 2632 + * fine. 2633 + */ 2634 + long ktime_get_ntp_seconds(unsigned int id) 2635 + { 2636 + return timekeeper_data[id].timekeeper.xtime_sec; 2637 + } 2638 + 2630 2639 #ifdef CONFIG_NTP_PPS 2631 2640 /** 2632 2641 * hardpps() - Accessor function to NTP __hardpps function
+3
kernel/time/timekeeping_internal.h
··· 45 45 unsigned long timekeeper_lock_irqsave(void); 46 46 void timekeeper_unlock_irqrestore(unsigned long flags); 47 47 48 + /* NTP specific interface to access the current seconds value */ 49 + long ktime_get_ntp_seconds(unsigned int id); 50 + 48 51 #endif /* _TIMEKEEPING_INTERNAL_H */