From 82599ae2febc83fc5366ecd80591bec454c9337f Mon Sep 17 00:00:00 2001 From: yjmstr Date: Fri, 19 May 2023 16:38:56 +0000 Subject: [PATCH] fix error in articles/20230427-tinyemu-exception.md. Signed-off-by: yjmstr --- articles/20230427-tinyemu-exception.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/articles/20230427-tinyemu-exception.md b/articles/20230427-tinyemu-exception.md index 76f395d..f45359c 100644 --- a/articles/20230427-tinyemu-exception.md +++ b/articles/20230427-tinyemu-exception.md @@ -166,7 +166,7 @@ void trap_handler(DECODER *decoder, enum TRAP traptype, bool isException, uint64 return; } enum CPU_PRI_LEVEL nxt_level = M; - if (cpu.pri_level == S) { + if (cpu.pri_level <= S) { if ((isException && (get_csr(medeleg) & (1 << cause))) || (!isException && (get_csr(mideleg) & (1 << cause)))) { nxt_level = S; -- Gitee