Forum Discussion
Altera_Forum
Honored Contributor
13 years agoPorting non-mmu code to MMU -- MMU memcpy SEGV
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...
Altera_Forum
Honored Contributor
13 years agoHi,
--- Quote Start --- Now - my mapping needs to be fixed because this buffer is used in a contiguous manner in the firmware. So, I'm assuming that this command WILL adhere to that because I have already allocated this area in my device driver? and I'll use: MAP_FIXED with the address. --- Quote End --- It's possible to use the MAP_FIXED option, but in this case, your application code must know the value of physically mapped address and it affects the portability. To avoid this, 'device file' (e.g. /dev/fb0, etc.) is used and its file descripter is passed to the 'mmap' function as an argument. To regard everything as files is the key concept of Unix(Linux). Of course, to do so, your driver must have several 'file operations' functions. Two files 'fbmem.c' and 'altfb.c' in the directory of 'drivers/video' may be good(?) samples to understand these methodology. Kazu