From c658b94f6e8c206c59d02aa6fbac285b86b53d2c Mon Sep 17 00:00:00 2001 From: Andreas Färber Date: Mon, 27 May 2013 06:49:53 +0200 Subject: cpu: Turn cpu_unassigned_access() into a CPUState hook MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- target-mips/op_helper.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'target-mips/op_helper.c') diff --git a/target-mips/op_helper.c b/target-mips/op_helper.c index 3fa0d00cf9..f6838ecd5f 100644 --- a/target-mips/op_helper.c +++ b/target-mips/op_helper.c @@ -2147,13 +2147,18 @@ void tlb_fill(CPUMIPSState *env, target_ulong addr, int is_write, int mmu_idx, } } -void cpu_unassigned_access(CPUMIPSState *env, hwaddr addr, - int is_write, int is_exec, int unused, int size) +void mips_cpu_unassigned_access(CPUState *cs, hwaddr addr, + bool is_write, bool is_exec, int unused, + unsigned size) { - if (is_exec) + MIPSCPU *cpu = MIPS_CPU(cs); + CPUMIPSState *env = &cpu->env; + + if (is_exec) { helper_raise_exception(env, EXCP_IBE); - else + } else { helper_raise_exception(env, EXCP_DBE); + } } #endif /* !CONFIG_USER_ONLY */ -- cgit 1.4.1