File tree Expand file tree Collapse file tree 3 files changed +24
-1
lines changed Expand file tree Collapse file tree 3 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ config ARM64
30
30
select ARCH_HAS_GCOV_PROFILE_ALL
31
31
select ARCH_HAS_GIGANTIC_PAGE
32
32
select ARCH_HAS_KCOV
33
+ select ARCH_HAS_KERNEL_FPU_SUPPORT if KERNEL_MODE_NEON
33
34
select ARCH_HAS_KEEPINITRD
34
35
select ARCH_HAS_MEMBARRIER_SYNC_CORE
35
36
select ARCH_HAS_NMI_SAFE_THIS_CPU_OPS
Original file line number Diff line number Diff line change @@ -36,7 +36,14 @@ ifeq ($(CONFIG_BROKEN_GAS_INST),y)
36
36
$(warning Detected assembler with broken .inst; disassembly will be unreliable)
37
37
endif
38
38
39
- KBUILD_CFLAGS += -mgeneral-regs-only \
39
+ # The GCC option -ffreestanding is required in order to compile code containing
40
+ # ARM/NEON intrinsics in a non C99-compliant environment (such as the kernel)
41
+ CC_FLAGS_FPU := -ffreestanding
42
+ # Enable <arm_neon.h>
43
+ CC_FLAGS_FPU += -isystem $(shell $(CC ) -print-file-name=include)
44
+ CC_FLAGS_NO_FPU := -mgeneral-regs-only
45
+
46
+ KBUILD_CFLAGS += $(CC_FLAGS_NO_FPU ) \
40
47
$(compat_vdso ) $(cc_has_k_constraint )
41
48
KBUILD_CFLAGS += $(call cc-disable-warning, psabi)
42
49
KBUILD_AFLAGS += $(compat_vdso )
Original file line number Diff line number Diff line change
1
+ /* SPDX-License-Identifier: GPL-2.0-only */
2
+ /*
3
+ * Copyright (C) 2023 SiFive
4
+ */
5
+
6
+ #ifndef __ASM_FPU_H
7
+ #define __ASM_FPU_H
8
+
9
+ #include <asm/neon.h>
10
+
11
+ #define kernel_fpu_available () cpu_has_neon()
12
+ #define kernel_fpu_begin () kernel_neon_begin()
13
+ #define kernel_fpu_end () kernel_neon_end()
14
+
15
+ #endif /* ! __ASM_FPU_H */
You can’t perform that action at this time.
0 commit comments