*参照元 [#h74aba29] #backlinks *説明 [#z6a2ecec] -パス: 複数あり --CONFIG_DMA_CMA 有効: [[linux-4.4.1/drivers/base/dma-contiguous.c]] --CONFIG_DMA_CMA 無効: [[linux-4.4.1/include/linux/dma-contiguous.h]] --[[linux-4.4.1/CONFIG_DMA_CMA]] -FIXME: これは何? --説明 **引数 [#fef35a2d] -struct device *dev -- --[[linux-4.4.1/device]] -size_t count -- -unsigned int align -- **返り値 [#kebde8db] -struct page * -- --失敗したら NULL を返す。 --[[linux-4.4.1/page]] **参考 [#pc46529e] *実装 [#y1bec96f] **CONFIG_DMA_CMA 有効: drivers/base/dma-contiguous.c [#m766eb8f] /** * dma_alloc_from_contiguous() - allocate pages from contiguous area * @dev: Pointer to device for which the allocation is performed. * @count: Requested number of pages. * @align: Requested alignment of pages (in PAGE_SIZE order). * * This function allocates memory buffer for specified device. It uses * device specific contiguous memory area if available or the default * global one. Requires architecture specific dev_get_cma_area() helper * function. */ struct page *dma_alloc_from_contiguous(struct device *dev, size_t count, unsigned int align) { if (align > CONFIG_CMA_ALIGNMENT) align = CONFIG_CMA_ALIGNMENT; - --[[linux-4.4.1/CONFIG_CMA_ALIGNMENT]] return cma_alloc(dev_get_cma_area(dev), count, align); - --[[linux-4.4.1/cma_alloc()]] --[[linux-4.4.1/dev_get_cma_area()]] } **CONFIG_DMA_CMA 無効: include/linux/dma-contiguous.h [#if75698c] static inline struct page *dma_alloc_from_contiguous(struct device *dev, size_t count, unsigned int order) { return NULL; } -常に失敗する。 *コメント [#ld44d47d]