mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-04 00:06:36 +00:00

In preparation for dynamically enabled FPU features move the function out of line as the goal is to expose less and not more information. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Borislav Petkov <bp@suse.de> Link: https://lkml.kernel.org/r/20211013145322.869001791@linutronix.de
33 lines
800 B
C
33 lines
800 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef __X86_KERNEL_FPU_INTERNAL_H
|
|
#define __X86_KERNEL_FPU_INTERNAL_H
|
|
|
|
extern unsigned int fpu_kernel_xstate_size;
|
|
extern unsigned int fpu_user_xstate_size;
|
|
extern struct fpstate init_fpstate;
|
|
|
|
/* CPU feature check wrappers */
|
|
static __always_inline __pure bool use_xsave(void)
|
|
{
|
|
return cpu_feature_enabled(X86_FEATURE_XSAVE);
|
|
}
|
|
|
|
static __always_inline __pure bool use_fxsr(void)
|
|
{
|
|
return cpu_feature_enabled(X86_FEATURE_FXSR);
|
|
}
|
|
|
|
#ifdef CONFIG_X86_DEBUG_FPU
|
|
# define WARN_ON_FPU(x) WARN_ON_ONCE(x)
|
|
#else
|
|
# define WARN_ON_FPU(x) ({ (void)(x); 0; })
|
|
#endif
|
|
|
|
/* Init functions */
|
|
extern void fpu__init_prepare_fx_sw_frame(void);
|
|
|
|
/* Used in init.c */
|
|
extern void fpstate_init_user(struct fpstate *fpstate);
|
|
extern void fpstate_reset(struct fpu *fpu);
|
|
|
|
#endif
|