Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | /* x86-specific clocksource additions */ |
| 3 | |
| 4 | #ifndef _ASM_X86_CLOCKSOURCE_H |
| 5 | #define _ASM_X86_CLOCKSOURCE_H |
| 6 | |
Olivier Deprez | 157378f | 2022-04-04 15:47:50 +0200 | [diff] [blame^] | 7 | #include <asm/vdso/clocksource.h> |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 8 | |
Olivier Deprez | 157378f | 2022-04-04 15:47:50 +0200 | [diff] [blame^] | 9 | extern unsigned int vclocks_used; |
| 10 | |
| 11 | static inline bool vclock_was_used(int vclock) |
| 12 | { |
| 13 | return READ_ONCE(vclocks_used) & (1U << vclock); |
| 14 | } |
| 15 | |
| 16 | static inline void vclocks_set_used(unsigned int which) |
| 17 | { |
| 18 | WRITE_ONCE(vclocks_used, READ_ONCE(vclocks_used) | (1 << which)); |
| 19 | } |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 20 | |
| 21 | #endif /* _ASM_X86_CLOCKSOURCE_H */ |