Skip to content

Commit

Permalink
riscv: Fix build error due to missing Hedeleg_mask
Browse files Browse the repository at this point in the history
In `cpu_virt && !fpu` configurations the constant Hedeleg_mask was not
defined.

Change-Id: Idb18c57db1b7758071dc2f528db31b25a3eba121
  • Loading branch information
gkotheim authored and jermar committed Oct 14, 2024
1 parent 1092277 commit ad30ebb
Showing 1 changed file with 5 additions and 24 deletions.
29 changes: 5 additions & 24 deletions src/kern/riscv/cpu-riscv-hyp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,33 +92,14 @@ class Cpu
/// Hstatus bits that are set for user mode context by default.
Hstatus_user_default = 0,
};
};

//----------------------------------------------------------------------------
INTERFACE [riscv && cpu_virt && fpu && lazy_fpu]:

EXTENSION
class Cpu
{
public:
enum : Mword
{
// Cannot delegate illegal instruction exception as we need it for lazy FPU
// switching.
Hedeleg_mask = ~(1UL << Exc_illegal_inst),
};
};

//----------------------------------------------------------------------------
INTERFACE [riscv && cpu_virt && fpu && !lazy_fpu]:

EXTENSION
class Cpu
{
public:
enum : Mword
{
Hedeleg_mask = ~0UL,
// With lazy FPU switching we cannot delegate illegal instruction exception,
// as we need it to detect usage of disabled FPU, i.e. the case that
// currently someone else is the FPU owner.
Hedeleg_mask = TAG_ENABLED(fpu && lazy_fpu)
? ~(1UL << Exc_illegal_inst) : ~0UL,
};
};

Expand Down

0 comments on commit ad30ebb

Please sign in to comment.