From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43535) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TfqPZ-0000Wo-77 for qemu-devel@nongnu.org; Tue, 04 Dec 2012 06:11:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TfqPU-0007GQ-Qz for qemu-devel@nongnu.org; Tue, 04 Dec 2012 06:11:37 -0500 Received: from david.siemens.de ([192.35.17.14]:19300) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TfqPU-0007G4-IB for qemu-devel@nongnu.org; Tue, 04 Dec 2012 06:11:32 -0500 Message-ID: <50BDDA54.9020000@siemens.com> Date: Tue, 04 Dec 2012 12:11:16 +0100 From: Jan Kiszka MIME-Version: 1.0 References: <1354608695-3232-1-git-send-email-lig.fnst@cn.fujitsu.com> <1354608695-3232-2-git-send-email-lig.fnst@cn.fujitsu.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/3] target-i386:make hw_breakpoint_enabled return bool type List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: "ehabkost@redhat.com" , "qemu-devel@nongnu.org" , "blauwirbel@gmail.com" , "imammedo@redhat.com" , "afaerber@suse.de" , liguang On 2012-12-04 11:23, Peter Maydell wrote: > On 4 December 2012 08:11, liguang wrote: >> Signed-off-by: liguang >> --- >> target-i386/cpu.h | 4 ++-- >> 1 files changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/target-i386/cpu.h b/target-i386/cpu.h >> index 9abec3e..8ca25c8 100644 >> --- a/target-i386/cpu.h >> +++ b/target-i386/cpu.h >> @@ -996,9 +996,9 @@ 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_breakpoint_enabled(unsigned long dr7, int index) >> { >> - return (dr7 >> (index * 2)) & 3; >> + return !!((dr7 >> (index * 2)) & 3); >> } >> >> static inline int hw_breakpoint_type(unsigned long dr7, int index) > > Doesn't this break the use of this function in target-i386/seg_helper.c: > > if (hw_breakpoint_enabled(env->dr[7], i) == 0x1) { > > which specifically wants to determine whether the breakpoint is > enabled only locally? It does. And that also indicates the function is misnamed. Something like hw_breakpoint_state might be better. Jan -- Siemens AG, Corporate Technology, CT RTC ITP SDP-DE Corporate Competence Center Embedded Linux