Module Name: src Committed By: matt Date: Tue Sep 8 00:24:01 UTC 2009
Modified Files: src/sys/arch/mips/mips [matt-nb5-mips64]: mem.c Log Message: Use XKPHYS to read mem on _LP64. To generate a diff of this commit: cvs rdiff -u -r1.35 -r1.35.38.1 src/sys/arch/mips/mips/mem.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/mem.c diff -u src/sys/arch/mips/mips/mem.c:1.35 src/sys/arch/mips/mips/mem.c:1.35.38.1 --- src/sys/arch/mips/mips/mem.c:1.35 Wed Oct 17 19:55:38 2007 +++ src/sys/arch/mips/mips/mem.c Tue Sep 8 00:24:01 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: mem.c,v 1.35 2007/10/17 19:55:38 garbled Exp $ */ +/* $NetBSD: mem.c,v 1.35.38.1 2009/09/08 00:24:01 matt Exp $ */ /* * Copyright (c) 1982, 1986, 1990, 1993 @@ -80,7 +80,7 @@ #include "opt_mips_cache.h" #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: mem.c,v 1.35 2007/10/17 19:55:38 garbled Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mem.c,v 1.35.38.1 2009/09/08 00:24:01 matt Exp $"); #include <sys/param.h> #include <sys/conf.h> @@ -94,6 +94,9 @@ #include <machine/cpu.h> #include <mips/cache.h> +#ifdef _LP64 +#include <mips/mips3_pte.h> +#endif #include <uvm/uvm_extern.h> @@ -146,7 +149,12 @@ */ if (v + c > ctob(physmem)) return (EFAULT); - v += MIPS_KSEG0_START; +#ifdef _LP64 + v = MIPS_PHYS_TO_XKPHYS( + MIPS3_PG_TO_CCA(MIPS3_PG_CACHED), v); +#else + v = MIPS_PHYS_TO_KSEG0(v); +#endif error = uiomove((void *)v, c, uio); #if defined(MIPS3_PLUS) if (mips_cache_virtual_alias) @@ -158,6 +166,7 @@ v = uio->uio_offset; c = min(iov->iov_len, MAXPHYS); if (v < MIPS_KSEG0_START) + if (v < MIPS_KSEG0_START) return (EFAULT); if (v > MIPS_PHYS_TO_KSEG0(avail_end + mips_round_page(MSGBUFSIZE) - c) &&