how to allocate 9MB of memory in kernel ?
arnd at arndb.de
Wed Jul 23 01:12:51 EST 2008
On Tuesday 22 July 2008, Misbah khan wrote:
> First of all let me thank you for your valuable suggessions ...
> 1. I wanted to allocate 9MB in kernel and wanted that memory to be mapped to
> the physically continews SDRAM memory. but till now i could not found a way
> to do so ???
> 2. So i thought to use ioremap to map SDRAM and make it accessible to user
> using mmap technique but there is only one doubt and that is will it be
> secure and stable and whether it is a right way of doing ???
As I have told you a few times now, you *either* allocate the memory *or*
ioremap it, NOT BOTH!!!
If you SDRAM is you main memory, you need vmalloc and remap_vmalloc_range.
If the SDRAM is not your main memory but some I/O attached buffer, you need
ioremap/of_iomap and remap_pfn_range.
More information about the Linuxppc-embedded