Lines Matching +full:0 +full:- +full:9 +full:a +full:- +full:d
1 /* SPDX-License-Identifier: GPL-2.0 */
6 * Derived from "include/asm-i386/timex.h"
18 #define TOD_UNIX_EPOCH 0x7d91048bca000000ULL
26 __uint128_t tod : 64; /* bits 0-63 of tod clock */
31 __uint128_t eitod : 72; /* epoch index + bits 0-63 tod clock */
35 __uint128_t us : 60; /* micro-seconds */
36 __uint128_t sus : 12; /* sub-microseconds */
48 " ipm %0\n" in set_tod_clock()
49 " srl %0,28\n" in set_tod_clock()
50 : "=d" (cc) : "Q" (time) : "cc"); in set_tod_clock()
60 " ipm %0\n" in store_tod_clock_ext_cc()
61 " srl %0,28\n" in store_tod_clock_ext_cc()
62 : "=d" (cc), "=Q" (*clk) : : "cc"); in store_tod_clock_ext_cc()
68 asm volatile("stcke %0" : "=Q" (*tod) : : "cc"); in store_tod_clock_ext()
73 asm volatile("sckc %0" : : "Q" (time)); in set_clock_comparator()
79 " lgr 0,%[val]\n" in set_tod_programmable_field()
82 : [val] "d" ((unsigned long)val) in set_tod_programmable_field()
83 : "0"); in set_tod_programmable_field()
93 #define PTFF_QAF 0x00 /* query available functions */
94 #define PTFF_QTO 0x01 /* query tod offset */
95 #define PTFF_QSI 0x02 /* query steering information */
96 #define PTFF_QUI 0x04 /* query UTC information */
97 #define PTFF_ATO 0x40 /* adjust tod offset */
98 #define PTFF_STO 0x41 /* set tod offset */
99 #define PTFF_SFS 0x42 /* set fine steering rate */
100 #define PTFF_SGS 0x43 /* set gross steering rate */
115 return (*ptr & (0x80 >> (nr & 7))) != 0; in ptff_query()
135 * ptff - Perform timing facility function
139 * Returns: Condition code (0 on success)
149 " lgr 0,%[reg0]\n" \
154 : [rc] "=&d" (rc), "+m" (*(struct addrtype *)reg1) \
155 : [reg0] "d" (reg0), [reg1] "d" (reg1) \
156 : "cc", "0", "1"); \
164 old = get_lowcore()->clock_comparator; in local_tick_disable()
165 get_lowcore()->clock_comparator = clock_comparator_max; in local_tick_disable()
166 set_clock_comparator(get_lowcore()->clock_comparator); in local_tick_disable()
172 get_lowcore()->clock_comparator = comp; in local_tick_enable()
173 set_clock_comparator(get_lowcore()->clock_comparator); in local_tick_enable()
192 asm volatile("stckf %0" : "=Q" (clk) : : "cc"); in get_tod_clock_fast()
209 return get_tod_clock() - tod_clock_base.tod; in __get_tod_clock_monotonic()
213 * get_clock_monotonic - returns current time in clock rate units
230 * tod_to_ns - convert a TOD format value to nanoseconds
234 * Converting a 64 Bit TOD format value to nanoseconds means that the value
238 * ns = (todval * 125) >> 9;
241 * With a split todval == 2^9 * th + tl (th upper 55 bits, tl lower 9 bits)
244 * ns = ((2^9 * th + tl) * 125 ) >> 9;
245 * -> ns = (th * 125) + ((tl * 125) >> 9);
250 return ((todval >> 9) * 125) + (((todval & 0x1ff) * 125) >> 9); in tod_to_ns()
254 * tod_after - compare two 64 bit TOD values
255 * @a: first 64 bit TOD timestamp
258 * Returns: true if a is later than b
260 static inline int tod_after(unsigned long a, unsigned long b) in tod_after() argument
263 return (long) a > (long) b; in tod_after()
264 return a > b; in tod_after()
268 * tod_after_eq - compare two 64 bit TOD values
269 * @a: first 64 bit TOD timestamp
272 * Returns: true if a is later than b
274 static inline int tod_after_eq(unsigned long a, unsigned long b) in tod_after_eq() argument
277 return (long) a >= (long) b; in tod_after_eq()
278 return a >= b; in tod_after_eq()