linux-mips
[Top] [All Lists]

Re: Why is mmap()ed reserved memory so slow?

To: Dan Malek <dan@embeddedalley.com>
Subject: Re: Why is mmap()ed reserved memory so slow?
From: David Chau <dchau@mazunetworks.com>
Date: Mon, 18 Jul 2005 10:44:00 -0400
Cc: linux-mips@linux-mips.org
In-reply-to: <dc678ee4c98d1fc3eb2cb1960b759f05@embeddedalley.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <42D836F8.8030209@mazunetworks.com> <dc678ee4c98d1fc3eb2cb1960b759f05@embeddedalley.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mozilla Thunderbird 1.0.2-1.3.3 (X11/20050513)
Dan Malek wrote:

How about a little more info, like what kernel are you using and what are
the parameters you are sending to mmap()?

Linux (none) 2.4.31 #412 SMP Fri Jul 15 16:26:05 EDT 2005 mips unknown
(unmodified kernel from linux-mips.org).
It's running on the SB1 on a Broadcom 1250 board.

I mmap() with:
int mem_fd = open("/dev/mem", O_RDWR);
void* mem_base =
   mmap(NULL, DRIVER_MEM_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED,
        mem_fd, DRIVER_MEM_PHYS_BASE);
Where driver_mem_phys_base = 253M, and driver_mem_size=1M.

The better way to approach this is to place an mmap() function in the
associated driver that works in conjunction with the application to gain
shared access as you expect.  This also closes a hole where an errant
application could write into unexpected places through /dev/mem.


Could you point me to an example of this so I can figure out how to do it?

Thanks,
David

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