*参照元 [#ub44f36b] #backlinks *説明 [#hf703715] -パス: [[linux-4.4.1/drivers/base/dma-coherent.c]] -FIXME: これは何? --説明 --CONFIG_OF_RESERVED_MEM を有効にする必要がある。 ---[[linux-4.4.1/CONFIG_OF_RESERVED_MEM]] **引数 [#kf64cff4] -struct reserved_mem *rmem -- --[[linux-4.4.1/reserved_mem]] -struct device *dev -- --[[linux-4.4.1/device]] **返り値 [#wc08b002] -int -- **参考 [#h935a183] *実装 [#ze967a1f] static int rmem_dma_device_init(struct reserved_mem *rmem, struct device *dev) { struct dma_coherent_mem *mem = rmem->priv; - --[[linux-4.4.1/dma_coherent_mem]] if (!mem && dma_init_coherent_memory(rmem->base, rmem->base, rmem->size, DMA_MEMORY_MAP | DMA_MEMORY_EXCLUSIVE, &mem) != DMA_MEMORY_MAP) { - --[[linux-4.4.1/dma_init_coherent_memory()]] pr_err("Reserved memory: failed to init DMA memory pool at %pa, size %ld MiB\n", &rmem->base, (unsigned long)rmem->size / SZ_1M); return -ENODEV; } - --[[linux-4.4.1/pr_err()]] rmem->priv = mem; dma_assign_coherent_memory(dev, mem); - --[[linux-4.4.1/dma_assign_coherent_memory()]] return 0; } *コメント [#oeb62569]