diff options
author | Richard Henderson <rth@twiddle.net> | 2011-04-18 16:13:12 -0700 |
---|---|---|
committer | Richard Henderson <rth@anchor.twiddle.net> | 2011-05-31 10:18:06 -0700 |
commit | 5b4504079a3bc37f85cce44e77c347e9ec742307 (patch) | |
tree | ee69b7b2af2776f124202e575528f585d485d267 /target-alpha/op_helper.c | |
parent | fa6e0a6354539582ae98c232982070d99ea14770 (diff) |
target-alpha: Trap for unassigned and unaligned addresses.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'target-alpha/op_helper.c')
-rw-r--r-- | target-alpha/op_helper.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/target-alpha/op_helper.c b/target-alpha/op_helper.c index 03b5091234..91ef90a07c 100644 --- a/target-alpha/op_helper.c +++ b/target-alpha/op_helper.c @@ -1265,7 +1265,33 @@ uint64_t helper_stq_c_phys(uint64_t p, uint64_t v) return ret; } +static void QEMU_NORETURN do_unaligned_access(target_ulong addr, int is_write, + int is_user, void *retaddr) +{ + uint64_t pc; + uint32_t insn; + + do_restore_state(retaddr); + + pc = env->pc; + insn = ldl_code(pc); + + env->trap_arg0 = addr; + env->trap_arg1 = insn >> 26; /* opcode */ + env->trap_arg2 = (insn >> 21) & 31; /* dest regno */ + helper_excp(EXCP_UNALIGN, 0); +} + +void QEMU_NORETURN do_unassigned_access(target_phys_addr_t addr, int is_write, + int is_exec, int unused, int size) +{ + env->trap_arg0 = addr; + env->trap_arg1 = is_write; + dynamic_excp(EXCP_MCHK, 0); +} + #define MMUSUFFIX _mmu +#define ALIGNED_ONLY #define SHIFT 0 #include "softmmu_template.h" |