/* * ColdFire architecture has no way to clear individual cache lines, so we * are stuck invalidating all the cache entries when we want a clear operation.
*/ staticinlinevoid clear_cf_icache(unsignedlong start, unsignedlong end)
{
__asm__ __volatile__ ( "movec %0,%%cacr\n\t" "nop"
:
: "r" (CACHE_MODE | CACR_ICINVA | CACR_BCINVA));
}
/* * Use the ColdFire cpushl instruction to push (and invalidate) cache lines. * The start and end addresses are cache line numbers not memory addresses.
*/ staticinlinevoid flush_cf_icache(unsignedlong start, unsignedlong end)
{ unsignedlong set;
for (set = start; set <= end; set += (0x10 - 3)) {
__asm__ __volatile__ ( "cpushl %%ic,(%0)\n\t" "addq%.l #1,%0\n\t" "cpushl %%ic,(%0)\n\t" "addq%.l #1,%0\n\t" "cpushl %%ic,(%0)\n\t" "addq%.l #1,%0\n\t" "cpushl %%ic,(%0)"
: "=a" (set)
: "a" (set));
}
}
/* * invalidate the cache for the specified memory range. * It starts at the physical address specified for * the given number of bytes.
*/ externvoid cache_clear(unsignedlong paddr, int len); /* * push any dirty cache in the specified memory range. * It starts at the physical address specified for * the given number of bytes.
*/ externvoid cache_push(unsignedlong paddr, int len);
/* * push and invalidate pages in the specified user virtual * memory range.
*/ externvoid cache_push_v(unsignedlong vaddr, int len);
/* This is needed whenever the virtual mapping of the current
process changes. */ #define __flush_cache_all() \
({ \ if (CPU_IS_COLDFIRE) { \
flush_cf_dcache(0, DCACHE_MAX_ADDR); \
} elseif (CPU_IS_040_OR_060) { \
__asm__ __volatile__("nop\n\t" \ ".chip 68040\n\t" \ "cpusha %dc\n\t" \ ".chip 68k"); \
} else { \ unsignedlong _tmp; \
__asm__ __volatile__("movec %%cacr,%0\n\t" \ "orw %1,%0\n\t" \ "movec %0,%%cacr" \
: "=&d" (_tmp) \
: "di" (FLUSH_I_AND_D)); \
} \
})
/* flush_cache_range/flush_cache_page must be macros to avoid
a dependency on linux/mm.h, which includes this file... */ staticinlinevoid flush_cache_range(struct vm_area_struct *vma, unsignedlong start, unsignedlong end)
{ if (vma->vm_mm == current->mm)
__flush_cache_030();
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.