qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 2/3] target-i386:make hw_breakpoint_enabled retu


From: Jan Kiszka
Subject: Re: [Qemu-devel] [PATCH 2/3] target-i386:make hw_breakpoint_enabled return bool type
Date: Tue, 04 Dec 2012 12:11:16 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666

On 2012-12-04 11:23, Peter Maydell wrote:
> On 4 December 2012 08:11, liguang <address@hidden> wrote:
>> Signed-off-by: liguang <address@hidden>
>> ---
>>  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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]