[v1.06][RISCV] Support for fetching mvendorid, marchid and mimpid (#286)

Getting these 3 RISC-V cpuinfo fields allows the detection of
microarchitecture (and other information), extending the RISC-V
detection capabilities. In particular, this is used here to detect
the marchid of Spacemit X60 uarch.

This commit also changes how the microarchitecture is fetched
(i.e., get_uarch) so that it does not rely only in the uarch field
in cpuinfo, but also on the marchid value.
This commit is contained in:
Dr-Noob
2024-10-10 08:33:01 +01:00
parent 2df8aa8217
commit 65c75eb443
6 changed files with 109 additions and 14 deletions

View File

@@ -25,6 +25,7 @@ enum {
CPU_VENDOR_RISCV,
CPU_VENDOR_SIFIVE,
CPU_VENDOR_THEAD,
CPU_VENDOR_SPACEMIT,
// OTHERS
CPU_VENDOR_UNKNOWN,
CPU_VENDOR_INVALID