Skip to content

Commit 372f662

Browse files
SiFiveHollandakpm00
authored andcommitted
LoongArch: implement ARCH_HAS_KERNEL_FPU_SUPPORT
LoongArch already provides kernel_fpu_begin() and kernel_fpu_end() in asm/fpu.h, so it only needs to add kernel_fpu_available() and export the CFLAGS adjustments. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Samuel Holland <[email protected]> Acked-by: WANG Xuerui <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Acked-by: Christian König <[email protected]> Cc: Alex Deucher <[email protected]> Cc: Borislav Petkov (AMD) <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: Dave Hansen <[email protected]> Cc: Huacai Chen <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jonathan Corbet <[email protected]> Cc: Masahiro Yamada <[email protected]> Cc: Michael Ellerman <[email protected]> Cc: Nathan Chancellor <[email protected]> Cc: Nicolas Schier <[email protected]> Cc: Palmer Dabbelt <[email protected]> Cc: Russell King <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Will Deacon <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 4be0739 commit 372f662

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

arch/loongarch/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ config LOONGARCH
1818
select ARCH_HAS_CURRENT_STACK_POINTER
1919
select ARCH_HAS_FORTIFY_SOURCE
2020
select ARCH_HAS_KCOV
21+
select ARCH_HAS_KERNEL_FPU_SUPPORT if CPU_HAS_FPU
2122
select ARCH_HAS_NMI_SAFE_THIS_CPU_OPS
2223
select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE
2324
select ARCH_HAS_PTE_SPECIAL

arch/loongarch/Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ endif
2626
32bit-emul = elf32loongarch
2727
64bit-emul = elf64loongarch
2828

29+
CC_FLAGS_FPU := -mfpu=64
30+
CC_FLAGS_NO_FPU := -msoft-float
31+
2932
ifdef CONFIG_UNWINDER_ORC
3033
orc_hash_h := arch/$(SRCARCH)/include/generated/asm/orc_hash.h
3134
orc_hash_sh := $(srctree)/scripts/orc_hash.sh
@@ -59,7 +62,7 @@ ld-emul = $(64bit-emul)
5962
cflags-y += -mabi=lp64s
6063
endif
6164

62-
cflags-y += -pipe -msoft-float
65+
cflags-y += -pipe $(CC_FLAGS_NO_FPU)
6366
LDFLAGS_vmlinux += -static -n -nostdlib
6467

6568
# When the assembler supports explicit relocation hint, we must use it.

arch/loongarch/include/asm/fpu.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
struct sigcontext;
2323

24+
#define kernel_fpu_available() cpu_has_fpu
2425
extern void kernel_fpu_begin(void);
2526
extern void kernel_fpu_end(void);
2627

0 commit comments

Comments
 (0)