Path: blob/master/arch/m68k/include/asm/cacheflush_no.h
10820 views
#ifndef _M68KNOMMU_CACHEFLUSH_H1#define _M68KNOMMU_CACHEFLUSH_H23/*4* (C) Copyright 2000-2010, Greg Ungerer <[email protected]>5*/6#include <linux/mm.h>7#include <asm/mcfsim.h>89#define flush_cache_all() __flush_cache_all()10#define flush_cache_mm(mm) do { } while (0)11#define flush_cache_dup_mm(mm) do { } while (0)12#define flush_cache_range(vma, start, end) do { } while (0)13#define flush_cache_page(vma, vmaddr) do { } while (0)14#define flush_dcache_range(start, len) __flush_dcache_all()15#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 016#define flush_dcache_page(page) do { } while (0)17#define flush_dcache_mmap_lock(mapping) do { } while (0)18#define flush_dcache_mmap_unlock(mapping) do { } while (0)19#define flush_icache_range(start, len) __flush_icache_all()20#define flush_icache_page(vma,pg) do { } while (0)21#define flush_icache_user_range(vma,pg,adr,len) do { } while (0)22#define flush_cache_vmap(start, end) do { } while (0)23#define flush_cache_vunmap(start, end) do { } while (0)2425#define copy_to_user_page(vma, page, vaddr, dst, src, len) \26memcpy(dst, src, len)27#define copy_from_user_page(vma, page, vaddr, dst, src, len) \28memcpy(dst, src, len)2930void mcf_cache_push(void);3132static inline void __flush_cache_all(void)33{34#ifdef CACHE_PUSH35mcf_cache_push();36#endif37#ifdef CACHE_INVALIDATE38__asm__ __volatile__ (39"movel %0, %%d0\n\t"40"movec %%d0, %%CACR\n\t"41"nop\n\t"42: : "i" (CACHE_INVALIDATE) : "d0" );43#endif44}4546/*47* Some ColdFire parts implement separate instruction and data caches,48* on those we should just flush the appropriate cache. If we don't need49* to do any specific flushing then this will be optimized away.50*/51static inline void __flush_icache_all(void)52{53#ifdef CACHE_INVALIDATEI54__asm__ __volatile__ (55"movel %0, %%d0\n\t"56"movec %%d0, %%CACR\n\t"57"nop\n\t"58: : "i" (CACHE_INVALIDATEI) : "d0" );59#endif60}6162static inline void __flush_dcache_all(void)63{64#ifdef CACHE_PUSH65mcf_cache_push();66#endif67#ifdef CACHE_INVALIDATED68__asm__ __volatile__ (69"movel %0, %%d0\n\t"70"movec %%d0, %%CACR\n\t"71"nop\n\t"72: : "i" (CACHE_INVALIDATED) : "d0" );73#else74/* Flush the wrtite buffer */75__asm__ __volatile__ ( "nop" );76#endif77}78#endif /* _M68KNOMMU_CACHEFLUSH_H */798081