From b724db52f9d7be3e3068e5bf01ac939ece8d032b Mon Sep 17 00:00:00 2001 From: YenHaoChen Date: Fri, 30 Sep 2022 11:48:44 +0800 Subject: Add has_data argument to trigger checking functions The mcontrol trigger can select either address or data for checking. The The selection decides the priority of the trigger. For instance, the address trigger has a higher priority over the page fault, and the page fault has a higher priority over the data trigger. The previous implementation only has the checking functions for data trigger, which results in incorrect priority of address trigger. This commit adds a has_data argument to indicate address trigger and the priority of the trigger. --- riscv/mmu.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'riscv/mmu.cc') diff --git a/riscv/mmu.cc b/riscv/mmu.cc index d0a55f0..0dbb94e 100644 --- a/riscv/mmu.cc +++ b/riscv/mmu.cc @@ -155,7 +155,7 @@ void mmu_t::load_slow_path(reg_t addr, reg_t len, uint8_t* bytes, uint32_t xlate if (!matched_trigger) { reg_t data = reg_from_bytes(len, bytes); - matched_trigger = trigger_exception(triggers::OPERATION_LOAD, addr, data); + matched_trigger = trigger_exception(triggers::OPERATION_LOAD, addr, true, data); if (matched_trigger) throw *matched_trigger; } @@ -167,7 +167,7 @@ void mmu_t::store_slow_path(reg_t addr, reg_t len, const uint8_t* bytes, uint32_ if (!matched_trigger) { reg_t data = reg_from_bytes(len, bytes); - matched_trigger = trigger_exception(triggers::OPERATION_STORE, addr, data); + matched_trigger = trigger_exception(triggers::OPERATION_STORE, addr, true, data); if (matched_trigger) throw *matched_trigger; } -- cgit v1.1