Module Name: src
Committed By: matt
Date: Fri Apr 29 22:07:46 UTC 2011
Modified Files:
src/sys/arch/mips/mips: vm_machdep.c
Log Message:
Deal with uarea mapped in either kseg0 or xkphys.
To generate a diff of this commit:
cvs rdiff -u -r1.136 -r1.137 src/sys/arch/mips/mips/vm_machdep.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/mips/mips/vm_machdep.c
diff -u src/sys/arch/mips/mips/vm_machdep.c:1.136 src/sys/arch/mips/mips/vm_machdep.c:1.137
--- src/sys/arch/mips/mips/vm_machdep.c:1.136 Sun Feb 20 07:45:48 2011
+++ src/sys/arch/mips/mips/vm_machdep.c Fri Apr 29 22:07:46 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: vm_machdep.c,v 1.136 2011/02/20 07:45:48 matt Exp $ */
+/* $NetBSD: vm_machdep.c,v 1.137 2011/04/29 22:07:46 matt Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.136 2011/02/20 07:45:48 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.137 2011/04/29 22:07:46 matt Exp $");
#include "opt_ddb.h"
#include "opt_coredump.h"
@@ -120,17 +120,16 @@
l2->l_md.md_utf = tf;
#if USPACE > PAGE_SIZE
+ bool direct_mapped_p = MIPS_KSEG0_P(ua2);
#ifdef _LP64
- if (!MIPS_XKPHYS_P(ua2))
-#else
- if (!MIPS_KSEG0_P(ua2))
+ direct_mapped_p = direct_mapped_p || MIPS_XKPHYS_P(ua2);
#endif
- {
- const int x = (MIPS_HAS_R4K_MMU) ?
+ if (!direct_mapped_p) {
+ pt_entry_t * const pte = kvtopte(ua2);
+ const uint32_t x = (MIPS_HAS_R4K_MMU) ?
(MIPS3_PG_G | MIPS3_PG_RO | MIPS3_PG_WIRED) : MIPS1_PG_G;
- pt_entry_t *pte = kvtopte(ua2);
- for (size_t i = 0; i < UPAGES; i++) {
+ for (u_int i = 0; i < UPAGES; i++) {
l2->l_md.md_upte[i] = pte[i].pt_entry &~ x;
}
}