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);