read()/write() vs. ptr dereference question

Daniel Stodden (stodden@in.tum.de)
09 Feb 2002 08:26:22 +0100


--=-hLjaGY05eF3JXyyTxNnT
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

hi.

as correctly pointed out throughout the relevant literature, accessing
I/O memory through lame pointer dereferences is not portable and on
linux use of read()/write() instead is highly recommended.

i've come across an application where some piece of code expects some
piece of memory (RAM) returned from some other piece of code and the
latter one might actually benefit from pointing at something not memory
but rather something located in PCI memory space instead.=20

i'm currently mostly concerned about intel and ppc and obviously it will
be okay there. otoh, sparc may be of future interest. i don't know too
much about sparc but according to the headers sparc64 definitely won't
work.
(right here? or would it work and io.h uses just a better alternative?)

my main question regarding portability is: is there some kind of macro
anywhere, like #if __IO_AND_PHYS_LOOK_THE_SAME, which i just haven't
found yet or do i need to explicitly check for any arch in question?

[or: should such a macro exist? might somehow clean up the headers a
little...]

thanx,
daniel

--=20
___________________________________________________________________________
mailto:stodden@in.tum.de

--=-hLjaGY05eF3JXyyTxNnT
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQA8ZM8dSPSplX5M5nQRAqU9AJ4tBsIDrd4BjYbPkxUohft+fxNdTQCfVS4f
LE0PM9oAtdUnMjoX1YL+x9c=
=OLaI
-----END PGP SIGNATURE-----

--=-hLjaGY05eF3JXyyTxNnT--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/