Question on Alignment
Hi All, I'm allocating a memory for linux driver using the kmalloc and I need to align it to 32 bit how do I do it? Thank you, Regards, Omk
On Sat, Nov 2, 2013 at 7:42 PM, Shyam Sunkara <ophouddin22@gmail.com> wrote:
Hi All,
I'm allocating a memory for linux driver using the kmalloc and I need to align it to 32 bit how do I do it?
Did you mean 32 bit or byte?
Thank you,
Regards, Omk
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Sorry I meant 32 byte....!!! On Sat, Nov 2, 2013 at 9:20 PM, anish singh <anish198519851985@gmail.com>wrote:
On Sat, Nov 2, 2013 at 7:42 PM, Shyam Sunkara <ophouddin22@gmail.com>wrote:
Hi All,
I'm allocating a memory for linux driver using the kmalloc and I need to align it to 32 bit how do I do it?
Did you mean 32 bit or byte?
Thank you,
Regards, Omk
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Don't top post. On Sun, Nov 3, 2013 at 9:29 AM, Omkar Houddin <ophouddin22@gmail.com> wrote:
Sorry I meant 32 byte....!!!
Mostly memory returned from kmalloc is aligned for generic data types but incase you want to set it explicitly you can use below macro: ALIGN(returned_memory, 32);
On Sat, Nov 2, 2013 at 9:20 PM, anish singh <anish198519851985@gmail.com> wrote:
On Sat, Nov 2, 2013 at 7:42 PM, Shyam Sunkara <ophouddin22@gmail.com> wrote:
Hi All,
I'm allocating a memory for linux driver using the kmalloc and I need to align it to 32 bit how do I do it?
Did you mean 32 bit or byte?
Thank you,
Regards, Omk
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
participants (3)
-
anish singh -
Omkar Houddin -
Shyam Sunkara