Skip to content

Commit c0281a1

Browse files
authored
Merge pull request #1735 from chihminchao/deleg-hw-excp
excp: support hardware_error_exception delegation
2 parents fd141e9 + 0846302 commit c0281a1

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

riscv/csrs.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -930,6 +930,7 @@ bool medeleg_csr_t::unlogged_write(const reg_t val) noexcept {
930930
| (1 << CAUSE_STORE_PAGE_FAULT)
931931
| (proc->extension_enabled('H') ? hypervisor_exceptions : 0)
932932
| (1 << CAUSE_SOFTWARE_CHECK_FAULT)
933+
| (1 << CAUSE_HARDWARE_ERROR_FAULT)
933934
;
934935
return basic_csr_t::unlogged_write((read() & ~mask) | (val & mask));
935936
}

riscv/processor.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,8 @@ void state_t::reset(processor_t* const proc, reg_t max_isa)
318318
(1 << CAUSE_FETCH_PAGE_FAULT) |
319319
(1 << CAUSE_LOAD_PAGE_FAULT) |
320320
(1 << CAUSE_STORE_PAGE_FAULT) |
321-
(1 << CAUSE_SOFTWARE_CHECK_FAULT);
321+
(1 << CAUSE_SOFTWARE_CHECK_FAULT) |
322+
(1 << CAUSE_HARDWARE_ERROR_FAULT);
322323
csrmap[CSR_HEDELEG] = hedeleg = std::make_shared<masked_csr_t>(proc, CSR_HEDELEG, hedeleg_mask, 0);
323324
csrmap[CSR_HCOUNTEREN] = hcounteren = std::make_shared<masked_csr_t>(proc, CSR_HCOUNTEREN, counteren_mask, 0);
324325
htimedelta = std::make_shared<basic_csr_t>(proc, CSR_HTIMEDELTA, 0);

0 commit comments

Comments
 (0)