2009年6月24日 星期三

Consistent buffer size available

include/asm-generic/pci-dma-compat.h: pci_alloc_consistent ->
arch/arm/mm/consistent.c: dma_alloc_coherent ->
arch/arm/mm/consistent.c: __dma_alloc

arch/arm/mm/consistent.c

static void *
__dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp,
pgprot_t prot)
{
(..................)

size >= (CONSISTENT_END - CONSISTENT_BASE)) {

(..................)



arch/arm/mm/consistent.c
/* Sanity check size */
#if (CONSISTENT_DMA_SIZE % SZ_2M)
#error "CONSISTENT_DMA_SIZE must be multiple of 2MiB"
#endif

#define CONSISTENT_END (0xffe00000)
#define CONSISTENT_BASE (CONSISTENT_END - CONSISTENT_DMA_SIZE)


arch/arm/include/asm/memory.h
/*
* Size of DMA-consistent memory region. Must be multiple of 2M,
* between 2MB and 14MB inclusive.
*/
#ifndef CONSISTENT_DMA_SIZE
#define CONSISTENT_DMA_SIZE SZ_2M
#endif

沒有留言: