Re: write[blw] vs memcpy?

Gerard Roudier (groudier@club-internet.fr)
Sun, 5 Apr 1998 14:39:29 +0200 (MET DST)


On Sun, 5 Apr 1998 ralf@uni-koblenz.de wrote:

> Finally there is no need to rely on {read,write}[bwl]. There are special
> purpose I/O copy functions available, memset_io(), memcpy_fromio() and
> memcpy_toio() which will do the job efficient and portable.

The opposite of the above is just my opinion.
{read, write}[bwl] are implement as inline functions and allow to
access 1 [bwl] at a time as faster as possible and atomically for
bus like PCI that ensure atomic aligned DWORD accesses.
For these 2 reasons, I think they are absolutely needed.
Their semantic does not prevent from writing portable code.
I don't care about architecture that does not allow to use MMIO without
taking risks of ordering problems or non atomic accesses.
Drivers must have some handle on actual arch limitations or features in
order to make things smart when it is possible, and poor when nothing
better can be done.
Stupid portability is not the way to go, IMHO.

Gerard.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu