summaryrefslogtreecommitdiffstats
path: root/target-i386/helper.c
diff options
context:
space:
mode:
authorAndreas Färber2013-09-02 16:57:02 +0200
committerAndreas Färber2014-03-13 19:20:48 +0100
commit75a34036d43dc961cbef2a4705682d0666caf384 (patch)
tree6397134c9dd534fee3ea7a2f2db6d01be6cf03e6 /target-i386/helper.c
parenttarget-ppc: Use PowerPCCPU in PowerPCCPUClass::handle_mmu_fault hook (diff)
downloadqemu-75a34036d43dc961cbef2a4705682d0666caf384.tar.gz
qemu-75a34036d43dc961cbef2a4705682d0666caf384.tar.xz
qemu-75a34036d43dc961cbef2a4705682d0666caf384.zip
exec: Change cpu_watchpoint_{insert,remove{,_by_ref,_all}} argument
Use CPUState. This lets us drop a few local env usages. Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'target-i386/helper.c')
-rw-r--r--target-i386/helper.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/target-i386/helper.c b/target-i386/helper.c
index cb29aa4b0e..dd6d824010 100644
--- a/target-i386/helper.c
+++ b/target-i386/helper.c
@@ -993,6 +993,7 @@ hwaddr x86_cpu_get_phys_page_debug(CPUState *cs, vaddr addr)
void hw_breakpoint_insert(CPUX86State *env, int index)
{
+ CPUState *cs = CPU(x86_env_get_cpu(env));
int type = 0, err = 0;
switch (hw_breakpoint_type(env->dr[7], index)) {
@@ -1014,7 +1015,7 @@ void hw_breakpoint_insert(CPUX86State *env, int index)
}
if (type != 0) {
- err = cpu_watchpoint_insert(env, env->dr[index],
+ err = cpu_watchpoint_insert(cs, env->dr[index],
hw_breakpoint_len(env->dr[7], index),
type, &env->cpu_watchpoint[index]);
}
@@ -1026,8 +1027,12 @@ void hw_breakpoint_insert(CPUX86State *env, int index)
void hw_breakpoint_remove(CPUX86State *env, int index)
{
- if (!env->cpu_breakpoint[index])
+ CPUState *cs;
+
+ if (!env->cpu_breakpoint[index]) {
return;
+ }
+ cs = CPU(x86_env_get_cpu(env));
switch (hw_breakpoint_type(env->dr[7], index)) {
case DR7_TYPE_BP_INST:
if (hw_breakpoint_enabled(env->dr[7], index)) {
@@ -1036,7 +1041,7 @@ void hw_breakpoint_remove(CPUX86State *env, int index)
break;
case DR7_TYPE_DATA_WR:
case DR7_TYPE_DATA_RW:
- cpu_watchpoint_remove_by_ref(env, env->cpu_watchpoint[index]);
+ cpu_watchpoint_remove_by_ref(cs, env->cpu_watchpoint[index]);
break;
case DR7_TYPE_IO_RW:
/* No support for I/O watchpoints yet */