aboutsummaryrefslogtreecommitdiffstats
path: root/src/arch/riscv/include/ipxe/hart.h
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2024-10-28 11:44:41 +0000
committerMichael Brown <mcb30@ipxe.org>2024-10-28 13:55:00 +0000
commitb0a8eabbf4d32d789686c32809750f95986dc7cb (patch)
treeb5fb7387630c65e5ea62545f86a8716dee36e512 /src/arch/riscv/include/ipxe/hart.h
parent74710b8316b40c9e3081c1014813867d4764796b (diff)
downloadipxe-b0a8eabbf4d32d789686c32809750f95986dc7cb.tar.gz
[riscv] Add support for checking CPU extensions reported via device tree
RISC-V seems to allow for direct discovery of CPU features only from M-mode (e.g. by setting up a trap handler and then attempting to access a CSR), with S-mode code expected to read the resulting constructed ISA description from the device tree. Add the ability to check for the presence of named extensions listed in the "riscv,isa" property of the device tree node corresponding to the boot hart. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/arch/riscv/include/ipxe/hart.h')
-rw-r--r--src/arch/riscv/include/ipxe/hart.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/arch/riscv/include/ipxe/hart.h b/src/arch/riscv/include/ipxe/hart.h
new file mode 100644
index 000000000..c201b6c77
--- /dev/null
+++ b/src/arch/riscv/include/ipxe/hart.h
@@ -0,0 +1,16 @@
+#ifndef _IPXE_HART_H
+#define _IPXE_HART_H
+
+/** @file
+ *
+ * Hardware threads (harts)
+ *
+ */
+
+FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
+
+extern unsigned long boot_hart;
+
+extern int hart_supported ( const char *ext );
+
+#endif /* _IPXE_HART_H */