Fix unassigned memory access handling

cea5f9a28f exposed bugs in unassigned memory
access handling. Fix them by always passing CPUState to the handlers.

Reported-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
Blue Swirl 2011-07-03 08:53:46 +00:00
parent 21673cdecb
commit b14ef7c9ab
10 changed files with 48 additions and 35 deletions

View file

@ -434,8 +434,9 @@ uint64_t cpu_alpha_load_fpcr (CPUState *env);
void cpu_alpha_store_fpcr (CPUState *env, uint64_t val);
#ifndef CONFIG_USER_ONLY
void swap_shadow_regs(CPUState *env);
extern QEMU_NORETURN void do_unassigned_access(target_phys_addr_t addr,
int, int, int, int);
QEMU_NORETURN void cpu_unassigned_access(CPUState *env1,
target_phys_addr_t addr, int is_write,
int is_exec, int unused, int size);
#endif
/* Bits in TB->FLAGS that control how translation is processed. */

View file

@ -1301,9 +1301,11 @@ static void QEMU_NORETURN do_unaligned_access(target_ulong addr, int is_write,
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)
void QEMU_NORETURN cpu_unassigned_access(CPUState *env1,
target_phys_addr_t addr, int is_write,
int is_exec, int unused, int size)
{
env = env1;
env->trap_arg0 = addr;
env->trap_arg1 = is_write;
dynamic_excp(EXCP_MCHK, 0);