arch-riscv: fix inUserMode
The original inUserMode() simply returns true. However, it should check whether the processor's current privilege level is PRV_U. Change-Id: Iba74ccc6ff459e7d8c421ae9fe004c6c09920763 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/53184 Reviewed-by: Jason Lowe-Power <power.jg@gmail.com> Reviewed-by: Ayaz Akram <yazakram@ucdavis.edu> Maintainer: Jason Lowe-Power <power.jg@gmail.com> Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
@@ -205,6 +205,11 @@ ISA::ISA(const Params &p) : BaseISA(p)
|
||||
clear();
|
||||
}
|
||||
|
||||
bool ISA::inUserMode() const
|
||||
{
|
||||
return miscRegFile[MISCREG_PRV] == PRV_U;
|
||||
}
|
||||
|
||||
void
|
||||
ISA::copyRegsFrom(ThreadContext *src)
|
||||
{
|
||||
|
||||
@@ -98,7 +98,7 @@ class ISA : public BaseISA
|
||||
int flattenCCIndex(int reg) const { return reg; }
|
||||
int flattenMiscIndex(int reg) const { return reg; }
|
||||
|
||||
bool inUserMode() const override { return true; }
|
||||
bool inUserMode() const override;
|
||||
void copyRegsFrom(ThreadContext *src) override;
|
||||
|
||||
void serialize(CheckpointOut &cp) const override;
|
||||
|
||||
Reference in New Issue
Block a user