Skip to content

Commit

Permalink
RISC-V: Add 'Smepmp' with 'Zicsr' dependency
Browse files Browse the repository at this point in the history
Volume II: Privileged Architecture of the RISC-V ISA Manual states that the
privileged architecture requires the 'Zicsr' extension.  However, current
GNU Binutils has no direct way whether the program has dependency to the
privileged architecture itself.

As a workaround, we should add implications from privileged extensions that
either add new CSRs, extend existing CSRs or depends on using CSRs.

This commit adds the 'Smepmp' extension (that extends CSRs defined in the
privileged architecture and should have indirect dependency to 'Zicsr').

bfd/ChangeLog:

	* elfxx-riscv.c (riscv_implicit_subsets): Add 'Smepmp' -> 'Zicsr'
	implication.  (riscv_supported_std_s_ext): Add 'Smepmp'.
  • Loading branch information
a4lg committed Sep 17, 2022
1 parent ee8ac3b commit f432b5e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bfd/elfxx-riscv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1097,6 +1097,7 @@ static struct riscv_implicit_subset riscv_implicit_subsets[] =
{"zks", "zbkx", check_implicit_always},
{"zks", "zksed", check_implicit_always},
{"zks", "zksh", check_implicit_always},
{"smepmp", "zicsr", check_implicit_always},
{"smstateen", "zicsr", check_implicit_always},
{"sscofpmf", "zicsr", check_implicit_always},
{"sstc", "zicsr", check_implicit_always},
Expand Down Expand Up @@ -1213,6 +1214,7 @@ static struct riscv_supported_ext riscv_supported_std_z_ext[] =

static struct riscv_supported_ext riscv_supported_std_s_ext[] =
{
{"smepmp", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
{"smstateen", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
{"sscofpmf", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
{"sstc", ISA_SPEC_CLASS_DRAFT, 1, 0, 0 },
Expand Down

0 comments on commit f432b5e

Please sign in to comment.