pmap.h (6c5e9bbdf5bb93639ae4899ddef635fe2ecbdd49) | pmap.h (267173e72dc9f967f9d2a8f3bd1e88aae0a417bb) |
---|---|
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 * --- 28 unchanged lines hidden (view full) --- 37 * Derived from hp300 version by Mike Hibler, this version by William 38 * Jolitz uses a recursive map [a pde points to the page directory] to 39 * map the page tables using the pagetables themselves. This is done to 40 * reduce the impact on kernel virtual memory for lots of sparse address 41 * space, and to reduce the cost of memory to each process. 42 * 43 * from: hp300: @(#)pmap.h 7.2 (Berkeley) 12/16/90 44 * from: @(#)pmap.h 7.4 (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 * --- 28 unchanged lines hidden (view full) --- 37 * Derived from hp300 version by Mike Hibler, this version by William 38 * Jolitz uses a recursive map [a pde points to the page directory] to 39 * map the page tables using the pagetables themselves. This is done to 40 * reduce the impact on kernel virtual memory for lots of sparse address 41 * space, and to reduce the cost of memory to each process. 42 * 43 * from: hp300: @(#)pmap.h 7.2 (Berkeley) 12/16/90 44 * from: @(#)pmap.h 7.4 (Berkeley) 5/12/91 |
45 * $Id: pmap.h,v 1.31 1995/12/17 07:39:05 bde Exp $ | 45 * $Id: pmap.h,v 1.32 1996/01/30 22:54:48 mpp Exp $ |
46 */ 47 48#ifndef _MACHINE_PMAP_H_ 49#define _MACHINE_PMAP_H_ 50 51#include <machine/pte.h> 52 53typedef unsigned int *pd_entry_t; --- 100 unchanged lines hidden (view full) --- 154 155typedef struct pmap *pmap_t; 156 157#ifdef KERNEL 158extern pmap_t kernel_pmap; 159#endif 160 161/* | 46 */ 47 48#ifndef _MACHINE_PMAP_H_ 49#define _MACHINE_PMAP_H_ 50 51#include <machine/pte.h> 52 53typedef unsigned int *pd_entry_t; --- 100 unchanged lines hidden (view full) --- 154 155typedef struct pmap *pmap_t; 156 157#ifdef KERNEL 158extern pmap_t kernel_pmap; 159#endif 160 161/* |
162 * Macros for speed 163 */ 164#define PMAP_ACTIVATE(pmapp, pcbp) \ 165 if ((pmapp) != NULL /*&& (pmapp)->pm_pdchanged */) { \ 166 (pcbp)->pcb_cr3 = \ 167 pmap_extract(kernel_pmap, (vm_offset_t)(pmapp)->pm_pdir); \ 168 if ((pmapp) == &curproc->p_vmspace->vm_pmap) \ 169 load_cr3((pcbp)->pcb_cr3); \ 170 (pmapp)->pm_pdchanged = FALSE; \ 171 } 172 173#define PMAP_DEACTIVATE(pmapp, pcbp) 174 175/* | |
176 * For each vm_page_t, there is a list of all currently valid virtual 177 * mappings of that page. An entry is a pv_entry_t, the list is pv_table. 178 */ 179typedef struct pv_entry { 180 struct pv_entry *pv_next; /* next pv_entry */ 181 pmap_t pv_pmap; /* pmap where mapping lies */ 182 vm_offset_t pv_va; /* virtual address for mapping */ 183} *pv_entry_t; --- 16 unchanged lines hidden (view full) --- 200 201#define pa_index(pa) atop(pa - vm_first_phys) 202#define pa_to_pvh(pa) (&pv_table[pa_index(pa)]) 203 204#define pmap_resident_count(pmap) ((pmap)->pm_stats.resident_count) 205 206struct pcb; 207 | 162 * For each vm_page_t, there is a list of all currently valid virtual 163 * mappings of that page. An entry is a pv_entry_t, the list is pv_table. 164 */ 165typedef struct pv_entry { 166 struct pv_entry *pv_next; /* next pv_entry */ 167 pmap_t pv_pmap; /* pmap where mapping lies */ 168 vm_offset_t pv_va; /* virtual address for mapping */ 169} *pv_entry_t; --- 16 unchanged lines hidden (view full) --- 186 187#define pa_index(pa) atop(pa - vm_first_phys) 188#define pa_to_pvh(pa) (&pv_table[pa_index(pa)]) 189 190#define pmap_resident_count(pmap) ((pmap)->pm_stats.resident_count) 191 192struct pcb; 193 |
208void pmap_activate __P((pmap_t, struct pcb *)); | |
209void pmap_bootstrap __P(( vm_offset_t, vm_offset_t)); 210pmap_t pmap_kernel __P((void)); 211void *pmap_mapdev __P((vm_offset_t, vm_size_t)); 212pt_entry_t * __pure pmap_pte __P((pmap_t, vm_offset_t)) __pure2; 213void pmap_unuse_pt __P((pmap_t, vm_offset_t)); 214void pmap_use_pt __P((pmap_t, vm_offset_t)); 215 216#endif /* KERNEL */ 217 218#endif /* !_MACHINE_PMAP_H_ */ | 194void pmap_bootstrap __P(( vm_offset_t, vm_offset_t)); 195pmap_t pmap_kernel __P((void)); 196void *pmap_mapdev __P((vm_offset_t, vm_size_t)); 197pt_entry_t * __pure pmap_pte __P((pmap_t, vm_offset_t)) __pure2; 198void pmap_unuse_pt __P((pmap_t, vm_offset_t)); 199void pmap_use_pt __P((pmap_t, vm_offset_t)); 200 201#endif /* KERNEL */ 202 203#endif /* !_MACHINE_PMAP_H_ */ |