linux-mips
[Top] [All Lists]

[patch] ip27's _flush_cache_all uninitialized

To: Linux-MIPS <linux-mips@linux-mips.org>
Subject: [patch] ip27's _flush_cache_all uninitialized
From: Andrew Clausen <clausen@melbourne.sgi.com>
Date: Thu, 13 Feb 2003 17:00:17 +1100
Cc: ralf@linux-mips.org, mg@sgi.com, gnb@sgi.com
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.4i
Hi all,

_flush_cache_all() and ___flush_cache_all() were uninitialized
(i.e. NULL).  Someone probably assumed (incorrectly) that this
was ok, since flush_cache_all() doesn't use _flush_cache_all()
(or so they thought...).

End result: anything that called flush_cache_all() (a macro)
tried to call a function at 0x0, and died.  This includes vmalloc().

I'm not sure what the best solution is, but this makes things work:

--- arch/mips64/mm/c-andes.c    9 Feb 2003 22:03:23 -0000       1.1.2.2
+++ arch/mips64/mm/c-andes.c    13 Feb 2003 05:50:54 -0000
@@ -48,6 +48,12 @@
        }
 }
 
+static void andes_flush_cache_all(void)
+{
+       andes_flush_cache_l1();
+       andes_flush_cache_l2();
+}
+
 void andes_flush_icache_page(unsigned long page)
 {
        if (scache_lsz64)
@@ -80,6 +86,7 @@
        _clear_page = andes_clear_page;
        _copy_page = andes_copy_page;
 
+       _flush_cache_all = ___flush_cache_all = andes_flush_cache_all;
        _flush_cache_l1 = andes_flush_cache_l1;
        _flush_cache_l2 = andes_flush_cache_l2;
        _flush_cache_sigtramp = andes_flush_cache_sigtramp;


Cheers,
Andrew

<Prev in Thread] Current Thread [Next in Thread>