What is the reel purpose of in_beXX() and out_beXX() fonctions ?

David Laight David.Laight at ACULAB.COM
Tue Oct 28 02:05:25 AEDT 2014

From: leroy christophe
> Many drivers use in_be16(), in_be32(), out_be16(), out_be32(), etc ....
> to access to registrers in IO mapped memory.
> What is the real purpose of those functions, and are they really needed ?
> ioremap() maps the related areas as GUARDED, which means that accesses
> can't be speculative. So what is the benefit of using in_beXX() and
> out_beXX() over simple memory accesses in the area ?

Some architectures might need to use specific instruction to access
io space (eg sparc might need to supply a specific 'address modifier').

Special instructions might be needed to perform a 'big endian' access.

Unfortunately the functions sometimes contain additional (often unneeded)
sequencing instructions - the driver may be able to perform multiple
operations between the sequencing instructions.


More information about the Linuxppc-dev mailing list