qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 2/2] Xen: Add xen-apic support and hook it up.


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH 2/2] Xen: Add xen-apic support and hook it up.
Date: Wed, 11 Apr 2012 17:23:05 +0100

On 11 April 2012 17:13, Jan Kiszka <address@hidden> wrote:
> On 2012-04-11 18:07, Peter Maydell wrote:
>>> +#include "hw/apic_internal.h"
>>> +#include "hw/msi.h"
>>> +#include "xen.h"
>>> +
>>> +static uint64_t xen_apic_mem_read(void *opaque, target_phys_addr_t addr,
>>> +                                  unsigned size)
>>> +{
>>> +    return -1U;
>>> +}
>>
>> This seems a rather confusing way to write 'return 0xffffffff;'
>
> You mean 0xffffffffffffffff? :)

No, that's why it's confusing :-)

1U is the integer constant 1 with a type of 'unsigned int'
(cf C99 section 6.4.4.1). It then has the unary negation
operator applied to it, giving (for the usual 32 bit integer
case) 0xffffffff. This is then cast from 'unsigned int'
to 'uint64_t' giving 0xffffffff as a 64 bit unsigned value.

(I had to write a test program to (a) confirm what it was
going to return and (b) that it would be the same thing on
both 32 and 64 bit systems...)

I have no opinion on what the return value actually ought
to be.

-- PMM



reply via email to

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