patch-2.1.73 linux/arch/mips/kernel/ptrace.c

Next file: linux/arch/mips/kernel/r2300_fpu.S
Previous file: linux/arch/mips/kernel/process.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.72/linux/arch/mips/kernel/ptrace.c linux/arch/mips/kernel/ptrace.c
@@ -59,12 +59,15 @@
 		goto repeat;
 	}
 	page = pte_page(*pgtable);
-/* this is a hack for non-kernel-mapped video buffers and similar */
+	/* This is a hack for non-kernel-mapped video buffers and similar */
 	if (MAP_NR(page) >= MAP_NR(high_memory))
 		return 0;
 	page += addr & ~PAGE_MASK;
+	/* We can't use flush_page_to_ram() since we're running in
+	 * another context ...
+	 */
+	flush_cache_all();
 	retval = *(unsigned long *) page;
-	flush_page_to_ram(page);
 	return retval;
 }
 
@@ -117,14 +120,17 @@
 		handle_mm_fault(tsk, vma, addr, 1);
 		goto repeat;
 	}
-/* this is a hack for non-kernel-mapped video buffers and similar */
-	flush_cache_page(vma, addr);
-	if (MAP_NR(page) < MAP_NR(high_memory)) {
-		*(unsigned long *) (page + (addr & ~PAGE_MASK)) = data;
+	/* This is a hack for non-kernel-mapped video buffers and similar */
+	if (MAP_NR(page) < MAP_NR(high_memory))
+		flush_cache_page(vma, addr);
+	*(unsigned long *) (page + (addr & ~PAGE_MASK)) = data;
+	if (MAP_NR(page) < MAP_NR(high_memory))
 		flush_page_to_ram(page);
-	}
-/* we're bypassing pagetables, so we have to set the dirty bit ourselves */
-/* this should also re-instate whatever read-only mode there was before */
+	/*
+	 * We're bypassing pagetables, so we have to set the dirty bit
+	 * ourselves this should also re-instate whatever read-only mode
+	 * there was before
+	 */
 	set_pte(pgtable, pte_mkdirty(mk_pte(page, vma->vm_page_prot)));
 	flush_tlb_page(vma, addr);
 }
@@ -369,7 +375,7 @@
 				case 5:
 					tmp = child->tss.fpu.hard.control;
 					break;
-				case 6:
+				case 6:	/* implementation / version register */
 					tmp = 0;
 					break;
 				default:

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov