consistent.c 605 B

1234567891011121314151617181920212223
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Microblaze support for cache consistent memory.
  4. * Copyright (C) 2010 Michal Simek <[email protected]>
  5. * Copyright (C) 2010 PetaLogix
  6. * Copyright (C) 2005 John Williams <[email protected]>
  7. */
  8. #include <linux/kernel.h>
  9. #include <linux/string.h>
  10. #include <linux/types.h>
  11. #include <linux/mm.h>
  12. #include <linux/init.h>
  13. #include <linux/dma-map-ops.h>
  14. #include <asm/cpuinfo.h>
  15. #include <asm/cacheflush.h>
  16. void arch_dma_prep_coherent(struct page *page, size_t size)
  17. {
  18. phys_addr_t paddr = page_to_phys(page);
  19. flush_dcache_range(paddr, paddr + size);
  20. }