Messages in this thread | | | Date | Fri, 24 Oct 2003 00:57:50 -0700 | From | "David S. Miller" <> | Subject | Re: 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/
| |