1 // SPDX-License-Identifier: GPL-2.0 1 2 /* 3 * Copyright (C) 2004 - 2007 Paul Mundt 4 */ 5 #include <linux/mm.h> 6 #include <linux/dma-map-ops.h> 7 #include <asm/cacheflush.h> 8 #include <asm/addrspace.h> 9 10 void arch_dma_prep_coherent(struct page *page, 11 { 12 __flush_purge_region(page_address(page 13 } 14 15 void arch_sync_dma_for_device(phys_addr_t padd 16 enum dma_data_direction dir) 17 { 18 void *addr = sh_cacheop_vaddr(phys_to_ 19 20 switch (dir) { 21 case DMA_FROM_DEVICE: /* inv 22 __flush_invalidate_region(addr 23 break; 24 case DMA_TO_DEVICE: /* wri 25 __flush_wback_region(addr, siz 26 break; 27 case DMA_BIDIRECTIONAL: /* wri 28 __flush_purge_region(addr, siz 29 break; 30 default: 31 BUG(); 32 } 33 } 34
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.