From 6795270a8ee21b8d231fdc7f3b6f7f8d823a580c Mon Sep 17 00:00:00 2001 From: Tim Newsome Date: Sat, 30 Sep 2017 13:31:57 -0700 Subject: [PATCH] Make priv readable in 0.11. --- src/target/riscv/riscv-011.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/target/riscv/riscv-011.c b/src/target/riscv/riscv-011.c index 978019fac..6073dbd6a 100644 --- a/src/target/riscv/riscv-011.c +++ b/src/target/riscv/riscv-011.c @@ -1311,6 +1311,8 @@ static int register_get(struct reg *reg) if (cache_write(target, 4, true) != ERROR_OK) { return ERROR_FAIL; } + } else if (reg->number == GDB_REGNO_PRIV) { + value = get_field(info->dcsr, DCSR_PRV); } else { if (register_read(target, &value, reg->number) != ERROR_OK) return ERROR_FAIL;