summaryrefslogtreecommitdiff
path: root/src/arch
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/riscv/include/arch/cpu.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/arch/riscv/include/arch/cpu.h b/src/arch/riscv/include/arch/cpu.h
index a0ca3ce534..6008c75122 100644
--- a/src/arch/riscv/include/arch/cpu.h
+++ b/src/arch/riscv/include/arch/cpu.h
@@ -16,6 +16,8 @@
#ifndef __ARCH_CPU_H__
#define __ARCH_CPU_H__
+#include <arch/encoding.h>
+
#define asmlinkage
#if !defined(__PRE_RAM__)
@@ -44,5 +46,10 @@ struct cpuinfo_riscv {
#endif
+static inline int supports_extension(char ext)
+{
+ return read_csr(misa) & (1 << (ext - 'A'));
+}
+
struct cpu_info *cpu_info(void);
#endif /* __ARCH_CPU_H__ */