summaryrefslogtreecommitdiff
path: root/memory.c
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2013-05-27 06:49:53 +0200
committerAndreas Färber <afaerber@suse.de>2013-06-28 13:25:13 +0200
commitc658b94f6e8c206c59d02aa6fbac285b86b53d2c (patch)
tree100efd8e543a576daa8d7dc6684ce1154ea08245 /memory.c
parentce927ed9e40e25008453eb8f130661514b633341 (diff)
downloadqemu-c658b94f6e8c206c59d02aa6fbac285b86b53d2c.tar.gz
qemu-c658b94f6e8c206c59d02aa6fbac285b86b53d2c.tar.bz2
qemu-c658b94f6e8c206c59d02aa6fbac285b86b53d2c.zip
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 'memory.c')
-rw-r--r--memory.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/memory.c b/memory.c
index 47b005a558..757e9a5592 100644
--- a/memory.c
+++ b/memory.c
@@ -855,9 +855,10 @@ static uint64_t unassigned_mem_read(void *opaque, hwaddr addr,
#ifdef DEBUG_UNASSIGNED
printf("Unassigned mem read " TARGET_FMT_plx "\n", addr);
#endif
-#if defined(TARGET_ALPHA) || defined(TARGET_SPARC) || defined(TARGET_MICROBLAZE)
- cpu_unassigned_access(cpu_single_env, addr, 0, 0, 0, size);
-#endif
+ if (cpu_single_env != NULL) {
+ cpu_unassigned_access(ENV_GET_CPU(cpu_single_env),
+ addr, false, false, 0, size);
+ }
return 0;
}
@@ -867,9 +868,10 @@ static void unassigned_mem_write(void *opaque, hwaddr addr,
#ifdef DEBUG_UNASSIGNED
printf("Unassigned mem write " TARGET_FMT_plx " = 0x%"PRIx64"\n", addr, val);
#endif
-#if defined(TARGET_ALPHA) || defined(TARGET_SPARC) || defined(TARGET_MICROBLAZE)
- cpu_unassigned_access(cpu_single_env, addr, 1, 0, 0, size);
-#endif
+ if (cpu_single_env != NULL) {
+ cpu_unassigned_access(ENV_GET_CPU(cpu_single_env),
+ addr, true, false, 0, size);
+ }
}
static bool unassigned_mem_accepts(void *opaque, hwaddr addr,