162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 262306a36Sopenharmony_ci/* x86-specific clocksource additions */ 362306a36Sopenharmony_ci 462306a36Sopenharmony_ci#ifndef _ASM_X86_CLOCKSOURCE_H 562306a36Sopenharmony_ci#define _ASM_X86_CLOCKSOURCE_H 662306a36Sopenharmony_ci 762306a36Sopenharmony_ci#include <asm/vdso/clocksource.h> 862306a36Sopenharmony_ci 962306a36Sopenharmony_ciextern unsigned int vclocks_used; 1062306a36Sopenharmony_ci 1162306a36Sopenharmony_cistatic inline bool vclock_was_used(int vclock) 1262306a36Sopenharmony_ci{ 1362306a36Sopenharmony_ci return READ_ONCE(vclocks_used) & (1U << vclock); 1462306a36Sopenharmony_ci} 1562306a36Sopenharmony_ci 1662306a36Sopenharmony_cistatic inline void vclocks_set_used(unsigned int which) 1762306a36Sopenharmony_ci{ 1862306a36Sopenharmony_ci WRITE_ONCE(vclocks_used, READ_ONCE(vclocks_used) | (1 << which)); 1962306a36Sopenharmony_ci} 2062306a36Sopenharmony_ci 2162306a36Sopenharmony_ci#endif /* _ASM_X86_CLOCKSOURCE_H */ 22