
15 Jan
2011
15 Jan
'11
midnight
Hello,
Le 14/01/2011 23:39, Tom Warren a écrit :
So instead of, say uart->lcr = 0, you'd prefer writel(0, uart->lcr), where writel = __arch_putl(v, a) = (*(volatile unsigned int *)(a) = (v))? Is that different enough from 'uart->lcr = 0' to warrant the change? Does it add some HW barriers or forced read-before-write that the 'volatile' struct doesn't?
writel() and readl() do not introduce "read-before-write", that is, they do not perform any more than what their names imply, but yes they do introduce barriers, or more precisely, they force the compiler to do so.
Amicalement,
--
Albert.