Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - mmap of huge space fails, even with dma-save region: (5 Items)
   
mmap of huge space fails, even with dma-save region  
Hello,
on a ppc460ex board we need a large DMA-buffer of about 350MB. The Board itself got 512MB RAM, also shown at the 
SystemSumary.

Using mmap with PROT_READ | PROT_WRITE | PROT_NOCACHE, MAP_PHYS | MAP_ANON | MAP_SHARED, NOFD is not working properly if
 i try more than 210 MB. As errno i get "ENOMEM".
A possible explanation could be that the RAM is already fragmented an a region this big is not availible anymore.
For that i can define a DMA-safe region in the bsp startup (as_add_containing). If i do that, i still see 512MB as 
SystemMemory. Shouldn't it be 512 minus"my region size"?
Also the mmap(with posix_typed_mem_open before) of the DMA-save region still does not work with more than 210MB. Again 
the errno is ENOMEM.
What is going wrong here?
Is there a posibility to see my RAM-regions and even the properties?

I am using the ppc460ex bsp1.0.0 with qnx6.4.1
thanks in advance



Re: mmap of huge space fails, even with dma-save region  
try using the -R option to startup

On 10/19/2010 05:47 AM, Wolfgang Ivanica wrote:
> Hello,
> on a ppc460ex board we need a large DMA-buffer of about 350MB. The Board itself got 512MB RAM, also shown at the 
SystemSumary.
>
> Using mmap with PROT_READ | PROT_WRITE | PROT_NOCACHE, MAP_PHYS | MAP_ANON | MAP_SHARED, NOFD is not working properly 
if i try more than 210 MB. As errno i get "ENOMEM".
> A possible explanation could be that the RAM is already fragmented an a region this big is not availible anymore.
> For that i can define a DMA-safe region in the bsp startup (as_add_containing). If i do that, i still see 512MB as 
SystemMemory. Shouldn't it be 512 minus"my region size"?
> Also the mmap(with posix_typed_mem_open before) of the DMA-save region still does not work with more than 210MB. Again
 the errno is ENOMEM.
> What is going wrong here?
> Is there a posibility to see my RAM-regions and even the properties?
>
> I am using the ppc460ex bsp1.0.0 with qnx6.4.1
> thanks in advance
>
>
>
>
>
>
>
> _______________________________________________
>
> OSTech
> http://community.qnx.com/sf/go/post71188
>
>    
Re: mmap of huge space fails, even with dma-save region  
if using -R 352M, the space is marked as used, but i sitll cant map it.


i can open the memory with:
int fd = posix_typed_mem_open("/ram/fb", O_RDWR, POSIX_TYPED_MEM_ALLOCATE_CONTIG);
but still not map:
mBuffer = mmap(NULL, mBufferSize, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);

posix_typed_mem_get_info reports:
__posix_tmi_length_hi	0	
posix_tmi_length	121372672	

is the entry in the starup correct?
main.c:
...
init_misc();
init_pci();
add_typed_string(_CS_MACHINE, "myBoard");

as_add_containing(0, 0x15FFFFFF, AS_ATTR_RAM, "fb", "ram");

init_system_private();
print_syspage();
...
Re: mmap of huge space fails, even with dma-save region  
you shouldn't need to add anything in startup. The region should show up 
as /mem/reserved (pidin syspage=asinfo)

On 10/19/2010 09:48 AM, Wolfgang Ivanica wrote:
> if using -R 352M, the space is marked as used, but i sitll cant map it.
>
>
> i can open the memory with:
> int fd = posix_typed_mem_open("/ram/fb", O_RDWR, POSIX_TYPED_MEM_ALLOCATE_CONTIG);
> but still not map:
> mBuffer = mmap(NULL, mBufferSize, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
>
> posix_typed_mem_get_info reports:
> __posix_tmi_length_hi	0	
> posix_tmi_length	121372672	
>
> is the entry in the starup correct?
> main.c:
> ...
> init_misc();
> init_pci();
> add_typed_string(_CS_MACHINE, "myBoard");
>
> as_add_containing(0, 0x15FFFFFF, AS_ATTR_RAM, "fb", "ram");
>
> init_system_private();
> print_syspage();
> ...
>
>
>
>
> _______________________________________________
>
> OSTech
> http://community.qnx.com/sf/go/post71224
>
>    
Re: mmap of huge space fails, even with dma-save region  
i see the entry:
0100) 000000000a000000-000000001fffffff o:0080 a:0007 p:100 n:/memory/ram/reserved

but opening still fails:
fd = posix_typed_mem_open("/ram/reserved", O_RDWR, POSIX_TYPED_MEM_ALLOCATE_CONTIG);
mmap(NULL, BufferSize, PROT_READ | PROT_WRITE | PROT_NOCACHE, MAP_SHARED , fd, 0);

fd is valid, but mmap return ENOMEM.