Quantcast
Channel: Altera Forums
Viewing all articles
Browse latest Browse all 19390

Porting non-mmu code to MMU -- MMU memcpy SEGV

$
0
0
Thanks in Advance.

With the non-mmu nios2 our design defined sdram regions that we utilized for buffers in our custom device driver.
**** device driver
sharedMem = kmalloc( SHARED_MEMSIZE, GFP_USER );
if ( sharedMem == NULL)
{
res = -ENOMEM;
exit;
}
else
{
sharedMemVertAddr = ioremap( sharedMem, SHARED_MEMSIZE );
}
**** end device driver

So, in my user space code I have an ioctl that I call to get the address - "sharedMemAddr" from the driver then I do my:

memcpy( sharedMemAddr, (const void *)&sharedMem, sizeof(sharedMem) );

FOR THE MMU system I get -- "SEGV"
FOR THE non-MMU system the scheme works GREAT!

What do I need to do to get the MMU system to allow this type of "memcpy?"

Viewing all articles
Browse latest Browse all 19390

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>