diff options
author | Andreas Färber <afaerber@suse.de> | 2013-05-27 06:49:53 +0200 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2013-06-28 13:25:13 +0200 |
commit | c658b94f6e8c206c59d02aa6fbac285b86b53d2c (patch) | |
tree | 100efd8e543a576daa8d7dc6684ce1154ea08245 /target-microblaze/op_helper.c | |
parent | ce927ed9e40e25008453eb8f130661514b633341 (diff) |
cpu: Turn cpu_unassigned_access() into a CPUState hook
Use it for all targets, but be careful not to pass invalid CPUState.
cpu_single_env can be NULL, e.g. on Xen.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'target-microblaze/op_helper.c')
-rw-r--r-- | target-microblaze/op_helper.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/target-microblaze/op_helper.c b/target-microblaze/op_helper.c index f2cb88b3ed..14baa84c74 100644 --- a/target-microblaze/op_helper.c +++ b/target-microblaze/op_helper.c @@ -495,12 +495,21 @@ void helper_mmu_write(CPUMBState *env, uint32_t rn, uint32_t v) mmu_write(env, rn, v); } -void cpu_unassigned_access(CPUMBState *env, hwaddr addr, - int is_write, int is_exec, int is_asi, int size) +void mb_cpu_unassigned_access(CPUState *cs, hwaddr addr, + bool is_write, bool is_exec, int is_asi, + unsigned size) { + MicroBlazeCPU *cpu; + CPUMBState *env; + qemu_log_mask(CPU_LOG_INT, "Unassigned " TARGET_FMT_plx " wr=%d exe=%d\n", - addr, is_write, is_exec); - if (!env || !(env->sregs[SR_MSR] & MSR_EE)) { + addr, is_write ? 1 : 0, is_exec ? 1 : 0); + if (cs == NULL) { + return; + } + cpu = MICROBLAZE_CPU(cs); + env = &cpu->env; + if (!(env->sregs[SR_MSR] & MSR_EE)) { return; } |