From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:48289) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TthHF-000535-NC for qemu-devel@nongnu.org; Fri, 11 Jan 2013 11:16:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TthHA-00048W-3H for qemu-devel@nongnu.org; Fri, 11 Jan 2013 11:16:17 -0500 Received: from cantor2.suse.de ([195.135.220.15]:40646 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TthH9-00048G-Pi for qemu-devel@nongnu.org; Fri, 11 Jan 2013 11:16:12 -0500 Message-ID: <50F03AC8.9090603@suse.de> Date: Fri, 11 Jan 2013 17:16:08 +0100 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1355106144-30846-1-git-send-email-lig.fnst@cn.fujitsu.com> <1355106144-30846-2-git-send-email-lig.fnst@cn.fujitsu.com> In-Reply-To: <1355106144-30846-2-git-send-email-lig.fnst@cn.fujitsu.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v4 2/3] target-i386:define hw_{global, local}breakpoint_enabled function List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: liguang Cc: Peter Maydell , imammedo@redhat.com, Jan Kiszka , ehabkost@redhat.com, qemu-devel@nongnu.org Am 10.12.2012 03:22, schrieb liguang: > Signed-off-by: liguang > --- > target-i386/cpu.h | 15 +++++++++++++-- > 1 files changed, 13 insertions(+), 2 deletions(-) >=20 > diff --git a/target-i386/cpu.h b/target-i386/cpu.h > index 29245d1..c69f81f 100644 > --- a/target-i386/cpu.h > +++ b/target-i386/cpu.h > @@ -996,9 +996,20 @@ int cpu_x86_handle_mmu_fault(CPUX86State *env, tar= get_ulong addr, > #define cpu_handle_mmu_fault cpu_x86_handle_mmu_fault > void cpu_x86_set_a20(CPUX86State *env, int a20_state); > =20 > -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); There's no need to add parenthesis around this expression. Shouldn't this ... > +} > + > +static inline bool hw_global_breakpoint_enabled(unsigned long dr7, int= index) > +{ > + return ((dr7 >> (index * 2)) & 2); ... and this use defines from 1/3 now rather than magic numbers? Otherwise the logic seems to match what was discussed. Andreas > +} > + > +static inline bool hw_breakpoint_enabled(unsigned long dr7, int index) > +{ > + return (hw_global_breakpoint_enabled(dr7, index) || > + hw_local_breakpoint_enabled(dr7, index)); > } > =20 > static inline int hw_breakpoint_type(unsigned long dr7, int index) --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg