Browse Source
Correct AMO exception cause for misaligned accesses (#594)
Broken by 91092f21948ba2e77bfbc4629b82b6aa14d5ed6
pull/596/head
Scott Johnson
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
3 additions and
0 deletions
-
riscv/mmu.h
|
|
|
@ -195,6 +195,9 @@ public: |
|
|
|
auto lhs = load_##type(addr, true); \ |
|
|
|
store_##type(addr, f(lhs)); \ |
|
|
|
return lhs; \ |
|
|
|
} catch (trap_load_address_misaligned& t) { \ |
|
|
|
/* AMO faults should be reported as store faults */ \ |
|
|
|
throw trap_store_address_misaligned(t.get_tval(), t.get_tval2(), t.get_tinst()); \ |
|
|
|
} catch (trap_load_page_fault& t) { \ |
|
|
|
/* AMO faults should be reported as store faults */ \ |
|
|
|
throw trap_store_page_fault(t.get_tval(), t.get_tval2(), t.get_tinst()); \ |
|
|
|
|