On Mon, 27 Aug 2001, Julian Elischer wrote:
> Zhihui Zhang wrote:
>
> > I believe that message is from ata_dmasetup():
> >
> > if (((uintptr_t)data & scp->alignment) || (count & scp->alignment)) {
> > ata_printf(scp, device, "non aligned DMA transfer attempted\n");
> > return -1;
> > }
> >
> > The user address obtained by static allocation is not 16-byte aligned. The
> > kernel routine physio() grabs a physical buffer to do DMA, but it still
> > uses the user's address. The KVA associated with the buffer is not used.
> >
> > -Zhihui
>
>
> the physical address of a buffer will have the same allignment as the KVA
> address.
But how can you explain the following statement in physio():
bp->b_dev = dev;
bp->b_iodone = physwakeup;
----> bp->b_data = uio->uio_iov[i].iov_base;
bp->b_bcount = uio->uio_iov[i].iov_len;
bp->b_offset = uio->uio_offset;
bp->b_saveaddr = sa;
The bp->b_data is set to point to the user address. And later on, it is
passed to the data argument of ata_dmasetup(), where the alignment is
checked.
-Zhihui
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message