]> rtime.felk.cvut.cz Git - mcf548x/linux.git/blobdiff - arch/m68k/kernel/sys_m68k.c
Current (FEC from 2.6.31 port, no CAN, no I2C, no PCI)
[mcf548x/linux.git] / arch / m68k / kernel / sys_m68k.c
index 3db2e7f902aae8edb79209df2352800112f26028..ad75780b31066b6ed8d6e27637c7f5d04443db6d 100644 (file)
 #include <linux/elf.h>
 #include <asm/tlb.h>
 
+#ifdef CONFIG_COLDFIRE
+#include <asm/cacheflush.h> 
+#endif 
+
 asmlinkage int do_page_fault(struct pt_regs *regs, unsigned long address,
                             unsigned long error_code);
 
@@ -46,6 +50,7 @@ asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
 }
 
 /* Convert virtual (user) address VADDR to physical address PADDR */
+#ifndef CONFIG_COLDFIRE 
 #define virt_to_phys_040(vaddr)                                                \
 ({                                                                     \
   unsigned long _mmusr, _paddr;                                                \
@@ -369,6 +374,8 @@ cache_flush_060 (unsigned long addr, int scope, int cache, unsigned long len)
   return 0;
 }
 
+#endif /* CONFIG_COLDFIRE */ 
+
 /* sys_cacheflush -- flush (part of) the processor cache.  */
 asmlinkage int
 sys_cacheflush (unsigned long addr, int scope, int cache, unsigned long len)
@@ -399,6 +406,7 @@ sys_cacheflush (unsigned long addr, int scope, int cache, unsigned long len)
                        goto out;
        }
 
+#ifndef CONFIG_COLDFIRE 
        if (CPU_IS_020_OR_030) {
                if (scope == FLUSH_SCOPE_LINE && len < 256) {
                        unsigned long cacr;
@@ -443,6 +451,15 @@ sys_cacheflush (unsigned long addr, int scope, int cache, unsigned long len)
                ret = cache_flush_060 (addr, scope, cache, len);
            }
        }
+#else /* CONFIG_COLDFIRE */
+       if ((cache & FLUSH_CACHE_INSN) && (cache & FLUSH_CACHE_DATA)) 
+               flush_bcache();
+       else if (cache & FLUSH_CACHE_INSN) 
+               flush_icache(); 
+       else
+               flush_dcache(); 
+       
+       ret = 0;        
 out:
        return ret;
 }