From 7a05cbde1789c7cf65b9c2b03c9529ab99dc97e6 Mon Sep 17 00:00:00 2001 From: Andrew Waterman Date: Wed, 31 Jul 2013 13:37:33 -0700 Subject: [PATCH] Fix dumb ERET bug --- riscv/insns/eret.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/riscv/insns/eret.h b/riscv/insns/eret.h index 96d951c..deed103 100644 --- a/riscv/insns/eret.h +++ b/riscv/insns/eret.h @@ -1,5 +1,5 @@ require_supervisor; -set_pcr(PCR_SR, ((sr & ~(SR_PS | SR_EI)) | +set_pcr(PCR_SR, ((sr & ~(SR_S | SR_EI)) | ((sr & SR_PS) ? 0 : SR_S)) | ((sr & SR_PEI) ? SR_EI : 0)); set_pc(epc); -- 2.30.2