18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 28c2ecf20Sopenharmony_ci/* x86-specific clocksource additions */ 38c2ecf20Sopenharmony_ci 48c2ecf20Sopenharmony_ci#ifndef _ASM_X86_CLOCKSOURCE_H 58c2ecf20Sopenharmony_ci#define _ASM_X86_CLOCKSOURCE_H 68c2ecf20Sopenharmony_ci 78c2ecf20Sopenharmony_ci#include <asm/vdso/clocksource.h> 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_ciextern unsigned int vclocks_used; 108c2ecf20Sopenharmony_ci 118c2ecf20Sopenharmony_cistatic inline bool vclock_was_used(int vclock) 128c2ecf20Sopenharmony_ci{ 138c2ecf20Sopenharmony_ci return READ_ONCE(vclocks_used) & (1U << vclock); 148c2ecf20Sopenharmony_ci} 158c2ecf20Sopenharmony_ci 168c2ecf20Sopenharmony_cistatic inline void vclocks_set_used(unsigned int which) 178c2ecf20Sopenharmony_ci{ 188c2ecf20Sopenharmony_ci WRITE_ONCE(vclocks_used, READ_ONCE(vclocks_used) | (1 << which)); 198c2ecf20Sopenharmony_ci} 208c2ecf20Sopenharmony_ci 218c2ecf20Sopenharmony_ci#endif /* _ASM_X86_CLOCKSOURCE_H */ 22