Thread (27 messages) read the whole thread 27 messages, 7 authors, 2008-08-02

Re: how to allocate 9MB of memory in kernel ?

From: Misbah khan <hidden>
Date: 2008-07-23 07:30:39


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.

My SDRAM is the main memory of which 9MB i have to allocate in the driver. 

If i allocate 9BM using vmalloc and remap to user space how should it
address to the 9MB 
SDRAM contigues address which i need to map for user access ? 


Arnd Bergmann wrote:
On Tuesday 22 July 2008, Misbah khan wrote:
quoted
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.

	Arnd <><
_______________________________________________
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded
-- 
View this message in context: http://www.nabble.com/how-to-allocate-9MB-of-memory-in-kernel---tp18503022p18605418.html
Sent from the linuxppc-embedded mailing list archive at Nabble.com.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help