linux-mips
[Top] [All Lists]

Re: mmap KSEG1

To: Ed Okerson <ed.okerson@gmail.com>
Subject: Re: mmap KSEG1
From: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Date: Fri, 4 Dec 2009 19:33:09 +0100
Cc: linux-mips@linux-mips.org
In-reply-to: <83f0348b0912040952h40d4d151n79ca5fc33a830ee2@mail.gmail.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <83f0348b0912040952h40d4d151n79ca5fc33a830ee2@mail.gmail.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.18 (2008-05-17)
On Fri, Dec 04, 2009 at 11:52:03AM -0600, Ed Okerson wrote:
> Is it possible to mmap an address in KSEG1 so a user space app can
> read/write to an IO device uncached?

well not exactly to KSEG1, since that is kernel exclusive address space,
but it's possible to map the physical address of the device:

Try

fd = open("/dev/mem", O_RDWR|O_SYNC);
io = mmap (NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, ioaddr);

where ioaddr is the physical address of the io device.

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessary a
good idea.                                                [ RFC1925, 2.3 ]

<Prev in Thread] Current Thread [Next in Thread>