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 21, 2022
1 parent 8024848 commit 95a5357
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 @@ -1214,6 +1215,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 95a5357

Please sign in to comment.