fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / arch / ppc / mm / tlb.c
index 3bf70f6..fa29740 100644 (file)
@@ -23,7 +23,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
 #include <linux/init.h>
@@ -42,28 +41,19 @@ void flush_hash_entry(struct mm_struct *mm, pte_t *ptep, unsigned long addr)
 
        if (Hash != 0) {
                ptephys = __pa(ptep) & PAGE_MASK;
-               flush_hash_pages(mm->context, addr, ptephys, 1);
+               flush_hash_pages(mm->context.id, addr, ptephys, 1);
        }
 }
 
 /*
- * Called by ptep_test_and_clear_young()
+ * Called by ptep_set_access_flags, must flush on CPUs for which the
+ * DSI handler can't just "fixup" the TLB on a write fault
  */
-void flush_hash_one_pte(pte_t *ptep)
+void flush_tlb_page_nohash(struct vm_area_struct *vma, unsigned long addr)
 {
-       struct page *ptepage;
-       struct mm_struct *mm;
-       unsigned long ptephys;
-       unsigned long addr;
-
-       if (Hash == 0)
+       if (Hash != 0)
                return;
-       
-       ptepage = virt_to_page(ptep);
-       mm = (struct mm_struct *) ptepage->mapping;
-       ptephys = __pa(ptep) & PAGE_MASK;
-       addr = ptepage->index + (((unsigned long)ptep & ~PAGE_MASK) << 9);
-       flush_hash_pages(mm->context, addr, ptephys, 1);
+       _tlbie(addr);
 }
 
 /*
@@ -111,7 +101,7 @@ static void flush_range(struct mm_struct *mm, unsigned long start,
        pmd_t *pmd;
        unsigned long pmd_end;
        int count;
-       unsigned int ctx = mm->context;
+       unsigned int ctx = mm->context.id;
 
        if (Hash == 0) {
                _tlbia();
@@ -175,7 +165,7 @@ void flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr)
        mm = (vmaddr < TASK_SIZE)? vma->vm_mm: &init_mm;
        pmd = pmd_offset(pgd_offset(mm, vmaddr), vmaddr);
        if (!pmd_none(*pmd))
-               flush_hash_pages(mm->context, vmaddr, pmd_val(*pmd), 1);
+               flush_hash_pages(mm->context.id, vmaddr, pmd_val(*pmd), 1);
        FINISH_FLUSH;
 }