Lines Matching +full:wait +full:- +full:delay
1 // SPDX-License-Identifier: GPL-2.0
3 * Precise Delay Loops for i386
19 #include <linux/delay.h>
22 #include <asm/delay.h>
33 * Calibration and selection of the delay mechanism happens only once
39 /* simple loop based delay: */
62 /* TSC based delay: */
73 if ((now - bclock) >= cycles) in delay_tsc()
83 * since TSC's are per-cpu we need to calculate in delay_tsc()
84 * that. The delay must guarantee that we wait "at in delay_tsc()
86 * CPU could make the wait longer but we just need to in delay_tsc()
91 cycles -= (now - bclock); in delay_tsc()
115 * small compared to the "microseconds" that usleep() will delay. in delay_halt_tpause()
121 * On some AMD platforms, MWAITX has a configurable 32-bit timer, that
123 * to wait. MWAITX will also exit when the timer expires.
127 u64 delay; in delay_halt_mwaitx() local
129 delay = min_t(u64, MWAITX_MAX_WAIT_CYCLES, cycles); in delay_halt_mwaitx()
131 * Use cpu_tss_rw as a cacheline-aligned, seldom accessed per-cpu in delay_halt_mwaitx()
138 * enter any deep C-state and we use it here in delay() to minimize in delay_halt_mwaitx()
141 __mwaitx(MWAITX_DISABLE_CSTATES, delay, MWAITX_ECX_TIMER_ENABLE); in delay_halt_mwaitx()
145 * Call a vendor specific function to delay for a given amount of time. Because
154 * Timer value of 0 causes MWAITX to wait indefinitely, unless there in delay_halt()
166 if (cycles <= end - start) in delay_halt()
169 cycles -= end - start; in delay_halt()
198 return -1; in read_current_timer()