patch-1.3.99 linux/arch/m68k/mm/memory.c

Next file: linux/arch/mips/config.in
Previous file: linux/arch/m68k/mm/fault.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.98/linux/arch/m68k/mm/memory.c linux/arch/m68k/mm/memory.c
@@ -506,7 +506,7 @@
 		      : : "i" (FLUSH_I)
 		      : "d0");
 }
-
+#if 1
 void flush_cache_all(void)
 {
     if (m68k_is040or060 >= 4)
@@ -515,26 +515,53 @@
 	asm volatile ("movec %/cacr,%/d0\n\t"
 		      "oriw %0,%/d0\n\t"
 		      "movec %/d0,%/cacr"
-		      : : "i" (FLUSH_I)
+		      : : "i" (FLUSH_I_AND_D)
 		      : "d0");
 }
 
-void flush_page_to_ram (unsigned long addr)
+void flush_cache_mm(struct mm_struct *mm){
+
+    if (mm == current->mm)
+        flush_cache_all();
+}
+
+void flush_cache_range(struct mm_struct *mm, unsigned long start,
+		       unsigned long end){
+    if (mm == current->mm)
+        cache_push_v(start, end-start);
+}
+
+void flush_cache_page (struct vm_area_struct *vma, unsigned long vaddr)
 {
-    if (m68k_is040or060 == 4)
-        pushv040(addr);
+    if (m68k_is040or060 >= 4)
+        pushv040(vaddr); /*
+			  * the 040 always invalidates the I-cache when
+			  * pushing its contents to ram.
+			  */
+
+    /* 68030/68020 have no writeback cache; still need to clear icache. */
+    else /* 68030 or 68020 */
+        asm volatile ("movec %/cacr,%/d0\n\t"
+		      "oriw %0,%/d0\n\t"
+		      "movec %/d0,%/cacr"
+		      : : "i" (FLUSH_I_AND_D)
+		      : "d0");
+}
 
-    else if (m68k_is040or060 == 6)
-        push040(VTOP(addr)); /* someone mentioned that pushv060 doesn't work */
+void flush_page_to_ram (unsigned long vaddr)
+{
+    if (m68k_is040or060 >= 4)
+        pushcl040(VTOP(vaddr));
 
     /* 68030/68020 have no writeback cache; still need to clear icache. */
     else /* 68030 or 68020 */
 	asm volatile ("movec %/cacr,%/d0\n\t"
 		      "oriw %0,%/d0\n\t"
 		      "movec %/d0,%/cacr"
-		      : : "i" (FLUSH_I)
+		      : : "i" (FLUSH_I_AND_D)
 		      : "d0");
 }
+#endif
 
 #undef clear040
 #undef push040

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this