lib: sbi: Fix mstatus_init() for RV32 when Sscofpmf is not available
authorAnup Patel <apatel@ventanamicro.com>
Thu, 28 Apr 2022 07:43:59 +0000 (13:13 +0530)
committerAnup Patel <anup@brainfault.org>
Thu, 28 Apr 2022 14:09:01 +0000 (19:39 +0530)
commit474a9d45551ab8c7df511a6620de2427a732351f
tree635618df18a1d9e23e2fd45a41aec56d50ddaa09
parentd62f6da062ad0fcc3bdc042a3f3b200d91d18afd
lib: sbi: Fix mstatus_init() for RV32 when Sscofpmf is not available

The mhpmevent3h to mhpmevent31h CSRs are available on RV32 only when
Sscofpmf extension is available so mstatus_init() should set this
CSRs only when Sscofpmf extension is available.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Reviewed-by: Atish Patra <atishp@rivosinc.com>
lib/sbi/sbi_hart.c