diff options
author | Alistair Francis <alistair.francis@wdc.com> | 2020-06-17 03:06:15 +0300 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2020-06-18 06:26:54 +0300 |
commit | d5725c24c6ea04368d90bc0f5af3ec20862b4a3b (patch) | |
tree | 721fbe4f4d00d7ee41266bfab33d9db7cb32b3d6 /lib | |
parent | 518e85cccb18a6dfe71fc8d1227c8f8d74527dc9 (diff) | |
download | opensbi-d5725c24c6ea04368d90bc0f5af3ec20862b4a3b.tar.xz |
lib: Don't print delegation CSRs if there is no S-Mode
If the platform doesn't support S-Mode don't print the delegation
registers.
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Atish Patra <atish.patra@wdc.com>
Reviewed-by: Anup Patel <anup.patel@wdc.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sbi/sbi_hart.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/sbi/sbi_hart.c b/lib/sbi/sbi_hart.c index 88d0ac8..e943346 100644 --- a/lib/sbi/sbi_hart.c +++ b/lib/sbi/sbi_hart.c @@ -122,6 +122,10 @@ static int delegate_traps(struct sbi_scratch *scratch, u32 hartid) void sbi_hart_delegation_dump(struct sbi_scratch *scratch) { + if (!misa_extension('S')) + /* No delegation possible as mideleg does not exist*/ + return; + #if __riscv_xlen == 32 sbi_printf("MIDELEG : 0x%08lx\n", csr_read(CSR_MIDELEG)); sbi_printf("MEDELEG : 0x%08lx\n", csr_read(CSR_MEDELEG)); |