Messages in this thread | | | Date | Mon, 10 Jun 2002 11:29:01 -0700 | From | William Jhun <> | Subject | Re: PCI DMA to small buffers on cache-incoherent arch |
| |
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/
| |