]>
Commit | Line | Data |
---|---|---|
b2441318 | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
1eeaed76 RM |
2 | /* |
3 | * Copyright (C) 1994 Linus Torvalds | |
4 | * | |
5 | * Pentium III FXSR, SSE support | |
6 | * General FPU state handling cleanups | |
7 | * Gareth Hughes <gareth@valinux.com>, May 2000 | |
8 | * x86-64 work by Andi Kleen 2002 | |
9 | */ | |
10 | ||
df6b35f4 IM |
11 | #ifndef _ASM_X86_FPU_API_H |
12 | #define _ASM_X86_FPU_API_H | |
1eeaed76 | 13 | |
b1a74bf8 SS |
14 | /* |
15 | * Careful: __kernel_fpu_begin/end() must be called with preempt disabled | |
16 | * and they don't touch the preempt state on their own. | |
17 | * If you enable preemption after __kernel_fpu_begin(), preempt notifier | |
18 | * should call the __kernel_fpu_end() to prevent the kernel/user FPU | |
19 | * state from getting corrupted. KVM for example uses this model. | |
20 | * | |
21 | * All other cases use kernel_fpu_begin/end() which disable preemption | |
22 | * during kernel FPU usage. | |
23 | */ | |
24 | extern void __kernel_fpu_begin(void); | |
25 | extern void __kernel_fpu_end(void); | |
d63e79b1 IM |
26 | extern void kernel_fpu_begin(void); |
27 | extern void kernel_fpu_end(void); | |
952f07ec | 28 | extern bool irq_fpu_usable(void); |
1eeaed76 | 29 | |
5b073430 IM |
30 | /* |
31 | * Query the presence of one or more xfeatures. Works on any legacy CPU as well. | |
32 | * | |
33 | * If 'feature_name' is set then put a human-readable description of | |
34 | * the feature there as well - this can be used to print error (or success) | |
35 | * messages. | |
36 | */ | |
37 | extern int cpu_has_xfeatures(u64 xfeatures_mask, const char **feature_name); | |
38 | ||
df6b35f4 | 39 | #endif /* _ASM_X86_FPU_API_H */ |