public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel Stodden <stodden@in.tum.de>
To: Linux Kernel <linux-kernel@vger.kernel.org>
Subject: read()/write() vs. ptr dereference question
Date: 09 Feb 2002 08:26:22 +0100	[thread overview]
Message-ID: <1013239582.725.43.camel@bitch> (raw)

[-- Attachment #1: Type: text/plain, Size: 1217 bytes --]


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



[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 232 bytes --]

                 reply	other threads:[~2002-02-09  7:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1013239582.725.43.camel@bitch \
    --to=stodden@in.tum.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox