[PATCH] flush_icache_page for sparc64

From: Pat O'Rourke (orourke@missioncriticallinux.com)
Date: Mon Feb 14 2000 - 18:47:57 EST


It appears ia64 added a flush_icache_page() macro with a different signature
than the one which already existed for sparc64. Here is a proposed patch to
correct it.

--- /mnt/sbox/linux-2.3.45/include/asm-sparc64/pgtable.h Sun Feb 13 13:31
:07 2000
+++ include/asm-sparc64/pgtable.h Mon Feb 14 15:35:40 2000
@@ -16,6 +16,7 @@
 #include <asm/asi.h>
 #include <asm/mmu_context.h>
 #include <asm/system.h>
+#include <asm/mman.h>
 
 #ifndef __ASSEMBLY__
 
@@ -280,14 +281,21 @@
  * table.
  * 4) Splat.
  */
-extern void flush_icache_page(unsigned long phys_page);
+extern void sparc64_flush_icache_page(unsigned long phys_page);
+
+#define flush_icache_page(vma,pg) \
+do { \
+ if ((vma)->vm_flags & PROT_EXEC) \
+ sparc64_flush_icache_page(((pg) - mem_map) << PAGE_SHIFT); \
+} while (0)
+
 #define update_mmu_cache(__vma, __address, _pte) \
 do { \
        unsigned short __flags = ((__vma)->vm_flags); \
        if ((__flags & VM_EXEC) != 0 && \
            ((pte_val(_pte) & (_PAGE_PRESENT | _PAGE_WRITE | _PAGE_MODIFIED)) ==
 \
             (_PAGE_PRESENT | _PAGE_WRITE | _PAGE_MODIFIED))) { \
- flush_icache_page(pte_pagenr(_pte) << PAGE_SHIFT); \
+ sparc64_flush_icache_page(pte_pagenr(_pte) << PAGE_SHIFT); \
        } \
 } while(0)

--- /mnt/sbox/linux-2.3.45/arch/sparc64/mm/ultra.S Tue Dec 21 01:05:52 1999
+++ arch/sparc64/mm/ultra.S Mon Feb 14 15:56:06 2000
@@ -132,8 +132,8 @@
         wrpr %g1, 0x0, %pstate
 
        .align 32
- .globl flush_icache_page
-flush_icache_page: /* %o0 = phys_page */
+ .globl sparc64_flush_icache_page
+sparc64_flush_icache_page: /* %o0 = phys_page */
        sethi %hi(1 << 13), %o2 ! IC_set bit
        mov 1, %g1
        srlx %o0, 5, %o0

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Feb 15 2000 - 21:00:28 EST