Lines Matching +full:0 +full:- +full:9 +full:a +full:- +full:b
1 /* SPDX-License-Identifier: GPL-2.0 */
6 * Derived from "include/asm-i386/timex.h"
19 #define TOD_UNIX_EPOCH 0x7d91048bca000000ULL
27 __uint128_t tod : 64; /* bits 0-63 of tod clock */
32 __uint128_t eitod : 72; /* epoch index + bits 0-63 tod clock */
36 __uint128_t us : 60; /* micro-seconds */
37 __uint128_t sus : 12; /* sub-microseconds */
71 asm volatile("stcke %0" : "=Q" (*tod) : : "cc"); in store_tod_clock_ext()
76 asm volatile("sckc %0" : : "Q" (time)); in set_clock_comparator()
82 " lgr 0,%[val]\n" in set_tod_programmable_field()
86 : "0"); in set_tod_programmable_field()
96 #define PTFF_QAF 0x00 /* query available functions */
97 #define PTFF_QTO 0x01 /* query tod offset */
98 #define PTFF_QSI 0x02 /* query steering information */
99 #define PTFF_QPT 0x03 /* query physical clock */
100 #define PTFF_QUI 0x04 /* query UTC information */
101 #define PTFF_ATO 0x40 /* adjust tod offset */
102 #define PTFF_STO 0x41 /* set tod offset */
103 #define PTFF_SFS 0x42 /* set fine steering rate */
104 #define PTFF_SGS 0x43 /* set gross steering rate */
119 return (*ptr & (0x80 >> (nr & 7))) != 0; in ptff_query()
139 * ptff - Perform timing facility function
143 * Returns: Condition code (0 on success)
153 " lgr 0,%[reg0]\n" \
159 : CC_CLOBBER_LIST("0", "1")); \
167 old = get_lowcore()->clock_comparator; in local_tick_disable()
168 get_lowcore()->clock_comparator = clock_comparator_max; in local_tick_disable()
169 set_clock_comparator(get_lowcore()->clock_comparator); in local_tick_disable()
175 get_lowcore()->clock_comparator = comp; in local_tick_enable()
176 set_clock_comparator(get_lowcore()->clock_comparator); in local_tick_enable()
195 asm volatile("stckf %0" : "=Q" (clk) : : "cc"); in get_tod_clock_fast()
212 return get_tod_clock() - tod_clock_base.tod; in __get_tod_clock_monotonic()
216 * get_clock_monotonic - returns current time in clock rate units
233 * tod_to_ns - convert a TOD format value to nanoseconds
237 * Converting a 64 Bit TOD format value to nanoseconds means that the value
241 * ns = (todval * 125) >> 9;
244 * With a split todval == 2^9 * th + tl (th upper 55 bits, tl lower 9 bits)
247 * ns = ((2^9 * th + tl) * 125 ) >> 9;
248 * -> ns = (th * 125) + ((tl * 125) >> 9);
253 return ((todval >> 9) * 125) + (((todval & 0x1ff) * 125) >> 9); in tod_to_ns()
258 return (todval * 125) >> 9; in eitod_to_ns()
262 * tod_after - compare two 64 bit TOD values
263 * @a: first 64 bit TOD timestamp
264 * @b: second 64 bit TOD timestamp
266 * Returns: true if a is later than b
268 static inline int tod_after(unsigned long a, unsigned long b) in tod_after() argument
271 return (long) a > (long) b; in tod_after()
272 return a > b; in tod_after()
276 * tod_after_eq - compare two 64 bit TOD values
277 * @a: first 64 bit TOD timestamp
278 * @b: second 64 bit TOD timestamp
280 * Returns: true if a is later than b
282 static inline int tod_after_eq(unsigned long a, unsigned long b) in tod_after_eq() argument
285 return (long) a >= (long) b; in tod_after_eq()
286 return a >= b; in tod_after_eq()