vserver 1.9.5.x5
[linux-2.6.git] / include / asm-arm26 / tlb.h
index acfdbe8..324941b 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <asm/pgalloc.h>
 #include <asm/tlbflush.h>
+#include <linux/vs_memory.h>
 
 /*
  * TLB handling.  This allows us to remove pages from the page
@@ -11,6 +12,7 @@
 struct mmu_gather {
         struct mm_struct        *mm;
         unsigned int            freed;
+       unsigned int            fullmm;
 
         unsigned int            flushes;
         unsigned int            avoided_flushes;
@@ -26,6 +28,7 @@ tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush)
 
         tlb->mm = mm;
         tlb->freed = 0;
+       tlb->fullmm = full_mm_flush;
 
         return tlb;
 }
@@ -53,8 +56,21 @@ tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end)
         check_pgt_cache();
 }
 
+
+static inline unsigned int
+tlb_is_full_mm(struct mmu_gather *tlb)
+{
+     return tlb->fullmm;
+}
+
 #define tlb_remove_tlb_entry(tlb,ptep,address)  do { } while (0)
-#define tlb_start_vma(tlb,vma)                  do { } while (0)
+//#define tlb_start_vma(tlb,vma)                  do { } while (0)
+//FIXME - ARM32 uses this now that things changed in the kernel. seems like it may be pointless on arm26, however to get things compiling...
+#define tlb_start_vma(tlb,vma)                                          \
+        do {                                                            \
+                if (!tlb->fullmm)                                       \
+                        flush_cache_range(vma, vma->vm_start, vma->vm_end); \
+        } while (0)
 #define tlb_end_vma(tlb,vma)                    do { } while (0)
 
 #define tlb_remove_page(tlb,page)       free_page_and_swap_cache(page)