pmap.c (a27df7823f7ca19de0beb88acf737900dd005cbb) pmap.c (960173b9b283675c49eee318c6ca8c12ecb5d188)
1/*
2 * Copyright (c) 1991 Regents of the University of California.
3 * All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * the Systems Programming Group of the University of Utah Computer
7 * Science Department and William Jolitz of UUNET Technologies Inc.
8 *

--- 21 unchanged lines hidden (view full) ---

30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 *
37 * from: @(#)pmap.c 7.7 (Berkeley) 5/12/91
1/*
2 * Copyright (c) 1991 Regents of the University of California.
3 * All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * the Systems Programming Group of the University of Utah Computer
7 * Science Department and William Jolitz of UUNET Technologies Inc.
8 *

--- 21 unchanged lines hidden (view full) ---

30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 *
37 * from: @(#)pmap.c 7.7 (Berkeley) 5/12/91
38 * $Id: pmap.c,v 1.5 1993/10/12 13:53:25 rgrimes Exp $
38 * $Id: pmap.c,v 1.6 1993/10/12 15:09:37 rgrimes Exp $
39 */
39 */
40static char rcsid[] = "$Id: pmap.c,v 1.5 1993/10/12 13:53:25 rgrimes Exp $";
41
42/*
43 * Derived from hp300 version by Mike Hibler, this version by William
44 * Jolitz uses a recursive map [a pde points to the page directory] to
45 * map the page tables using the pagetables themselves. This is done to
46 * reduce the impact on kernel virtual memory for lots of sparse address
47 * space, and to reduce the cost of memory to each process.
48 *

--- 997 unchanged lines hidden (view full) ---

1046 ix = 0;
1047 do {
1048 *(int *)pte++ = npte;
1049 /*TBIS(va);*/
1050 npte += NBPG;
1051 va += NBPG;
1052 } while (++ix != i386pagesperpage);
1053 pte--;
40
41/*
42 * Derived from hp300 version by Mike Hibler, this version by William
43 * Jolitz uses a recursive map [a pde points to the page directory] to
44 * map the page tables using the pagetables themselves. This is done to
45 * reduce the impact on kernel virtual memory for lots of sparse address
46 * space, and to reduce the cost of memory to each process.
47 *

--- 997 unchanged lines hidden (view full) ---

1045 ix = 0;
1046 do {
1047 *(int *)pte++ = npte;
1048 /*TBIS(va);*/
1049 npte += NBPG;
1050 va += NBPG;
1051 } while (++ix != i386pagesperpage);
1052 pte--;
1054#ifdef DEBUGx
1055cache, tlb flushes
1056#endif
1057/*pads(pmap);*/
1058 /*load_cr3(((struct pcb *)curproc->p_addr)->pcb_ptd);*/
1059 tlbflush();
1060}
1061
1062/*
1063 * pmap_page_protect:
1064 *

--- 89 unchanged lines hidden (view full) ---

1154 register pmap_t pmap;
1155 vm_offset_t va;
1156{
1157
1158#ifdef DEBUGx
1159 if (pmapdebug & PDB_FOLLOW)
1160 printf("pmap_pte(%x, %x) ->\n", pmap, va);
1161#endif
1053/*pads(pmap);*/
1054 /*load_cr3(((struct pcb *)curproc->p_addr)->pcb_ptd);*/
1055 tlbflush();
1056}
1057
1058/*
1059 * pmap_page_protect:
1060 *

--- 89 unchanged lines hidden (view full) ---

1150 register pmap_t pmap;
1151 vm_offset_t va;
1152{
1153
1154#ifdef DEBUGx
1155 if (pmapdebug & PDB_FOLLOW)
1156 printf("pmap_pte(%x, %x) ->\n", pmap, va);
1157#endif
1158
1162 if (pmap && pmap_pde_v(pmap_pde(pmap, va))) {
1163
1164 /* are we current address space or kernel? */
1165 if (pmap->pm_pdir[PTDPTDI].pd_pfnum == PTDpde.pd_pfnum
1166 || pmap == kernel_pmap)
1167 return ((struct pte *) vtopte(va));
1168
1169 /* otherwise, we are alternate address space */

--- 536 unchanged lines hidden (view full) ---

1706pads(pm) pmap_t pm; {
1707 unsigned va, i, j;
1708 struct pte *ptep;
1709
1710 if(pm == kernel_pmap) return;
1711 for (i = 0; i < 1024; i++)
1712 if(pm->pm_pdir[i].pd_v)
1713 for (j = 0; j < 1024 ; j++) {
1159 if (pmap && pmap_pde_v(pmap_pde(pmap, va))) {
1160
1161 /* are we current address space or kernel? */
1162 if (pmap->pm_pdir[PTDPTDI].pd_pfnum == PTDpde.pd_pfnum
1163 || pmap == kernel_pmap)
1164 return ((struct pte *) vtopte(va));
1165
1166 /* otherwise, we are alternate address space */

--- 536 unchanged lines hidden (view full) ---

1703pads(pm) pmap_t pm; {
1704 unsigned va, i, j;
1705 struct pte *ptep;
1706
1707 if(pm == kernel_pmap) return;
1708 for (i = 0; i < 1024; i++)
1709 if(pm->pm_pdir[i].pd_v)
1710 for (j = 0; j < 1024 ; j++) {
1714 va = (i<<22)+(j<<12);
1711 va = (i<<PD_SHIFT)+(j<<PG_SHIFT);
1715 if (pm == kernel_pmap && va < KERNBASE)
1716 continue;
1717 if (pm != kernel_pmap && va > UPT_MAX_ADDRESS)
1718 continue;
1719 ptep = pmap_pte(pm, va);
1720 if(pmap_pte_v(ptep))
1721 printf("%x:%x ", va, *(int *)ptep);
1722 } ;
1723
1724}
1725#endif
1712 if (pm == kernel_pmap && va < KERNBASE)
1713 continue;
1714 if (pm != kernel_pmap && va > UPT_MAX_ADDRESS)
1715 continue;
1716 ptep = pmap_pte(pm, va);
1717 if(pmap_pte_v(ptep))
1718 printf("%x:%x ", va, *(int *)ptep);
1719 } ;
1720
1721}
1722#endif