*参照元 [#b2d24cef] #backlinks *説明 [#m03de219] -パス: [[linux-4.4.1/lib/swiotlb.c]] -FIXME: これは何? --説明 **引数 [#u22da0c2] -struct device *hwdev -- --[[linux-4.4.1/device]] -dma_addr_t dev_addr -- --[[linux-4.4.1/dma_addr_t]] -size_t size -- -enum dma_data_direction dir -- --[[linux-4.4.1/dma_data_direction]] -enum dma_sync_target target -- --[[linux-4.4.1/dma_sync_target]] **返り値 [#za166ae8] -なし **参考 [#je39ef5d] *実装 [#q4f0eccd] /* * Make physical memory consistent for a single streaming mode DMA translation * after a transfer. * * If you perform a swiotlb_map_page() but wish to interrogate the buffer * using the cpu, yet do not wish to teardown the dma mapping, you must * call this function before doing so. At the next point you give the dma * address back to the card, you must first perform a * swiotlb_dma_sync_for_device, and then the device again owns the buffer */ static void swiotlb_sync_single(struct device *hwdev, dma_addr_t dev_addr, size_t size, enum dma_data_direction dir, enum dma_sync_target target) { phys_addr_t paddr = dma_to_phys(hwdev, dev_addr); - --[[linux-4.4.1/phys_addr_t]] --[[linux-4.4.1/dma_to_phys()]] BUG_ON(dir == DMA_NONE); - --[[linux-4.4.1/BUG_ON()]] if (is_swiotlb_buffer(paddr)) { swiotlb_tbl_sync_single(hwdev, paddr, size, dir, target); return; } - --[[linux-4.4.1/is_swiotlb_buffer()]] --[[linux-4.4.1/swiotlb_tbl_sync_single()]] if (dir != DMA_FROM_DEVICE) return; dma_mark_clean(phys_to_virt(paddr), size); - --[[linux-4.4.1/dma_mark_clean()]] --[[linux-4.4.1/phys_to_virt()]] } *コメント [#l2c6483d]