All of lore.kernel.org
 help / color / mirror / Atom feed
From: "David S. Miller" <davem@redhat.com>
To: "Randall Hyde" <randyhyde@earthlink.net>
Cc: linux-kernel@vger.kernel.org
Subject: Re: mmap to Access PCI space?
Date: Fri, 24 Oct 2003 00:57:50 -0700	[thread overview]
Message-ID: <20031024005750.114ab4fb.davem@redhat.com> (raw)
In-Reply-To: <06d801c399df$f8af9880$6501a8c0@rhyde>

On Thu, 23 Oct 2003 20:36:12 -0700
"Randall Hyde" <randyhyde@earthlink.net> wrote:

> I need to access a couple of SATA chips from a user-mode
> program (yep, running as root). I know for a fact that my
> chip resides at address 0xfc300000 (/proc/iomem and /proc/ide/siimage
> tells me this).  Can I do a mmap like the following to access the registers
> on ths chip?
> 
> fdDevMem = open( "/dev/mem", O_RDWR );
> ptr =
>     mmap
>     (
>         NULL,
>         4096,
>         PROT_READ | PROT_WRITE,
>         MAP_SHARED,
>         fdDevMem,
>         0xfc300000
>     );

That's not portable and will only work on a few platforms.
Please use mmap() and ioctl() operations on /proc/bus/pci/*
nodes to accomplish your task.

  reply	other threads:[~2003-10-24  7:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-24  3:10 2.6.0-test8 scsi logging not working jtholmesjr
2003-10-24  3:36 ` mmap to Access PCI space? Randall Hyde
2003-10-24  7:57   ` David S. Miller [this message]
2003-10-24  5:17 ` 2.6.0-test8 scsi logging not working Mike Anderson

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=20031024005750.114ab4fb.davem@redhat.com \
    --to=davem@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=randyhyde@earthlink.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.