Article 4TWA8 Block driver aligning BIO buffer address

Block driver aligning BIO buffer address

by
beandigital
from LinuxQuestions.org on (#4TWA8)
I am developing a block driver for an embedded device. The device has a DMA controller, but it expects the address to be aligned 8 byte boundary. I have using an example ram disk driver to develop my driver. But when I look at the address that is returned from the BIO, there is no alignment. Is there a way to align it? I have included the code I am using below.

Code:#define BV_PAGE(bv) ((bv).bv_page)
#define BV_OFFSET(bv) ((bv).bv_offset)
#define BV_LEN(bv) ((bv).bv_len)

rq_for_each_segment(bv, req, iter)
{
buffer = page_address(BV_PAGE(bv)) + BV_OFFSET(bv);latest?d=yIl2AUoC8zA latest?i=uPCT3BYh7BE:smI1Mc0PkVo:F7zBnMy latest?i=uPCT3BYh7BE:smI1Mc0PkVo:V_sGLiP latest?d=qj6IDK7rITs latest?i=uPCT3BYh7BE:smI1Mc0PkVo:gIN9vFwuPCT3BYh7BE
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments