]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - arch/mips/include/asm/cacheops.h
Merge branch 'master' of git://git.denx.de/u-boot-mips
[karo-tx-uboot.git] / arch / mips / include / asm / cacheops.h
index 6464250d8486ec6261c1c6066dd7bb104dd61ee9..75ec380980f7653b1505d1316eae20329704cbb3 100644 (file)
 #ifndef        __ASM_CACHEOPS_H
 #define        __ASM_CACHEOPS_H
 
+#ifndef __ASSEMBLY__
+
+static inline void mips_cache(int op, const volatile void *addr)
+{
+#ifdef __GCC_HAVE_BUILTIN_MIPS_CACHE
+       __builtin_mips_cache(op, addr);
+#else
+       __asm__ __volatile__("cache %0, %1" : : "i"(op), "R"(addr))
+#endif
+}
+
+#endif /* !__ASSEMBLY__ */
+
 /*
  * Cache Operations available on all MIPS processors with R4000-style caches
  */