16-Byte aligned memory allocated in user space and then

Valdis.Kletnieks at vt.edu Valdis.Kletnieks at vt.edu
Wed Feb 5 14:53:47 EST 2014


On Wed, 05 Feb 2014 11:35:27 -0800, m silverstri said:

> If I allocated memory in user space and make it 16 byte aligned memory,
> and then pass it to kernel and setup DMA for my kernel driver,
> will my kernel driver still see the memory in 16-Byte aligned memory?
>
> The hard that my kernel driver takes to need 16-Byte aligned memory.

Hint:  Memory mapping is done in terms of pages.  Under what possible
conditions will your 16-byte aligned memory move with respect to the
beginning of the page it lives on?  (In other words, if you allocate
64 bytes that live at location 0xyyyy840, the memory map can change the
yyyy part - - but can the 840 ever change?)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 848 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140205/1e0e8dd8/attachment.bin 


More information about the Kernelnewbies mailing list