Skip to content

Commit 2a754d6

Browse files
atishp04alistair23
authored andcommitted
target/riscv: Add implied rule for counter delegation extensions
The counter delegation/configuration extensions depend on the following extensions. 1. Smcdeleg - To enable counter delegation from M to S 2. S[m|s]csrind - To enable indirect access CSRs Add an implied rule so that these extensions are enabled by default if the sscfg extension is enabled. Reviewed-by: Daniel Henrique Barboza <[email protected]> Acked-by: Alistair Francis <[email protected]> Signed-off-by: Atish Patra <[email protected]> Message-ID: <[email protected]> Signed-off-by: Alistair Francis <[email protected]>
1 parent 04ff272 commit 2a754d6

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

target/riscv/cpu.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2760,6 +2760,16 @@ static RISCVCPUImpliedExtsRule ZVKSG_IMPLIED = {
27602760
},
27612761
};
27622762

2763+
static RISCVCPUImpliedExtsRule SSCFG_IMPLIED = {
2764+
.ext = CPU_CFG_OFFSET(ext_ssccfg),
2765+
.implied_multi_exts = {
2766+
CPU_CFG_OFFSET(ext_smcsrind), CPU_CFG_OFFSET(ext_sscsrind),
2767+
CPU_CFG_OFFSET(ext_smcdeleg),
2768+
2769+
RISCV_IMPLIED_EXTS_RULE_END
2770+
},
2771+
};
2772+
27632773
RISCVCPUImpliedExtsRule *riscv_misa_ext_implied_rules[] = {
27642774
&RVA_IMPLIED, &RVD_IMPLIED, &RVF_IMPLIED,
27652775
&RVM_IMPLIED, &RVV_IMPLIED, NULL
@@ -2777,7 +2787,7 @@ RISCVCPUImpliedExtsRule *riscv_multi_ext_implied_rules[] = {
27772787
&ZVE64X_IMPLIED, &ZVFBFMIN_IMPLIED, &ZVFBFWMA_IMPLIED,
27782788
&ZVFH_IMPLIED, &ZVFHMIN_IMPLIED, &ZVKN_IMPLIED,
27792789
&ZVKNC_IMPLIED, &ZVKNG_IMPLIED, &ZVKNHB_IMPLIED,
2780-
&ZVKS_IMPLIED, &ZVKSC_IMPLIED, &ZVKSG_IMPLIED,
2790+
&ZVKS_IMPLIED, &ZVKSC_IMPLIED, &ZVKSG_IMPLIED, &SSCFG_IMPLIED,
27812791
NULL
27822792
};
27832793

0 commit comments

Comments
 (0)