diff mbox series

[26/31] x86/fpu: Move fpstate functions to api.h

Message ID 20211011223611.846280577@linutronix.de (mailing list archive)
State New, archived
Headers show
Series x86/fpu: Preparatory cleanups for AMX support (part 1) | expand

Commit Message

Thomas Gleixner Oct. 12, 2021, midnight UTC
Move function declarations which need to be globaly available to api.h
where they belong.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 arch/x86/include/asm/fpu/api.h      |    9 +++++++++
 arch/x86/include/asm/fpu/internal.h |    9 ---------
 arch/x86/kernel/fpu/internal.h      |    3 +++
 arch/x86/math-emu/fpu_entry.c       |    2 +-
 4 files changed, 13 insertions(+), 10 deletions(-)

Comments

Borislav Petkov Oct. 12, 2021, 5:46 p.m. UTC | #1
On Tue, Oct 12, 2021 at 02:00:37AM +0200, Thomas Gleixner wrote:
> Move function declarations which need to be globaly available to api.h
> where they belong.

"globally"
diff mbox series

Patch

--- a/arch/x86/include/asm/fpu/api.h
+++ b/arch/x86/include/asm/fpu/api.h
@@ -110,6 +110,15 @@  extern int cpu_has_xfeatures(u64 xfeatur
 
 static inline void update_pasid(void) { }
 
+#ifdef CONFIG_MATH_EMULATION
+extern void fpstate_init_soft(struct swregs_state *soft);
+#else
+static inline void fpstate_init_soft(struct swregs_state *soft) {}
+#endif
+
+/* FPSTATE */
+extern union fpregs_state init_fpstate;
+
 /* FPSTATE related functions which are exported to KVM */
 extern void fpu_init_fpstate_user(struct fpu *fpu);
 
--- a/arch/x86/include/asm/fpu/internal.h
+++ b/arch/x86/include/asm/fpu/internal.h
@@ -42,15 +42,6 @@  extern void fpu__init_system(struct cpui
 extern void fpu__init_check_bugs(void);
 extern void fpu__resume_cpu(void);
 
-extern union fpregs_state init_fpstate;
-extern void fpstate_init_user(union fpregs_state *state);
-
-#ifdef CONFIG_MATH_EMULATION
-extern void fpstate_init_soft(struct swregs_state *soft);
-#else
-static inline void fpstate_init_soft(struct swregs_state *soft) {}
-#endif
-
 extern void restore_fpregs_from_fpstate(union fpregs_state *fpstate, u64 mask);
 
 extern bool copy_fpstate_to_sigframe(void __user *buf, void __user *fp, int size);
--- a/arch/x86/kernel/fpu/internal.h
+++ b/arch/x86/kernel/fpu/internal.h
@@ -22,4 +22,7 @@  static __always_inline __pure bool use_f
 /* Init functions */
 extern void fpu__init_prepare_fx_sw_frame(void);
 
+/* Used in init.c */
+extern void fpstate_init_user(union fpregs_state *state);
+
 #endif
--- a/arch/x86/math-emu/fpu_entry.c
+++ b/arch/x86/math-emu/fpu_entry.c
@@ -31,7 +31,7 @@ 
 #include <linux/uaccess.h>
 #include <asm/traps.h>
 #include <asm/user.h>
-#include <asm/fpu/internal.h>
+#include <asm/fpu/api.h>
 
 #include "fpu_system.h"
 #include "fpu_emu.h"