Skip to content

Commit 677e030

Browse files
committed
Zicfilp: Support delegating software check exception handling
1 parent 7b5eba9 commit 677e030

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
@@ -906,6 +906,7 @@ bool medeleg_csr_t::unlogged_write(const reg_t val) noexcept {
906906
| (1 << CAUSE_LOAD_PAGE_FAULT)
907907
| (1 << CAUSE_STORE_PAGE_FAULT)
908908
| (proc->extension_enabled('H') ? hypervisor_exceptions : 0)
909+
| (proc->extension_enabled(EXT_ZICFILP) ? (1 << CAUSE_SOFTWARE_CHECK_FAULT) : 0)
909910
;
910911
return basic_csr_t::unlogged_write((read() & ~mask) | (val & mask));
911912
}

riscv/processor.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,8 @@ void state_t::reset(processor_t* const proc, reg_t max_isa)
382382
(1 << CAUSE_USER_ECALL) |
383383
(1 << CAUSE_FETCH_PAGE_FAULT) |
384384
(1 << CAUSE_LOAD_PAGE_FAULT) |
385-
(1 << CAUSE_STORE_PAGE_FAULT);
385+
(1 << CAUSE_STORE_PAGE_FAULT) |
386+
(1 << CAUSE_SOFTWARE_CHECK_FAULT);
386387
csrmap[CSR_HEDELEG] = hedeleg = std::make_shared<masked_csr_t>(proc, CSR_HEDELEG, hedeleg_mask, 0);
387388
csrmap[CSR_HCOUNTEREN] = hcounteren = std::make_shared<masked_csr_t>(proc, CSR_HCOUNTEREN, counteren_mask, 0);
388389
htimedelta = std::make_shared<basic_csr_t>(proc, CSR_HTIMEDELTA, 0);

0 commit comments

Comments
 (0)