Suppose I have a physical buffer address in
void* DmaBufferPtr
now I want to copy this buffer into read/write I/O buffer.
Under 2.0 I used to say:
memcpy_fromfs(DmaBufferPtr, buf, count)
in order to move data from DMA(hardware) buffer into I/O buffer
memcpy_tofs(buf,DmaBufferPtr, count)
in order to move data from I/O buffer to DMA (hardware) buffer
Now in 2.2...
After I've replaced memcpy_fromfs with copy_to_user I was not getting
anything (just 0s). Then I figured that kernel space have moved up to
0xC0000000. So, I've subtracted 0xC0000000 from the DmaBufferPtr, and
copy_to_user started to work. Of course I understand that what I do is
stupid...
Now, when I did the same trick with copy_from_fs, I'm getting a page
fault. Looks like kernel thinks that DMA buffer is not mapped, but why I
can read from it? And to tell the truth I just want to read and write to
this physical address (which is 0x30000000)...
Should I just memcpy() between buf and DmaBufferPtr then.
Thank you for your time.
Vassili Leonov vleo@linuxmedialabs.com
http://linuxmedialabs.com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/