Path: blob/master/arch/m68k/platform/coldfire/cache.c
10819 views
/***************************************************************************/12/*3* cache.c -- general ColdFire Cache maintenance code4*5* Copyright (C) 2010, Greg Ungerer ([email protected])6*/78/***************************************************************************/910#include <linux/kernel.h>11#include <asm/coldfire.h>12#include <asm/mcfsim.h>1314/***************************************************************************/15#ifdef CACHE_PUSH16/***************************************************************************/1718/*19* Use cpushl to push all dirty cache lines back to memory.20* Older versions of GAS don't seem to know how to generate the21* ColdFire cpushl instruction... Oh well, bit stuff it for now.22*/2324void mcf_cache_push(void)25{26__asm__ __volatile__ (27"clrl %%d0\n\t"28"1:\n\t"29"movel %%d0,%%a0\n\t"30"2:\n\t"31".word 0xf468\n\t"32"addl %0,%%a0\n\t"33"cmpl %1,%%a0\n\t"34"blt 2b\n\t"35"addql #1,%%d0\n\t"36"cmpil %2,%%d0\n\t"37"bne 1b\n\t"38: /* No output */39: "i" (CACHE_LINE_SIZE),40"i" (DCACHE_SIZE / CACHE_WAYS),41"i" (CACHE_WAYS)42: "d0", "a0" );43}4445/***************************************************************************/46#endif /* CACHE_PUSH */47/***************************************************************************/484950