lkml.org 
[lkml]   [2003]   [Oct]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: mmap to Access PCI space?
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.
-
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/
\
 
 \ /
  Last update: 2005-03-22 13:58    [from the cache]
©2003-2011 Jasper Spaans