Scott Johnson
4 years ago
No known key found for this signature in database
GPG Key ID: 61C1F01D3D1410C9
3 changed files with
20 additions and
1 deletions
-
riscv/csrs.cc
-
riscv/csrs.h
-
riscv/processor.cc
|
|
|
@ -956,6 +956,16 @@ void hypervisor_csr_t::verify_permissions(insn_t insn, bool write) const { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
hideleg_csr_t::hideleg_csr_t(processor_t* const proc, const reg_t addr, csr_t_p mideleg): |
|
|
|
masked_csr_t(proc, addr, MIP_VS_MASK, 0), |
|
|
|
mideleg(mideleg) { |
|
|
|
} |
|
|
|
|
|
|
|
reg_t hideleg_csr_t::read() const noexcept { |
|
|
|
return masked_csr_t::read() & mideleg->read(); |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
hgatp_csr_t::hgatp_csr_t(processor_t* const proc, const reg_t addr): |
|
|
|
basic_csr_t(proc, addr, 0) { |
|
|
|
} |
|
|
|
|
|
|
|
@ -511,6 +511,15 @@ class hypervisor_csr_t: public basic_csr_t { |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
class hideleg_csr_t: public masked_csr_t { |
|
|
|
public: |
|
|
|
hideleg_csr_t(processor_t* const proc, const reg_t addr, csr_t_p mideleg); |
|
|
|
virtual reg_t read() const noexcept override; |
|
|
|
private: |
|
|
|
csr_t_p mideleg; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
class hgatp_csr_t: public basic_csr_t { |
|
|
|
public: |
|
|
|
hgatp_csr_t(processor_t* const proc, const reg_t addr); |
|
|
|
|
|
|
|
@ -474,7 +474,7 @@ void state_t::reset(processor_t* const proc, reg_t max_isa) |
|
|
|
csrmap[CSR_HSTATUS] = hstatus = std::make_shared<masked_csr_t>(proc, CSR_HSTATUS, hstatus_mask, hstatus_init); |
|
|
|
csrmap[CSR_HGEIE] = std::make_shared<const_csr_t>(proc, CSR_HGEIE, 0); |
|
|
|
csrmap[CSR_HGEIP] = std::make_shared<const_csr_t>(proc, CSR_HGEIP, 0); |
|
|
|
csrmap[CSR_HIDELEG] = hideleg = std::make_shared<masked_csr_t>(proc, CSR_HIDELEG, MIP_VS_MASK, 0); |
|
|
|
csrmap[CSR_HIDELEG] = hideleg = std::make_shared<hideleg_csr_t>(proc, CSR_HIDELEG, mideleg); |
|
|
|
const reg_t hedeleg_mask = |
|
|
|
(1 << CAUSE_MISALIGNED_FETCH) | |
|
|
|
(1 << CAUSE_FETCH_ACCESS) | |
|
|
|
|