From: liguang <lig.fnst@cn.fujitsu.com>
To: afaerber@suse.de, ehabkost@redhat.com, imammedo@redhat.com,
blauwirbel@gmail.com, jan.kiszka@siemens.com,
qemu-devel@nongnu.org
Cc: liguang <lig.fnst@cn.fujitsu.com>
Subject: [Qemu-devel] [PATCH 2/3] target-i386:make hw_breakpoint_enabled return bool type
Date: Thu, 6 Dec 2012 11:03:18 +0800 [thread overview]
Message-ID: <1354762999-4135-2-git-send-email-lig.fnst@cn.fujitsu.com> (raw)
In-Reply-To: <1354762999-4135-1-git-send-email-lig.fnst@cn.fujitsu.com>
Signed-off-by: liguang <lig.fnst@cn.fujitsu.com>
---
target-i386/cpu.h | 15 +++++++++++++--
1 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/target-i386/cpu.h b/target-i386/cpu.h
index 29245d1..3646128 100644
--- a/target-i386/cpu.h
+++ b/target-i386/cpu.h
@@ -996,9 +996,20 @@ int cpu_x86_handle_mmu_fault(CPUX86State *env, target_ulong addr,
#define cpu_handle_mmu_fault cpu_x86_handle_mmu_fault
void cpu_x86_set_a20(CPUX86State *env, int a20_state);
-static inline int hw_breakpoint_enabled(unsigned long dr7, int index)
+static inline bool hw_local_breakpoint_enabled(unsigned long dr7, int index)
{
- return (dr7 >> (index * 2)) & 3;
+ return !!((dr7 >> (index * 2)) & 1);
+}
+
+static inline bool hw_global_breakpoint_enabled(unsigned long dr7, int index)
+{
+ return !!((dr7 >> (index * 2)) & 2);
+}
+
+static inline bool hw_breakpoint_enabled(unsigned long dr7, int index)
+{
+ return (hw_global_breakpoint_enabled(dr7, index) ||
+ hw_local_breakpoint_enabled(dr7, index));
}
static inline int hw_breakpoint_type(unsigned long dr7, int index)
--
1.7.2.5
next prev parent reply other threads:[~2012-12-06 3:05 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-06 3:03 [Qemu-devel] [PATCH 1/3] target-i386:define name of breakpoint bit in dr7 liguang
2012-12-06 3:03 ` liguang [this message]
2012-12-06 3:03 ` [Qemu-devel] [PATCH 3/3] target-i386:slightly refactor dr7 related function liguang
2012-12-06 8:54 ` Peter Maydell
2012-12-06 9:16 ` li guang
2012-12-06 9:23 ` Peter Maydell
2012-12-06 9:27 ` li guang
2012-12-06 9:35 ` 陳韋任 (Wei-Ren Chen)
2012-12-06 9:36 ` Andreas Färber
2012-12-06 9:48 ` Peter Maydell
2012-12-06 9:57 ` Andreas Färber
2012-12-07 0:53 ` li guang
2012-12-06 9:44 ` Peter Maydell
-- strict thread matches above, loose matches on Subject: below --
2012-12-04 8:11 [Qemu-devel] [PATCH 1/3] target-i386:define name of breakpoint bit in dr7 liguang
2012-12-04 8:11 ` [Qemu-devel] [PATCH 2/3] target-i386:make hw_breakpoint_enabled return bool type liguang
2012-12-04 10:23 ` Peter Maydell
2012-12-04 11:11 ` Jan Kiszka
2012-12-04 11:26 ` Peter Maydell
2012-12-05 0:51 ` li guang
2012-12-05 8:53 ` Jan Kiszka
2012-12-06 2:08 ` li guang
2012-12-06 2:18 ` li guang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1354762999-4135-2-git-send-email-lig.fnst@cn.fujitsu.com \
--to=lig.fnst@cn.fujitsu.com \
--cc=afaerber@suse.de \
--cc=blauwirbel@gmail.com \
--cc=ehabkost@redhat.com \
--cc=imammedo@redhat.com \
--cc=jan.kiszka@siemens.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).