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

From: Daniel Stodden (stodden@in.tum.de)
Date: Sat Feb 09 2002 - 02:26:22 EST


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.

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

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


- 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/



This archive was generated by hypermail 2b29 : Fri Feb 15 2002 - 21:00:25 EST