From owner-svn-src-all@FreeBSD.ORG Fri Dec 3 19:22:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 905AC106566C; Fri, 3 Dec 2010 19:22:18 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 737EA8FC17; Fri, 3 Dec 2010 19:22:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB3JMIYT012713; Fri, 3 Dec 2010 19:22:18 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB3JMI71012710; Fri, 3 Dec 2010 19:22:18 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201012031922.oB3JMI71012710@svn.freebsd.org> From: "Jayachandran C." Date: Fri, 3 Dec 2010 19:22:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216157 - in head/sys/mips: include mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 19:22:18 -0000 Author: jchandra Date: Fri Dec 3 19:22:18 2010 New Revision: 216157 URL: http://svn.freebsd.org/changeset/base/216157 Log: 1. Fix off by one errors in calls to MIPS_DIRECT_MAPPABLE, reported by alc@ 2. Remove unnecessary #defines from vmparam.h Submitted by: alc (2) Reviewed by: alc (1) Modified: head/sys/mips/include/vmparam.h head/sys/mips/mips/pmap.c Modified: head/sys/mips/include/vmparam.h ============================================================================== --- head/sys/mips/include/vmparam.h Fri Dec 3 18:30:55 2010 (r216156) +++ head/sys/mips/include/vmparam.h Fri Dec 3 19:22:18 2010 (r216157) @@ -46,11 +46,6 @@ /* * Machine dependent constants mips processors. */ -/* - * USRTEXT is the start of the user text/data space, while USRSTACK - * is the top (end) of the user stack. - */ -#define USRTEXT (1*PAGE_SIZE) /* * Virtual memory related constants, all in bytes @@ -94,7 +89,6 @@ #define VM_MAX_ADDRESS ((vm_offset_t)(intptr_t)(int32_t)0xffffffff) #define VM_MINUSER_ADDRESS ((vm_offset_t)0x00000000) -#define VM_MAX_MMAP_ADDR VM_MAXUSER_ADDRESS #ifdef __mips_n64 #define VM_MAXUSER_ADDRESS (VM_MINUSER_ADDRESS + (NPDEPG * NBSEG)) Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Fri Dec 3 18:30:55 2010 (r216156) +++ head/sys/mips/mips/pmap.c Fri Dec 3 19:22:18 2010 (r216157) @@ -196,14 +196,15 @@ static void pmap_update_page_action(void #ifndef __mips_n64 /* - * This structure is for high memory (memory above 512Meg in 32 bit) - * This memory area does not have direct mapping, so we a mechanism to do - * temporary per-CPU mapping to access these addresses. - * - * At bootup we reserve 2 virtual pages per CPU for mapping highmem pages, to - * access a highmem physical address on a CPU, we will disable interrupts and - * add the mapping from the reserved virtual address for the CPU to the physical - * address in the kernel pagetable. + * This structure is for high memory (memory above 512Meg in 32 bit) support. + * The highmem area does not have a KSEG0 mapping, and we need a mechanism to + * do temporary per-CPU mappings for pmap_zero_page, pmap_copy_page etc. + * + * At bootup, we reserve 2 virtual pages per CPU for mapping highmem pages. To + * access a highmem physical address on a CPU, we map the physical address to + * the reserved virtual address for the CPU in the kernel pagetable. This is + * done with interrupts disabled(although a spinlock and sched_pin would be + * sufficient). */ struct local_sysmaps { vm_offset_t base; @@ -520,11 +521,11 @@ again: } /* - * In 32 bit, we may have memory which cannot be mapped directly - * this memory will need temporary mapping before it can be + * In 32 bit, we may have memory which cannot be mapped directly. + * This memory will need temporary mapping before it can be * accessed. */ - if (!MIPS_DIRECT_MAPPABLE(phys_avail[i - 1])) + if (!MIPS_DIRECT_MAPPABLE(phys_avail[i - 1] - 1)) need_local_mappings = 1; /* @@ -893,7 +894,7 @@ pmap_map(vm_offset_t *virt, vm_offset_t { vm_offset_t va, sva; - if (MIPS_DIRECT_MAPPABLE(end)) + if (MIPS_DIRECT_MAPPABLE(end - 1)) return (MIPS_PHYS_TO_DIRECT(start)); va = sva = *virt;