Re: PCI DMA to small buffers on cache-incoherent arch

From: William Jhun (wjhun@ayrnetworks.com)
Date: Mon Jun 10 2002 - 13:29:01 EST


On Mon, Jun 10, 2002 at 11:07:40AM -0700, William Jhun wrote:
> Perhaps provide macros in asm/pci.h that will:
>
> - Take a buffer size and add an appropriate amount (one cache line for
> alignment and the remainder to fill out the last cache line) to be
> used for kmalloc(), etc, eg:

Err, I should say any case where the buffer may not be cache-aligned
(this would enable the use of DMA to stack...). For allocation routines
that give a cache-aligned buffer, this is obviously not needed (but
would just add one cacheline to the size).

>
> #define DMA_SIZE_ROUNDUP(size) \
> ((size + 2*SMP_CACHE_BYTES - 1) & ~(SMP_CACHE_BYTES - 1))
>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Jun 15 2002 - 22:00:18 EST