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

Re: [Xen-devel] [PATCH for-4.5 v6 17/17] tools/tests: Enable xen-access on ARM





On Thu, Sep 18, 2014 at 9:02 PM, Ian Campbell <ian.campbell@xxxxxxxxxx> wrote:
On Mon, 2014-09-15 at 16:02 +0200, Tamas K Lengyel wrote:
> +static inline int test_and_set_bit(int nr, volatile void *addr)
> +{
> +        unsigned int mask = BIT_MASK(nr);
> +        volatile unsigned int *p =
> +                ((volatile unsigned int *)addr) + BIT_WORD(nr);
> +        unsigned int old = *p;
> +
> +        *p = old | mask;
> +        return (old & mask) != 0;
> +}

This doesn't need to be / is not intended to be atomic, right?

This function I took from xen/include/asm-arm/bitops.h directly. Since the x86 assembly is missing "lock;" I assume this doesn't need to be atomic but I may be wrong. However, in case the x86 assembly should actually have "lock;" similarly to how it is in xen/include/asm-x86/bitops.h, then the ARM side should be atomic too AFAIU. Do we have an atomic test_and_set_bit implementation for ARM laying around somewhere?

Tamas

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.