Date: Fri, 7 Jul 2006 12:34:29 GMT From: Oleksandr Tymoshenko <gonzo@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 100873 for review Message-ID: <200607071234.k67CYTxj005513@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200607071234.k67CYTxj005513>