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-alpha | |
parent | ce927ed9e40e25008453eb8f130661514b633341 (diff) | |
download | qemu-c658b94f6e8c206c59d02aa6fbac285b86b53d2c.zip qemu-c658b94f6e8c206c59d02aa6fbac285b86b53d2c.tar.gz qemu-c658b94f6e8c206c59d02aa6fbac285b86b53d2c.tar.bz2 |
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-alpha')
-rw-r--r-- | target-alpha/cpu.c | 1 | ||||
-rw-r--r-- | target-alpha/cpu.h | 6 | ||||
-rw-r--r-- | target-alpha/mem_helper.c | 10 |
3 files changed, 11 insertions, 6 deletions
diff --git a/target-alpha/cpu.c b/target-alpha/cpu.c index 4e62eaf..2670805 100644 --- a/target-alpha/cpu.c +++ b/target-alpha/cpu.c @@ -263,6 +263,7 @@ static void alpha_cpu_class_init(ObjectClass *oc, void *data) cc->class_by_name = alpha_cpu_class_by_name; cc->do_interrupt = alpha_cpu_do_interrupt; cc->dump_state = alpha_cpu_dump_state; + cpu_class_set_do_unassigned_access(cc, alpha_cpu_unassigned_access); device_class_set_vmsd(dc, &vmstate_alpha_cpu); } diff --git a/target-alpha/cpu.h b/target-alpha/cpu.h index 2156a1e..01f4ebb 100644 --- a/target-alpha/cpu.h +++ b/target-alpha/cpu.h @@ -457,9 +457,9 @@ uint64_t cpu_alpha_load_fpcr (CPUAlphaState *env); void cpu_alpha_store_fpcr (CPUAlphaState *env, uint64_t val); #ifndef CONFIG_USER_ONLY void swap_shadow_regs(CPUAlphaState *env); -QEMU_NORETURN void cpu_unassigned_access(CPUAlphaState *env1, - hwaddr addr, int is_write, - int is_exec, int unused, int size); +QEMU_NORETURN void alpha_cpu_unassigned_access(CPUState *cpu, hwaddr addr, + bool is_write, bool is_exec, + int unused, unsigned size); #endif /* Bits in TB->FLAGS that control how translation is processed. */ diff --git a/target-alpha/mem_helper.c b/target-alpha/mem_helper.c index 3d2cd61..7160a1c 100644 --- a/target-alpha/mem_helper.c +++ b/target-alpha/mem_helper.c @@ -109,11 +109,15 @@ static void do_unaligned_access(CPUAlphaState *env, target_ulong addr, cpu_loop_exit(env); } -void cpu_unassigned_access(CPUAlphaState *env, hwaddr addr, - int is_write, int is_exec, int unused, int size) +void alpha_cpu_unassigned_access(CPUState *cs, hwaddr addr, + bool is_write, bool is_exec, int unused, + unsigned size) { + AlphaCPU *cpu = ALPHA_CPU(cs); + CPUAlphaState *env = &cpu->env; + env->trap_arg0 = addr; - env->trap_arg1 = is_write; + env->trap_arg1 = is_write ? 1 : 0; dynamic_excp(env, 0, EXCP_MCHK, 0); } |