*参照元 [#b857edd9] #backlinks *説明 [#bb693e0e] -パス: [[linux-4.4.1/arch/arm/mm/dma-mapping.c]] -FIXME: これは何? --説明 **引数 [#c8b36953] -struct device *dev -- --[[linux-4.4.1/device]] -size_t size -- -void *cpu_addr -- -dma_addr_t handle -- --[[linux-4.4.1/dma_addr_t]] -struct dma_attrs *attrs -- --[[linux-4.4.1/dma_attrs]] -bool is_coherent -- **返り値 [#w4ae039b] -なし **参考 [#n69e23a7] *実装 [#qfcd21bf] /* * Free a buffer as defined by the above mapping. */ static void __arm_dma_free(struct device *dev, size_t size, void *cpu_addr, dma_addr_t handle, struct dma_attrs *attrs, bool is_coherent) { struct page *page = pfn_to_page(dma_to_pfn(dev, handle)); bool want_vaddr = !dma_get_attr(DMA_ATTR_NO_KERNEL_MAPPING, attrs); - --[[linux-4.4.1/page]] --[[linux-4.4.1/pfn_to_page()]] --[[linux-4.4.1/dma_to_pfn()]] --[[linux-4.4.1/dma_get_attr()]] --[[linux-4.4.1/DMA_ATTR_NO_KERNEL_MAPPING]] size = PAGE_ALIGN(size); - --[[linux-4.4.1/PAGE_ALIGN()]] if (nommu()) { __dma_free_buffer(page, size); - --[[linux-4.4.1/nommu()]] --[[linux-4.4.1/__dma_free_buffer()]] } else if (!is_coherent && __free_from_pool(cpu_addr, size)) { return; - --[[linux-4.4.1/__free_from_pool()]] } else if (!dev_get_cma_area(dev)) { if (want_vaddr && !is_coherent) __dma_free_remap(cpu_addr, size); __dma_free_buffer(page, size); - --[[linux-4.4.1/dev_get_cma_area()]] --[[linux-4.4.1/__dma_free_remap()]] --[[linux-4.4.1/__dma_free_buffer()]] } else { /* * Non-atomic allocations cannot be freed with IRQs disabled */ WARN_ON(irqs_disabled()); __free_from_contiguous(dev, page, cpu_addr, size, want_vaddr); - --[[linux-4.4.1/WARN_ON()]] --[[linux-4.4.1/irqs_disabled()]] --[[linux-4.4.1/__free_from_contiguous()]] } } *コメント [#f92b268c]