patch-2.4.0-test5 linux/arch/sh/mm/cache.c

Next file: linux/arch/sh/mm/fault.c
Previous file: linux/arch/sh/kernel/time.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test4/linux/arch/sh/mm/cache.c linux/arch/sh/mm/cache.c
@@ -2,7 +2,7 @@
  *
  *  linux/arch/sh/mm/cache.c
  *
- * Copyright (C) 1999  Niibe Yutaka
+ * Copyright (C) 1999, 2000  Niibe Yutaka
  *
  */
 
@@ -36,7 +36,10 @@
 	int num_entries;
 };
 
-static struct _cache_system_info cache_system_info;
+/* Data at BSS is cleared after setting this variable.
+   So, we Should not placed this variable at BSS section.
+   Initialize this, it is placed at data section. */
+static struct _cache_system_info cache_system_info = {0,};
 
 #define CACHE_OC_WAY_SHIFT	(cache_system_info.way_shift)
 #define CACHE_IC_WAY_SHIFT	(cache_system_info.way_shift)
@@ -97,7 +100,7 @@
 	}
 }
 
-static void
+static void __init
 detect_cpu_and_cache_system(void)
 {
 #if defined(__sh3__)
@@ -338,6 +341,7 @@
 
 void flush_cache_page(struct vm_area_struct *vma, unsigned long addr)
 {
+	/* XXX: Umm... this flush out all the cache lines.  Any improvement? */
 	flush_cache_range(vma->vm_mm, addr, addr+PAGE_SIZE);
 }
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)