patch-2.2.4 linux/arch/sparc/mm/sun4c.c

Next file: linux/arch/sparc/mm/viking.S
Previous file: linux/arch/sparc/mm/srmmu.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.3/linux/arch/sparc/mm/sun4c.c linux/arch/sparc/mm/sun4c.c
@@ -1,4 +1,4 @@
-/* $Id: sun4c.c,v 1.171 1998/09/21 05:05:41 jj Exp $
+/* $Id: sun4c.c,v 1.173 1999/01/17 02:20:37 davem Exp $
  * sun4c.c: Doing in software what should be done in hardware.
  *
  * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
@@ -2688,6 +2688,10 @@
 			unsigned long vaddr = vmaring->vm_start + offset;
 			unsigned long start;
 
+			/* Do not mistake ourselves as another mapping. */
+			if(vmaring == vma)
+				continue;
+
 			if (S4CVAC_BADALIAS(vaddr, address)) {
 				alias_found++;
 				start = vmaring->vm_start;
@@ -2699,8 +2703,8 @@
 
 					if(pte_val(*ptep) & _SUN4C_PAGE_PRESENT) {
 						flush_cache_page(vmaring, start);
-						pte_val(*ptep) = (pte_val(*ptep) |
-								  _SUN4C_PAGE_NOCACHE);
+						*ptep = __pte(pte_val(*ptep) |
+							      _SUN4C_PAGE_NOCACHE);
 						flush_tlb_page(vmaring, start);
 					}
 				next:
@@ -2712,7 +2716,7 @@
 		if(alias_found && !(pte_val(pte) & _SUN4C_PAGE_NOCACHE)) {
 			pgdp = sun4c_pgd_offset(vma->vm_mm, address);
 			ptep = sun4c_pte_offset((pmd_t *) pgdp, address);
-			pte_val(*ptep) = (pte_val(*ptep) | _SUN4C_PAGE_NOCACHE);
+			*ptep = __pte(pte_val(*ptep) | _SUN4C_PAGE_NOCACHE);
 			pte = pte_val(*ptep);
 		}
 	}

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