summaryrefslogtreecommitdiffstats
path: root/target-i386/seg_helper.c
diff options
context:
space:
mode:
authorliguang2013-01-15 08:01:07 +0100
committerAndreas Färber2013-01-15 09:14:48 +0100
commit5902564ac983d67d7d898356971698b50b8f0b91 (patch)
treec0be48fad1310fd7cf2daf0fafba0b132ba7236f /target-i386/seg_helper.c
parenttarget-i386: Define DR7 bit field constants (diff)
downloadqemu-5902564ac983d67d7d898356971698b50b8f0b91.tar.gz
qemu-5902564ac983d67d7d898356971698b50b8f0b91.tar.xz
qemu-5902564ac983d67d7d898356971698b50b8f0b91.zip
target-i386: Introduce hw_{local,global}_breakpoint_enabled()
hw_breakpoint_enabled() returned a bit field indicating whether a local breakpoint and/or global breakpoint was enabled. Avoid this number magic by using explicit boolean helper functions hw_local_breakpoint_enabled() and hw_global_breakpoint_enabled(), to aid readability. Reuse them for the hw_breakpoint_enabled() implementation and change its return type to bool. While at it, fix Coding Style issues (missing braces). Signed-off-by: liguang <lig.fnst@cn.fujitsu.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'target-i386/seg_helper.c')
-rw-r--r--target-i386/seg_helper.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/target-i386/seg_helper.c b/target-i386/seg_helper.c
index c40bd964c0..3247deeb60 100644
--- a/target-i386/seg_helper.c
+++ b/target-i386/seg_helper.c
@@ -467,7 +467,8 @@ static void switch_tss(CPUX86State *env, int tss_selector,
/* reset local breakpoints */
if (env->dr[7] & DR7_LOCAL_BP_MASK) {
for (i = 0; i < DR7_MAX_BP; i++) {
- if (hw_breakpoint_enabled(env->dr[7], i) == 0x1) {
+ if (hw_local_breakpoint_enabled(env->dr[7], i) &&
+ !hw_global_breakpoint_enabled(env->dr[7], i)) {
hw_breakpoint_remove(env, i);
}
}