From fc6985d4ae6fb9dfb519975d9205bed7e8b6b3b8 Mon Sep 17 00:00:00 2001
From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: Tue, 23 Jul 2002 06:21:17 -0700
Subject: [PATCH] [PATCH] M68k update (part 9)

M68k cache handling updates
  - Add missing definition of L1_CACHE_SHIFT
  - Define L1_CACHE_BYTES in terms of L1_CACHE_SHIFT
  - Add missing include
  - Fix address types and casts
---
 include/asm-m68k/cache.h      | 3 ++-
 include/asm-m68k/cacheflush.h | 8 +++++---
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/include/asm-m68k/cache.h b/include/asm-m68k/cache.h
index 52262e891ed8..fed3fd30de7e 100644
--- a/include/asm-m68k/cache.h
+++ b/include/asm-m68k/cache.h
@@ -5,6 +5,7 @@
 #define __ARCH_M68K_CACHE_H
 
 /* bytes per L1 cache line */
-#define        L1_CACHE_BYTES  16
+#define        L1_CACHE_SHIFT  4
+#define        L1_CACHE_BYTES  (1<< L1_CACHE_SHIFT)
 
 #endif
diff --git a/include/asm-m68k/cacheflush.h b/include/asm-m68k/cacheflush.h
index 089a570d552a..078523b767ba 100644
--- a/include/asm-m68k/cacheflush.h
+++ b/include/asm-m68k/cacheflush.h
@@ -1,6 +1,8 @@
 #ifndef _M68K_CACHEFLUSH_H
 #define _M68K_CACHEFLUSH_H
 
+#include <linux/mm.h>
+
 /*
  * Cache handling functions
  */
@@ -104,15 +106,15 @@ extern inline void flush_cache_page(struct vm_area_struct *vma,
 
 /* Push the page at kernel virtual address and clear the icache */
 /* RZ: use cpush %bc instead of cpush %dc, cinv %ic */
-#define flush_page_to_ram(page) __flush_page_to_ram((unsigned long) page_address(page))
-extern inline void __flush_page_to_ram(unsigned long address)
+#define flush_page_to_ram(page) __flush_page_to_ram(page_address(page))
+extern inline void __flush_page_to_ram(void *vaddr)
 {
 	if (CPU_IS_040_OR_060) {
 		__asm__ __volatile__("nop\n\t"
 				     ".chip 68040\n\t"
 				     "cpushp %%bc,(%0)\n\t"
 				     ".chip 68k"
-				     : : "a" (__pa((void *)address)));
+				     : : "a" (__pa(vaddr)));
 	} else {
 		unsigned long _tmp;
 		__asm__ __volatile__("movec %%cacr,%0\n\t"
-- 
2.30.9