Browse Source
Use new require_alignment flag to simplify AMO check
pull/592/head
Scott Johnson
6 years ago
No known key found for this signature in database
GPG Key ID: 61C1F01D3D1410C9
1 changed files with
1 additions and
3 deletions
-
riscv/mmu.h
|
|
|
@ -191,10 +191,8 @@ public: |
|
|
|
#define amo_func(type) \ |
|
|
|
template<typename op> \ |
|
|
|
type##_t amo_##type(reg_t addr, op f) { \ |
|
|
|
if (addr & (sizeof(type##_t)-1)) \ |
|
|
|
throw trap_store_address_misaligned(addr, 0, 0); \ |
|
|
|
try { \ |
|
|
|
auto lhs = load_##type(addr, false); \ |
|
|
|
auto lhs = load_##type(addr, true); \ |
|
|
|
store_##type(addr, f(lhs)); \ |
|
|
|
return lhs; \ |
|
|
|
} catch (trap_load_page_fault& t) { \ |
|
|
|
|