From owner-svn-src-head@FreeBSD.ORG Thu Feb 25 03:49:18 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70F1C106566B; Thu, 25 Feb 2010 03:49:18 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5ED998FC17; Thu, 25 Feb 2010 03:49: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 o1P3nItR094167; Thu, 25 Feb 2010 03:49:18 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1P3nIYS094166; Thu, 25 Feb 2010 03:49:18 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201002250349.o1P3nIYS094166@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 25 Feb 2010 03:49: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: r204296 - head/sys/powerpc/aim X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2010 03:49:18 -0000 Author: nwhitehorn Date: Thu Feb 25 03:49:17 2010 New Revision: 204296 URL: http://svn.freebsd.org/changeset/base/204296 Log: Provide an implementation of pmap_dev_direct_mapped() on OEA64. This is required in order to be able to mmap the running kernel, which is turn required to avoid fstat returning gibberish. Modified: head/sys/powerpc/aim/mmu_oea64.c Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Thu Feb 25 00:46:51 2010 (r204295) +++ head/sys/powerpc/aim/mmu_oea64.c Thu Feb 25 03:49:17 2010 (r204296) @@ -2410,7 +2410,22 @@ moea64_clear_bit(vm_page_t m, u_int64_t boolean_t moea64_dev_direct_mapped(mmu_t mmu, vm_offset_t pa, vm_size_t size) { - return (EFAULT); + struct pvo_entry *pvo; + vm_offset_t ppa; + int error = 0; + + PMAP_LOCK(kernel_pmap); + for (ppa = pa & ~ADDR_POFF; ppa < pa + size; ppa += PAGE_SIZE) { + pvo = moea64_pvo_find_va(kernel_pmap, ppa, NULL); + if (pvo == NULL || + (pvo->pvo_pte.lpte.pte_lo & LPTE_RPGN) != ppa) { + error = EFAULT; + break; + } + } + PMAP_UNLOCK(kernel_pmap); + + return (error); } /*