xref: /linux/arch/mips/kernel/fpu-probe.h (revision cbecf716ca618fd44feda6bd9a64a8179d031fc5)
1a616c061SThomas Bogendoerfer /* SPDX-License-Identifier: GPL-2.0-or-later */
2a616c061SThomas Bogendoerfer 
3a616c061SThomas Bogendoerfer #include <linux/kernel.h>
4a616c061SThomas Bogendoerfer 
5a616c061SThomas Bogendoerfer #include <asm/cpu.h>
6a616c061SThomas Bogendoerfer #include <asm/cpu-info.h>
7a616c061SThomas Bogendoerfer 
8a616c061SThomas Bogendoerfer #ifdef CONFIG_MIPS_FP_SUPPORT
9a616c061SThomas Bogendoerfer 
10a616c061SThomas Bogendoerfer extern int mips_fpu_disabled;
11a616c061SThomas Bogendoerfer 
12a616c061SThomas Bogendoerfer int __cpu_has_fpu(void);
13a616c061SThomas Bogendoerfer void cpu_set_fpu_opts(struct cpuinfo_mips *c);
14a616c061SThomas Bogendoerfer void cpu_set_nofpu_opts(struct cpuinfo_mips *c);
15a616c061SThomas Bogendoerfer 
16a616c061SThomas Bogendoerfer #else /* !CONFIG_MIPS_FP_SUPPORT */
17a616c061SThomas Bogendoerfer 
18a616c061SThomas Bogendoerfer #define mips_fpu_disabled 1
19a616c061SThomas Bogendoerfer 
cpu_get_fpu_id(void)20a616c061SThomas Bogendoerfer static inline unsigned long cpu_get_fpu_id(void)
21a616c061SThomas Bogendoerfer {
22a616c061SThomas Bogendoerfer 	return FPIR_IMP_NONE;
23a616c061SThomas Bogendoerfer }
24a616c061SThomas Bogendoerfer 
__cpu_has_fpu(void)25a616c061SThomas Bogendoerfer static inline int __cpu_has_fpu(void)
26a616c061SThomas Bogendoerfer {
27a616c061SThomas Bogendoerfer 	return 0;
28a616c061SThomas Bogendoerfer }
29a616c061SThomas Bogendoerfer 
cpu_set_fpu_opts(struct cpuinfo_mips * c)30a616c061SThomas Bogendoerfer static inline void cpu_set_fpu_opts(struct cpuinfo_mips *c)
31a616c061SThomas Bogendoerfer {
32a616c061SThomas Bogendoerfer 	/* no-op */
33a616c061SThomas Bogendoerfer }
34a616c061SThomas Bogendoerfer 
cpu_set_nofpu_opts(struct cpuinfo_mips * c)35a616c061SThomas Bogendoerfer static inline void cpu_set_nofpu_opts(struct cpuinfo_mips *c)
36a616c061SThomas Bogendoerfer {
37a616c061SThomas Bogendoerfer 	/* no-op */
38a616c061SThomas Bogendoerfer }
39a616c061SThomas Bogendoerfer 
40a616c061SThomas Bogendoerfer #endif /* CONFIG_MIPS_FP_SUPPORT */
41