From owner-p4-projects@FreeBSD.ORG Fri Jul 7 12:34:53 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 83FA316A4ED; Fri, 7 Jul 2006 12:34:53 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4729116A4DD for ; Fri, 7 Jul 2006 12:34:53 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id A563A43D83 for ; Fri, 7 Jul 2006 12:34:29 +0000 (GMT) (envelope-from gonzo@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k67CYTJd005516 for ; Fri, 7 Jul 2006 12:34:29 GMT (envelope-from gonzo@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k67CYTxj005513 for perforce@freebsd.org; Fri, 7 Jul 2006 12:34:29 GMT (envelope-from gonzo@FreeBSD.org) Date: Fri, 7 Jul 2006 12:34:29 GMT Message-Id: <200607071234.k67CYTxj005513@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko To: Perforce Change Reviews Cc: Subject: PERFORCE change 100873 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jul 2006 12:34:53 -0000 http://perforce.freebsd.org/chv.cgi?CH=100873 Change 100873 by gonzo@gonzo_hq on 2006/07/07 12:34:28 pmap.c stuff: Integrate pmap_enter_object, pmap_init_page from arm. Affected files ... .. //depot/projects/mips2/src/sys/mips/mips/pmap.c#3 edit Differences ... ==== //depot/projects/mips2/src/sys/mips/mips/pmap.c#3 (text+ko) ==== @@ -748,6 +748,17 @@ #endif } +/* + * Initialize a vm_page's machine-dependent fields. + */ +void +pmap_page_init(vm_page_t m) +{ + + TAILQ_INIT(&m->md.pv_list); + m->md.pv_list_count = 0; +} + /*************************************************** * Pmap allocation/deallocation routines. ***************************************************/ @@ -1199,6 +1210,40 @@ tlb_enter(pmap, va, pa, PG_V | wired); } +/* + * Maps a sequence of resident pages belonging to the same object. + * The sequence begins with the given page m_start. This page is + * mapped at the given virtual address start. Each subsequent page is + * mapped at a virtual address that is offset from start by the same + * amount as the page is offset from m_start within the object. The + * last page in the sequence is the page with the largest offset from + * m_start that can be mapped at a virtual address less than the given + * virtual address end. Not every virtual page between start and end + * is mapped; only those for which a resident page exists with the + * corresponding offset from m_start are mapped. + */ +void +pmap_enter_object(pmap_t pmap, vm_offset_t start, vm_offset_t end, + vm_page_t m_start, vm_prot_t prot) +{ + vm_page_t m; + vm_pindex_t diff, psize; + int s; + + psize = atop(end - start); + m = m_start; + /* + * MIPSXXX: check if locking required. + */ + s = splvm(); + while (m != NULL && (diff = m->pindex - m_start->pindex) < psize) { + pmap_enter(pmap, start + ptoa(diff), m, prot & + (VM_PROT_READ | VM_PROT_EXECUTE), FALSE); + m = TAILQ_NEXT(m, listq); + } + splx(s); +} + void pmap_enter_quick(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot) {