Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Apr 2010 01:49:50 +0000 (UTC)
From:      Juli Mallett <jmallett@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r206718 - in head/sys/mips: conf mips
Message-ID:  <201004170149.o3H1nohX011017@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jmallett
Date: Sat Apr 17 01:49:50 2010
New Revision: 206718
URL: http://svn.freebsd.org/changeset/base/206718

Log:
  o) Back out my previous change to SWARM; some of it was to address an issue
     that turned out to be unrelated, and the rest was, as pointed out by Neel,
     just wrong-headed.
  o) Tweak mem.c to fix use of /dev/kmem for direct-mapped addresses.

Modified:
  head/sys/mips/conf/SWARM
  head/sys/mips/mips/mem.c

Modified: head/sys/mips/conf/SWARM
==============================================================================
--- head/sys/mips/conf/SWARM	Sat Apr 17 01:17:31 2010	(r206717)
+++ head/sys/mips/conf/SWARM	Sat Apr 17 01:49:50 2010	(r206718)
@@ -19,13 +19,8 @@ options		CFE_CONSOLE
 options		CFE_ENV
 options		ALT_BREAK_TO_DEBUGGER
 
-# Don't build any modules yet.
-makeoptions	MODULES_OVERRIDE=""
-makeoptions	TARGET_BIG_ENDIAN=defined
 makeoptions	LDSCRIPT_NAME=	ldscript.mips.cfe
 
-makeoptions	KERNLOADADDR=0x81000000
-
 #cpu		CPU_MIPS64
 #options 	ISA_MIPS64
 #makeoptions	ARCH_FLAGS="-march=mips64 -mgp64 -mabi=o64"

Modified: head/sys/mips/mips/mem.c
==============================================================================
--- head/sys/mips/mips/mem.c	Sat Apr 17 01:17:31 2010	(r206717)
+++ head/sys/mips/mips/mem.c	Sat Apr 17 01:49:50 2010	(r206718)
@@ -120,21 +120,23 @@ memrw(struct cdev *dev, struct uio *uio,
 			 * Make sure that all the pages are currently resident
 			 * so that we don't create any zero-fill pages.
 			 */
-
-			for (; va < eva; va += PAGE_SIZE)
-				if (pmap_extract(kernel_pmap, va) == 0)
+			if (va >= VM_MIN_KERNEL_ADDRESS &&
+			    eva <= VM_MAX_KERNEL_ADDRESS) {
+				for (; va < eva; va += PAGE_SIZE)
+					if (pmap_extract(kernel_pmap, va) == 0)
+						return (EFAULT);
+
+				prot = (uio->uio_rw == UIO_READ)
+				    ? VM_PROT_READ : VM_PROT_WRITE;
+
+				va = uio->uio_offset;
+				if (kernacc((void *) va, iov->iov_len, prot)
+				    == FALSE)
 					return (EFAULT);
-
-			prot = (uio->uio_rw == UIO_READ)
-			    ? VM_PROT_READ : VM_PROT_WRITE;
+			}
 
 			va = uio->uio_offset;
-			if (kernacc((void *) va, iov->iov_len, prot)
-			    == FALSE)
-				return (EFAULT);
-
 			error = uiomove((void *)va, iov->iov_len, uio);
-
 			continue;
 		}
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201004170149.o3H1nohX011017>