diff options
author | Blue Swirl <blauwirbel@gmail.com> | 2011-07-03 08:53:46 +0000 |
---|---|---|
committer | Blue Swirl <blauwirbel@gmail.com> | 2011-07-20 21:28:08 +0000 |
commit | b14ef7c9ab41ea824c3ccadb070ad95567cca84e (patch) | |
tree | 87d72668e2e096e80b8e60ddddd2ddd82c20a9e2 /target-microblaze | |
parent | 21673cdecb9e9b5a22acaf0a44e47145beb1999e (diff) | |
download | qemu-b14ef7c9ab41ea824c3ccadb070ad95567cca84e.zip qemu-b14ef7c9ab41ea824c3ccadb070ad95567cca84e.tar.gz qemu-b14ef7c9ab41ea824c3ccadb070ad95567cca84e.tar.bz2 |
Fix unassigned memory access handling
cea5f9a28faa528b6b1b117c9ab2d8828f473fef 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>
Diffstat (limited to 'target-microblaze')
-rw-r--r-- | target-microblaze/cpu.h | 4 | ||||
-rw-r--r-- | target-microblaze/op_helper.c | 14 |
2 files changed, 6 insertions, 12 deletions
diff --git a/target-microblaze/cpu.h b/target-microblaze/cpu.h index 51a13e3..76f4fc4 100644 --- a/target-microblaze/cpu.h +++ b/target-microblaze/cpu.h @@ -347,8 +347,8 @@ static inline void cpu_get_tb_cpu_state(CPUState *env, target_ulong *pc, } #if !defined(CONFIG_USER_ONLY) -void do_unassigned_access(target_phys_addr_t addr, int is_write, int is_exec, - int is_asi, int size); +void cpu_unassigned_access(CPUState *env1, target_phys_addr_t addr, + int is_write, int is_exec, int is_asi, int size); #endif static inline bool cpu_has_work(CPUState *env) diff --git a/target-microblaze/op_helper.c b/target-microblaze/op_helper.c index 1a0a476..664ffe59 100644 --- a/target-microblaze/op_helper.c +++ b/target-microblaze/op_helper.c @@ -488,20 +488,14 @@ void helper_mmu_write(uint32_t rn, uint32_t v) mmu_write(env, rn, v); } -void do_unassigned_access(target_phys_addr_t addr, int is_write, int is_exec, - int is_asi, int size) +void cpu_unassigned_access(CPUState *env1, target_phys_addr_t addr, + int is_write, int is_exec, int is_asi, int size) { CPUState *saved_env; - if (!cpu_single_env) { - /* XXX: ??? */ - return; - } - - /* XXX: hack to restore env in all cases, even if not called from - generated code */ saved_env = env; - env = cpu_single_env; + env = env1; + 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)) { |