diff options
author | Edgar E. Iglesias <edgar.iglesias@gmail.com> | 2009-09-11 10:27:38 +0200 |
---|---|---|
committer | Edgar E. Iglesias <edgar.iglesias@gmail.com> | 2009-09-11 10:27:38 +0200 |
commit | 97f90cbfe810bb153fc44bde732d9639610783bb (patch) | |
tree | 05e350cec20ee874ec976bf1a4dc07100c39209c /target-microblaze/op_helper.c | |
parent | 487a4d60bc7287bee40926ef4509bc94aa27bbf3 (diff) |
microblaze: HW Exception fixes.
* Correct PVR checks for masking off individual exceptions.
* Correct FPU exception code.
* Set EAR on unaligned and unassigned exceptions.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Diffstat (limited to 'target-microblaze/op_helper.c')
-rw-r--r-- | target-microblaze/op_helper.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/target-microblaze/op_helper.c b/target-microblaze/op_helper.c index 89dbc0c0ec..ee4f623131 100644 --- a/target-microblaze/op_helper.c +++ b/target-microblaze/op_helper.c @@ -209,17 +209,18 @@ uint32_t helper_pcmpbf(uint32_t a, uint32_t b) void helper_memalign(uint32_t addr, uint32_t dr, uint32_t wr, uint32_t mask) { if (addr & mask) { - qemu_log("unaligned access addr=%x mask=%x, wr=%d\n", - addr, mask, wr); - if (!(env->sregs[SR_MSR] & MSR_EE)) { - return; - } - + qemu_log_mask(CPU_LOG_INT, + "unaligned access addr=%x mask=%x, wr=%d dr=r%d\n", + addr, mask, wr, dr); + env->sregs[SR_EAR] = addr; env->sregs[SR_ESR] = ESR_EC_UNALIGNED_DATA | (wr << 10) \ | (dr & 31) << 5; if (mask == 3) { env->sregs[SR_ESR] |= 1 << 11; } + if (!(env->sregs[SR_MSR] & MSR_EE)) { + return; + } helper_raise_exception(EXCP_HW_EXCP); } } @@ -245,19 +246,20 @@ void do_unassigned_access(target_phys_addr_t addr, int is_write, int is_exec, generated code */ saved_env = env; env = cpu_single_env; - qemu_log("Unassigned " TARGET_FMT_plx " wr=%d exe=%d\n", + qemu_log_mask(CPU_LOG_INT, "Unassigned " TARGET_FMT_plx " wr=%d exe=%d\n", addr, is_write, is_exec); if (!(env->sregs[SR_MSR] & MSR_EE)) { return; } + env->sregs[SR_EAR] = addr; if (is_exec) { - if (!(env->pvr.regs[2] & PVR2_IOPB_BUS_EXC_MASK)) { + if ((env->pvr.regs[2] & PVR2_IOPB_BUS_EXC_MASK)) { env->sregs[SR_ESR] = ESR_EC_INSN_BUS; helper_raise_exception(EXCP_HW_EXCP); } } else { - if (!(env->pvr.regs[2] & PVR2_DOPB_BUS_EXC_MASK)) { + if ((env->pvr.regs[2] & PVR2_DOPB_BUS_EXC_MASK)) { env->sregs[SR_ESR] = ESR_EC_DATA_BUS; helper_raise_exception(EXCP_HW_EXCP); } |