forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f9004dbfff8a3fbbd7e2a88c8a4327c7f2f8e5b2
kernel/arch/arm/vfp/vfpinstr.h
....@@ -1,12 +1,9 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * linux/arch/arm/vfp/vfpinstr.h
34 *
45 * Copyright (C) 2004 ARM Limited.
56 * Written by Deep Blue Solutions Limited.
6
- *
7
- * This program is free software; you can redistribute it and/or modify
8
- * it under the terms of the GNU General Public License version 2 as
9
- * published by the Free Software Foundation.
107 *
118 * VFP instruction masks.
129 */
....@@ -65,10 +62,23 @@
6562 #define FPSCR_C (1 << 29)
6663 #define FPSCR_V (1 << 28)
6764
68
-/*
69
- * Since we aren't building with -mfpu=vfp, we need to code
70
- * these instructions using their MRC/MCR equivalents.
71
- */
65
+#ifdef CONFIG_AS_VFP_VMRS_FPINST
66
+
67
+#define fmrx(_vfp_) ({ \
68
+ u32 __v; \
69
+ asm(".fpu vfpv2\n" \
70
+ "vmrs %0, " #_vfp_ \
71
+ : "=r" (__v) : : "cc"); \
72
+ __v; \
73
+ })
74
+
75
+#define fmxr(_vfp_,_var_) \
76
+ asm(".fpu vfpv2\n" \
77
+ "vmsr " #_vfp_ ", %0" \
78
+ : : "r" (_var_) : "cc")
79
+
80
+#else
81
+
7282 #define vfpreg(_vfp_) #_vfp_
7383
7484 #define fmrx(_vfp_) ({ \
....@@ -82,6 +92,8 @@
8292 asm("mcr p10, 7, %0, " vfpreg(_vfp_) ", cr0, 0 @ fmxr " #_vfp_ ", %0" \
8393 : : "r" (_var_) : "cc")
8494
95
+#endif
96
+
8597 u32 vfp_single_cpdo(u32 inst, u32 fpscr);
8698 u32 vfp_single_cprt(u32 inst, u32 fpscr, struct pt_regs *regs);
8799