[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200308094954.13258-7-guoren@kernel.org>
Date: Sun, 8 Mar 2020 17:49:49 +0800
From: guoren@...nel.org
To: paul.walmsley@...ive.com, palmer@...belt.com, Anup.Patel@....com,
greentime.hu@...ive.com
Cc: linux-kernel@...r.kernel.org, linux-arch@...r.kernel.org,
arnd@...db.de, linux-csky@...r.kernel.org,
linux-riscv@...ts.infradead.org,
Guo Ren <guoren@...ux.alibaba.com>,
Dave Martin <Dave.Martin@....com>
Subject: [RFC PATCH V3 06/11] riscv: Add has_vector detect
From: Guo Ren <guoren@...ux.alibaba.com>
This patch is to detect "has_vector" at time of CPU feature
parsing.
Signed-off-by: Guo Ren <guoren@...ux.alibaba.com>
---
arch/riscv/kernel/cpufeature.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c
index c8527d770c98..c9ab24e3c79e 100644
--- a/arch/riscv/kernel/cpufeature.c
+++ b/arch/riscv/kernel/cpufeature.c
@@ -16,6 +16,9 @@ unsigned long elf_hwcap __read_mostly;
#ifdef CONFIG_FPU
bool has_fpu __read_mostly;
#endif
+#ifdef CONFIG_VECTOR
+bool has_vector __read_mostly;
+#endif
void riscv_fill_hwcap(void)
{
@@ -73,4 +76,9 @@ void riscv_fill_hwcap(void)
if (elf_hwcap & (COMPAT_HWCAP_ISA_F | COMPAT_HWCAP_ISA_D))
has_fpu = true;
#endif
+
+#ifdef CONFIG_VECTOR
+ if (elf_hwcap & COMPAT_HWCAP_ISA_V)
+ has_vector = true;
+#endif
}
--
2.17.0
Powered by blists - more mailing lists