patch-2.4.0-test7 linux/arch/sparc64/mm/fault.c

Next file: linux/arch/sparc64/solaris/misc.c
Previous file: linux/arch/sparc64/lib/dec_and_lock.S
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test6/linux/arch/sparc64/mm/fault.c linux/arch/sparc64/mm/fault.c
@@ -1,4 +1,4 @@
-/* $Id: fault.c,v 1.49 2000/08/09 00:00:15 davem Exp $
+/* $Id: fault.c,v 1.50 2000/08/11 03:00:13 davem Exp $
  * arch/sparc64/mm/fault.c: Page fault handlers for the 64-bit Sparc.
  *
  * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
@@ -42,7 +42,7 @@
 	sp_banks[0].base_addr = base_paddr;
 	sp_banks[0].num_bytes = bytes;
 
-	while (mlist->theres_more != (void *) 0){
+	while (mlist->theres_more != (void *) 0) {
 		i++;
 		mlist = mlist->theres_more;
 		bytes = mlist->num_bytes;
@@ -68,7 +68,7 @@
 	/* Now mask all bank sizes on a page boundary, it is all we can
 	 * use anyways.
 	 */
-	for(i=0; sp_banks[i].num_bytes != 0; i++)
+	for (i = 0; sp_banks[i].num_bytes != 0; i++)
 		sp_banks[i].num_bytes &= PAGE_MASK;
 
 	return tally;
@@ -77,7 +77,7 @@
 void unhandled_fault(unsigned long address, struct task_struct *tsk,
                      struct pt_regs *regs)
 {
-	if((unsigned long) address < PAGE_SIZE) {
+	if ((unsigned long) address < PAGE_SIZE) {
 		printk(KERN_ALERT "Unable to handle kernel NULL "
 		       "pointer dereference\n");
 	} else {
@@ -100,17 +100,17 @@
 	unsigned long pa;
 	u32 insn = 0;
 
-	if(pgd_none(*pgdp))
+	if (pgd_none(*pgdp))
 		goto out;
 	pmdp = pmd_offset(pgdp, tpc);
-	if(pmd_none(*pmdp))
+	if (pmd_none(*pmdp))
 		goto out;
 	ptep = pte_offset(pmdp, tpc);
 	pte = *ptep;
-	if(!pte_present(pte))
+	if (!pte_present(pte))
 		goto out;
 
-	pa  = phys_base + (sparc64_pte_pagenr(pte) << PAGE_SHIFT);
+	pa  = (pte_val(pte) & _PAGE_PADDR);
 	pa += (tpc & ~PAGE_MASK);
 
 	/* Use phys bypass so we don't pollute dtlb/dcache. */

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