Reference: any generic linux in a PowerPC FreeScale8548 hardware DMA environment. this is more of a Linux kernel programming issue but thought to post here.
Question: what methods are available to move a kmalloc created 128K size buffer from kernel land to user land. i am looking to effectively translate the kernel's start of buffer address to the user land.
the buffer is initially loaded or transmitted by DMA hardware in the kernel but needs to be make available to the user memory environment.
my impression is copy_from_user() will work on value and therefore this routine must copy the value of each word to the different memory systems using cpu cycles.
Hi jah, just some hints: when you allocate the buffer you can forward the address to the user application via the copy_to_user(). In the user application you can open the /dev/mem device and map via mmap() the memory area of the kernel buffer. So you can think to have two address, the physical address and the user space address and you know the offset between the two address. Each time you must use a location in the kernel buffer you can translate it to a user space address using this offset.
Here some C lines of code on how to open the /dev/mem device and how to map a buffer positioned in BaseBufPhyAddr