*参照元 [#dec73efa] #backlinks *説明 [#zb4e217f] -パス: [[linux-4.4.1/include/asm-generic/dma-mapping-common.h]] -FIXME: これは何? --説明 **引数 [#e604a737] -struct device *dev -- --[[linux-4.4.1/device]] -struct vm_area_struct *vma -- --[[linux-4.4.1/vm_area_struct]] -void *cpu_addr -- -dma_addr_t dma_addr -- --[[linux-4.4.1/dma_addr_t]] -size_t size -- -struct dma_attrs *attrs -- --[[linux-4.4.1/dma_attrs]] **返り値 [#bf91f8a0] -int -- **参考 [#s4ff04b1] *実装 [#jf5874bc] /** * dma_mmap_attrs - map a coherent DMA allocation into user space * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices * @vma: vm_area_struct describing requested user mapping * @cpu_addr: kernel CPU-view address returned from dma_alloc_attrs * @handle: device-view address returned from dma_alloc_attrs * @size: size of memory originally requested in dma_alloc_attrs * @attrs: attributes of mapping properties requested in dma_alloc_attrs * * Map a coherent DMA buffer previously allocated by dma_alloc_attrs * into user space. The coherent DMA buffer must not be freed by the * driver until the user space mapping has been released. */ static inline int dma_mmap_attrs(struct device *dev, struct vm_area_struct *vma, void *cpu_addr, dma_addr_t dma_addr, size_t size, struct dma_attrs *attrs) { struct dma_map_ops *ops = get_dma_ops(dev); - --[[linux-4.4.1/dma_map_ops]] --[[linux-4.4.1/get_dma_ops()]] BUG_ON(!ops); - --[[linux-4.4.1/BUG_ON()]] if (ops->mmap) return ops->mmap(dev, vma, cpu_addr, dma_addr, size, attrs); return dma_common_mmap(dev, vma, cpu_addr, dma_addr, size); - --[[linux-4.4.1/dma_common_mmap()]] } *コメント [#k179134a]