Re: [patch 1/3] IA64: Slim down __clear_bit_unlock

From: Zoltan Menyhart <Zoltan.Menyhart_at_bull.net>
Date: 2007-11-22 19:40:16
Almost there :-)

> +static __inline__ void
> +__clear_bit_unlock(int nr, volatile void *addr)
> +{
> +	__u32 mask, new;
> +	volatile __u32 *m;
> +
> +	m = (volatile __u32 *)addr + (nr >> 5);

Still cannot see why you need an ".acq" on this load.
Why do you use "volatile"?

What about this one?

static __inline__ void
__clear_bit_unlock(int const nr, void * const addr)
{
        __u32 * const m = addr + (nr >> 5);
        __u32 new;

        new = *m & ~(1 << (nr & 31));
        barrier();
        asm volatile ("st4.rel.nta [%0] = %1\n\t" :: "r"(m), "r"(new));
}

Thanks,

Zoltan Menyhart
-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Thu Nov 22 19:40:44 2007

This archive was generated by hypermail 2.1.8 : 2007-11-22 19:41:07 EST