Re: [patch v3 24/36] Hexagon: Provide basic implementation and/or stubs for I/O routines.

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

 



On Thu, Sep 08, 2011 at 08:09:11PM -0500, Richard Kuo wrote:
> +	asm volatile(
> +		"memb(%0) = %1;"
> +		:
> +		: "r" (addr), "r" (data)
> +	);

I'm kind-of vague on this, but I think that this also needs a
: "memory" at the end (to indicate that the asm snippet clobbers
memory), as otherwise the compiler may be tempted to reorder
these around other memory accesses. That is, the "volatile"
keyword is not enough (well, I'm not sure...), but I think
"volatile" only prevents the compiler from optimizing these
away completely, but is not enough to prevent unwanted
re-ordering.

--linas

-- 
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
--
To unsubscribe from this list: send the line "unsubscribe linux-arch" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux