1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-04 09:09:56 +00:00

Hide access to vmspace:vm_pmap with inline function vmspace_pmap(). This

is the preparation step for moving pmap storage out of vmspace proper.

Reviewed by:	Alan Cox	<alc@cs.rice.edu>
		Matthew Dillion	<dillon@apollo.backplane.com>
This commit is contained in:
Luoqi Chen 1999-02-19 14:25:37 +00:00
parent f19dd898a1
commit b1028ad122
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=44146
29 changed files with 98 additions and 116 deletions

View File

@ -43,7 +43,7 @@
* from: @(#)pmap.c 7.7 (Berkeley) 5/12/91
* from: i386 Id: pmap.c,v 1.193 1998/04/19 15:22:48 bde Exp
* with some ideas from NetBSD's alpha pmap
* $Id: pmap.c,v 1.13 1999/01/21 08:29:02 dillon Exp $
* $Id: pmap.c,v 1.14 1999/01/24 06:04:50 dillon Exp $
*/
/*
@ -781,7 +781,7 @@ pmap_get_asn(pmap_t pmap)
for (p = allproc.lh_first;
p != 0; p = p->p_list.le_next) {
if (p->p_vmspace) {
tpmap = &p->p_vmspace->vm_pmap;
tpmap = vmspace_pmap(p->p_vmspace);
tpmap->pm_asngen = 0;
}
}
@ -1604,7 +1604,7 @@ pmap_growkernel(vm_offset_t addr)
for (p = allproc.lh_first; p != 0; p = p->p_list.le_next) {
if (p->p_vmspace) {
pmap = &p->p_vmspace->vm_pmap;
pmap = vmspace_pmap(p->p_vmspace);
*pmap_lev1pte(pmap, kernel_vm_end) = newlev1;
}
}
@ -2399,7 +2399,7 @@ pmap_prefault(pmap, addra, entry)
vm_page_t m, mpte;
vm_object_t object;
if (!curproc || (pmap != &curproc->p_vmspace->vm_pmap))
if (!curproc || (pmap != vmspace_pmap(curproc->p_vmspace)))
return;
object = entry->object.vm_object;
@ -2626,7 +2626,7 @@ pmap_remove_pages(pmap, sva, eva)
int s;
#ifdef PMAP_REMOVE_PAGES_CURPROC_ONLY
if (!curproc || (pmap != &curproc->p_vmspace->vm_pmap)) {
if (!curproc || (pmap != vmspace_pmap(curproc->p_vmspace))) {
printf("warning: pmap_remove_pages called with non-current pmap\n");
return;
}
@ -3115,7 +3115,7 @@ pmap_activate(struct proc *p)
{
pmap_t pmap;
pmap = &p->p_vmspace->vm_pmap;
pmap = vmspace_pmap(p->p_vmspace);
if (pmap_active && pmap != pmap_active) {
pmap_active->pm_active = 0;
@ -3142,7 +3142,7 @@ void
pmap_deactivate(struct proc *p)
{
pmap_t pmap;
pmap = &p->p_vmspace->vm_pmap;
pmap = vmspace_pmap(p->p_vmspace);
pmap->pm_active = 0;
pmap_active = 0;
}
@ -3167,7 +3167,7 @@ pmap_pid_dump(int pid) {
if (p->p_vmspace) {
int i,j;
index = 0;
pmap = &p->p_vmspace->vm_pmap;
pmap = vmspace_pmap(p->p_vmspace);
for(i=0;i<1024;i++) {
pd_entry_t *pde;
pt_entry_t *pte;

View File

@ -22,7 +22,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: mp_machdep.c,v 1.88 1999/01/20 04:24:22 jkh Exp $
* $Id: mp_machdep.c,v 1.89 1999/01/28 01:59:50 dillon Exp $
*/
#include "opt_smp.h"
@ -2390,8 +2390,7 @@ forwarded_statclock(int id, int pscnt, int *astmap)
ru->ru_ixrss += vm->vm_tsize * PAGE_SIZE / 1024;
ru->ru_idrss += vm->vm_dsize * PAGE_SIZE / 1024;
ru->ru_isrss += vm->vm_ssize * PAGE_SIZE / 1024;
rss = vm->vm_pmap.pm_stats.resident_count *
PAGE_SIZE / 1024;
rss = vmspace_resident_count(vm) * PAGE_SIZE / 1024;
if (ru->ru_maxrss < rss)
ru->ru_maxrss = rss;
}

View File

@ -22,7 +22,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: mp_machdep.c,v 1.88 1999/01/20 04:24:22 jkh Exp $
* $Id: mp_machdep.c,v 1.89 1999/01/28 01:59:50 dillon Exp $
*/
#include "opt_smp.h"
@ -2390,8 +2390,7 @@ forwarded_statclock(int id, int pscnt, int *astmap)
ru->ru_ixrss += vm->vm_tsize * PAGE_SIZE / 1024;
ru->ru_idrss += vm->vm_dsize * PAGE_SIZE / 1024;
ru->ru_isrss += vm->vm_ssize * PAGE_SIZE / 1024;
rss = vm->vm_pmap.pm_stats.resident_count *
PAGE_SIZE / 1024;
rss = vmspace_resident_count(vm) * PAGE_SIZE / 1024;
if (ru->ru_maxrss < rss)
ru->ru_maxrss = rss;
}

View File

@ -39,7 +39,7 @@
* SUCH DAMAGE.
*
* from: @(#)pmap.c 7.7 (Berkeley) 5/12/91
* $Id: pmap.c,v 1.221 1999/01/24 06:04:51 dillon Exp $
* $Id: pmap.c,v 1.222 1999/01/28 01:59:50 dillon Exp $
*/
/*
@ -1553,12 +1553,12 @@ pmap_growkernel(vm_offset_t addr)
for (p = allproc.lh_first; p != 0; p = p->p_list.le_next) {
if (p->p_vmspace) {
pmap = &p->p_vmspace->vm_pmap;
pmap = vmspace_pmap(p->p_vmspace);
*pmap_pde(pmap, kernel_vm_end) = newpdir;
}
}
if (aiovmspace != NULL) {
pmap = &aiovmspace->vm_pmap;
pmap = vmspace_pmap(aiovmspace);
*pmap_pde(pmap, kernel_vm_end) = newpdir;
}
*pmap_pde(kernel_pmap, kernel_vm_end) = newpdir;
@ -1992,7 +1992,7 @@ pmap_remove_all(pa)
vm_page_dirty(ppv->pv_vm_page);
}
if (!update_needed &&
((!curproc || (&curproc->p_vmspace->vm_pmap == pv->pv_pmap)) ||
((!curproc || (vmspace_pmap(curproc->p_vmspace) == pv->pv_pmap)) ||
(pv->pv_pmap == kernel_pmap))) {
update_needed = 1;
}
@ -2572,7 +2572,7 @@ pmap_prefault(pmap, addra, entry)
vm_page_t m, mpte;
vm_object_t object;
if (!curproc || (pmap != &curproc->p_vmspace->vm_pmap))
if (!curproc || (pmap != vmspace_pmap(curproc->p_vmspace)))
return;
object = entry->object.vm_object;
@ -2975,7 +2975,7 @@ pmap_remove_pages(pmap, sva, eva)
int s;
#ifdef PMAP_REMOVE_PAGES_CURPROC_ONLY
if (!curproc || (pmap != &curproc->p_vmspace->vm_pmap)) {
if (!curproc || (pmap != vmspace_pmap(curproc->p_vmspace))) {
printf("warning: pmap_remove_pages called with non-current pmap\n");
return;
}
@ -3418,7 +3418,7 @@ pmap_activate(struct proc *p)
tlb_flush_count++;
#endif
load_cr3(p->p_addr->u_pcb.pcb_cr3 =
vtophys(p->p_vmspace->vm_pmap.pm_pdir));
vtophys(vmspace_pmap(p->p_vmspace)->pm_pdir));
}
vm_offset_t
@ -3446,7 +3446,7 @@ pmap_pid_dump(int pid) {
if (p->p_vmspace) {
int i,j;
index = 0;
pmap = &p->p_vmspace->vm_pmap;
pmap = vmspace_pmap(p->p_vmspace);
for(i=0;i<1024;i++) {
pd_entry_t *pde;
unsigned *pte;

View File

@ -38,7 +38,7 @@
*
* from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91
* Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$
* $Id: vm_machdep.c,v 1.118 1999/02/08 02:42:12 dillon Exp $
* $Id: vm_machdep.c,v 1.119 1999/02/16 10:49:48 dfr Exp $
*/
#include "npx.h"
@ -144,7 +144,7 @@ cpu_fork(p1, p2)
* Set registers for trampoline to user mode. Leave space for the
* return address on stack. These are the kernel mode register values.
*/
pcb2->pcb_cr3 = vtophys(p2->p_vmspace->vm_pmap.pm_pdir);
pcb2->pcb_cr3 = vtophys(vmspace_pmap(p2->p_vmspace)->pm_pdir);
pcb2->pcb_edi = p2->p_md.md_regs->tf_edi;
pcb2->pcb_esi = (int)fork_return;
pcb2->pcb_ebp = p2->p_md.md_regs->tf_ebp;

View File

@ -22,7 +22,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: mp_machdep.c,v 1.88 1999/01/20 04:24:22 jkh Exp $
* $Id: mp_machdep.c,v 1.89 1999/01/28 01:59:50 dillon Exp $
*/
#include "opt_smp.h"
@ -2390,8 +2390,7 @@ forwarded_statclock(int id, int pscnt, int *astmap)
ru->ru_ixrss += vm->vm_tsize * PAGE_SIZE / 1024;
ru->ru_idrss += vm->vm_dsize * PAGE_SIZE / 1024;
ru->ru_isrss += vm->vm_ssize * PAGE_SIZE / 1024;
rss = vm->vm_pmap.pm_stats.resident_count *
PAGE_SIZE / 1024;
rss = vmspace_resident_count(vm) * PAGE_SIZE / 1024;
if (ru->ru_maxrss < rss)
ru->ru_maxrss = rss;
}

View File

@ -36,7 +36,7 @@
*
* @(#)procfs_status.c 8.3 (Berkeley) 2/17/94
*
* $Id: procfs_map.c,v 1.20 1999/02/05 06:18:54 jdp Exp $
* $Id: procfs_map.c,v 1.21 1999/02/07 21:48:21 dillon Exp $
*/
#include <sys/param.h>
@ -76,7 +76,7 @@ procfs_domap(curp, p, pfs, uio)
int len;
int error;
vm_map_t map = &p->p_vmspace->vm_map;
pmap_t pmap = &p->p_vmspace->vm_pmap;
pmap_t pmap = vmspace_pmap(p->p_vmspace);
vm_map_entry_t entry;
char mebuffer[MEBUFFERSIZE];

View File

@ -22,7 +22,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: mp_machdep.c,v 1.88 1999/01/20 04:24:22 jkh Exp $
* $Id: mp_machdep.c,v 1.89 1999/01/28 01:59:50 dillon Exp $
*/
#include "opt_smp.h"
@ -2390,8 +2390,7 @@ forwarded_statclock(int id, int pscnt, int *astmap)
ru->ru_ixrss += vm->vm_tsize * PAGE_SIZE / 1024;
ru->ru_idrss += vm->vm_dsize * PAGE_SIZE / 1024;
ru->ru_isrss += vm->vm_ssize * PAGE_SIZE / 1024;
rss = vm->vm_pmap.pm_stats.resident_count *
PAGE_SIZE / 1024;
rss = vmspace_resident_count(vm) * PAGE_SIZE / 1024;
if (ru->ru_maxrss < rss)
ru->ru_maxrss = rss;
}

View File

@ -22,7 +22,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: mp_machdep.c,v 1.88 1999/01/20 04:24:22 jkh Exp $
* $Id: mp_machdep.c,v 1.89 1999/01/28 01:59:50 dillon Exp $
*/
#include "opt_smp.h"
@ -2390,8 +2390,7 @@ forwarded_statclock(int id, int pscnt, int *astmap)
ru->ru_ixrss += vm->vm_tsize * PAGE_SIZE / 1024;
ru->ru_idrss += vm->vm_dsize * PAGE_SIZE / 1024;
ru->ru_isrss += vm->vm_ssize * PAGE_SIZE / 1024;
rss = vm->vm_pmap.pm_stats.resident_count *
PAGE_SIZE / 1024;
rss = vmspace_resident_count(vm) * PAGE_SIZE / 1024;
if (ru->ru_maxrss < rss)
ru->ru_maxrss = rss;
}

View File

@ -39,7 +39,7 @@
* SUCH DAMAGE.
*
* from: @(#)pmap.c 7.7 (Berkeley) 5/12/91
* $Id: pmap.c,v 1.221 1999/01/24 06:04:51 dillon Exp $
* $Id: pmap.c,v 1.222 1999/01/28 01:59:50 dillon Exp $
*/
/*
@ -1553,12 +1553,12 @@ pmap_growkernel(vm_offset_t addr)
for (p = allproc.lh_first; p != 0; p = p->p_list.le_next) {
if (p->p_vmspace) {
pmap = &p->p_vmspace->vm_pmap;
pmap = vmspace_pmap(p->p_vmspace);
*pmap_pde(pmap, kernel_vm_end) = newpdir;
}
}
if (aiovmspace != NULL) {
pmap = &aiovmspace->vm_pmap;
pmap = vmspace_pmap(aiovmspace);
*pmap_pde(pmap, kernel_vm_end) = newpdir;
}
*pmap_pde(kernel_pmap, kernel_vm_end) = newpdir;
@ -1992,7 +1992,7 @@ pmap_remove_all(pa)
vm_page_dirty(ppv->pv_vm_page);
}
if (!update_needed &&
((!curproc || (&curproc->p_vmspace->vm_pmap == pv->pv_pmap)) ||
((!curproc || (vmspace_pmap(curproc->p_vmspace) == pv->pv_pmap)) ||
(pv->pv_pmap == kernel_pmap))) {
update_needed = 1;
}
@ -2572,7 +2572,7 @@ pmap_prefault(pmap, addra, entry)
vm_page_t m, mpte;
vm_object_t object;
if (!curproc || (pmap != &curproc->p_vmspace->vm_pmap))
if (!curproc || (pmap != vmspace_pmap(curproc->p_vmspace)))
return;
object = entry->object.vm_object;
@ -2975,7 +2975,7 @@ pmap_remove_pages(pmap, sva, eva)
int s;
#ifdef PMAP_REMOVE_PAGES_CURPROC_ONLY
if (!curproc || (pmap != &curproc->p_vmspace->vm_pmap)) {
if (!curproc || (pmap != vmspace_pmap(curproc->p_vmspace))) {
printf("warning: pmap_remove_pages called with non-current pmap\n");
return;
}
@ -3418,7 +3418,7 @@ pmap_activate(struct proc *p)
tlb_flush_count++;
#endif
load_cr3(p->p_addr->u_pcb.pcb_cr3 =
vtophys(p->p_vmspace->vm_pmap.pm_pdir));
vtophys(vmspace_pmap(p->p_vmspace)->pm_pdir));
}
vm_offset_t
@ -3446,7 +3446,7 @@ pmap_pid_dump(int pid) {
if (p->p_vmspace) {
int i,j;
index = 0;
pmap = &p->p_vmspace->vm_pmap;
pmap = vmspace_pmap(p->p_vmspace);
for(i=0;i<1024;i++) {
pd_entry_t *pde;
unsigned *pte;

View File

@ -38,7 +38,7 @@
*
* from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91
* Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$
* $Id: vm_machdep.c,v 1.118 1999/02/08 02:42:12 dillon Exp $
* $Id: vm_machdep.c,v 1.119 1999/02/16 10:49:48 dfr Exp $
*/
#include "npx.h"
@ -144,7 +144,7 @@ cpu_fork(p1, p2)
* Set registers for trampoline to user mode. Leave space for the
* return address on stack. These are the kernel mode register values.
*/
pcb2->pcb_cr3 = vtophys(p2->p_vmspace->vm_pmap.pm_pdir);
pcb2->pcb_cr3 = vtophys(vmspace_pmap(p2->p_vmspace)->pm_pdir);
pcb2->pcb_edi = p2->p_md.md_regs->tf_edi;
pcb2->pcb_esi = (int)fork_return;
pcb2->pcb_ebp = p2->p_md.md_regs->tf_ebp;

View File

@ -22,7 +22,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: mp_machdep.c,v 1.88 1999/01/20 04:24:22 jkh Exp $
* $Id: mp_machdep.c,v 1.89 1999/01/28 01:59:50 dillon Exp $
*/
#include "opt_smp.h"
@ -2390,8 +2390,7 @@ forwarded_statclock(int id, int pscnt, int *astmap)
ru->ru_ixrss += vm->vm_tsize * PAGE_SIZE / 1024;
ru->ru_idrss += vm->vm_dsize * PAGE_SIZE / 1024;
ru->ru_isrss += vm->vm_ssize * PAGE_SIZE / 1024;
rss = vm->vm_pmap.pm_stats.resident_count *
PAGE_SIZE / 1024;
rss = vmspace_resident_count(vm) * PAGE_SIZE / 1024;
if (ru->ru_maxrss < rss)
ru->ru_maxrss = rss;
}

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: imgact_aout.c,v 1.44 1999/01/01 14:41:51 bde Exp $
* $Id: imgact_aout.c,v 1.45 1999/01/29 22:59:43 dillon Exp $
*/
#include <sys/param.h>
@ -200,7 +200,7 @@ exec_aout_imgact(imgp)
return (error);
}
pmap_object_init_pt(&vmspace->vm_pmap, virtual_offset,
pmap_object_init_pt(vmspace_pmap(vmspace), virtual_offset,
object, (vm_pindex_t) OFF_TO_IDX(file_offset),
a_out->a_text + a_out->a_data, 0);

View File

@ -26,7 +26,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: imgact_elf.c,v 1.52 1999/02/07 21:48:21 dillon Exp $
* $Id: imgact_elf.c,v 1.53 1999/02/07 23:49:56 jdp Exp $
*/
#include "opt_rlimit.h"
@ -226,7 +226,7 @@ elf_load_section(struct proc *p, struct vmspace *vmspace, struct vnode *vp, vm_o
return EINVAL;
/* prefault the page tables */
pmap_object_init_pt(&vmspace->vm_pmap,
pmap_object_init_pt(vmspace_pmap(vmspace),
map_addr,
object,
(vm_pindex_t) OFF_TO_IDX(file_addr),

View File

@ -39,7 +39,7 @@
* SUCH DAMAGE.
*
* @(#)init_main.c 8.9 (Berkeley) 1/21/94
* $Id: init_main.c,v 1.107 1999/01/30 19:36:02 msmith Exp $
* $Id: init_main.c,v 1.108 1999/02/17 21:03:14 luoqi Exp $
*/
#include "opt_devfs.h"
@ -443,12 +443,12 @@ proc0_init(dummy)
/* Allocate a prototype map so we have something to fork. */
pmap_pinit0(&vmspace0.vm_pmap);
pmap_pinit0(vmspace_pmap(&vmspace0));
p->p_vmspace = &vmspace0;
vmspace0.vm_refcnt = 1;
vm_map_init(&vmspace0.vm_map, round_page(VM_MIN_ADDRESS),
trunc_page(VM_MAXUSER_ADDRESS));
vmspace0.vm_map.pmap = &vmspace0.vm_pmap;
vmspace0.vm_map.pmap = vmspace_pmap(&vmspace0);
p->p_addr = proc0paddr; /* XXX */
#ifndef __alpha__ /* XXX what is this? */

View File

@ -37,7 +37,7 @@
* SUCH DAMAGE.
*
* @(#)kern_clock.c 8.5 (Berkeley) 1/21/94
* $Id: kern_clock.c,v 1.85 1998/11/23 09:58:53 phk Exp $
* $Id: kern_clock.c,v 1.86 1998/11/29 20:31:02 phk Exp $
*/
#include <sys/param.h>
@ -472,8 +472,7 @@ statclock(frame)
ru->ru_ixrss += vm->vm_tsize * PAGE_SIZE / 1024;
ru->ru_idrss += vm->vm_dsize * PAGE_SIZE / 1024;
ru->ru_isrss += vm->vm_ssize * PAGE_SIZE / 1024;
rss = vm->vm_pmap.pm_stats.resident_count *
PAGE_SIZE / 1024;
rss = vmspace_resident_count(vm) * PAGE_SIZE / 1024;
if (ru->ru_maxrss < rss)
ru->ru_maxrss = rss;
}

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: kern_exec.c,v 1.94 1999/01/27 21:49:55 dillon Exp $
* $Id: kern_exec.c,v 1.95 1999/01/28 00:57:47 dillon Exp $
*/
#include <sys/param.h>
@ -443,7 +443,7 @@ exec_new_vmspace(imgp)
if (vmspace->vm_refcnt == 1) {
if (vmspace->vm_shm)
shmexit(imgp->proc);
pmap_remove_pages(&vmspace->vm_pmap, 0, VM_MAXUSER_ADDRESS);
pmap_remove_pages(vmspace_pmap(vmspace), 0, VM_MAXUSER_ADDRESS);
vm_map_remove(map, 0, VM_MAXUSER_ADDRESS);
} else {
vmspace_exec(imgp->proc);

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)kern_exit.c 8.7 (Berkeley) 2/12/94
* $Id: kern_exit.c,v 1.73 1999/01/30 06:25:00 newton Exp $
* $Id: kern_exit.c,v 1.74 1999/01/31 03:15:13 newton Exp $
*/
#include "opt_compat.h"
@ -217,7 +217,7 @@ exit1(p, rv)
if (vm->vm_refcnt == 1) {
if (vm->vm_shm)
shmexit(p);
pmap_remove_pages(&vm->vm_pmap, VM_MIN_ADDRESS,
pmap_remove_pages(vmspace_pmap(vm), VM_MIN_ADDRESS,
VM_MAXUSER_ADDRESS);
(void) vm_map_remove(&vm->vm_map, VM_MIN_ADDRESS,
VM_MAXUSER_ADDRESS);

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)kern_proc.c 8.7 (Berkeley) 2/14/95
* $Id: kern_proc.c,v 1.44 1999/01/26 02:38:10 julian Exp $
* $Id: kern_proc.c,v 1.45 1999/01/28 00:57:47 dillon Exp $
*/
#include <sys/param.h>
@ -420,23 +420,8 @@ fill_eproc(p, ep)
}
if (p->p_stat != SIDL && p->p_stat != SZOMB && p->p_vmspace != NULL) {
register struct vmspace *vm = p->p_vmspace;
#ifdef pmap_resident_count
ep->e_vm.vm_rssize = pmap_resident_count(&vm->vm_pmap); /*XXX*/
#else
ep->e_vm.vm_rssize = vm->vm_rssize;
#endif
ep->e_vm.vm_tsize = vm->vm_tsize;
ep->e_vm.vm_dsize = vm->vm_dsize;
ep->e_vm.vm_ssize = vm->vm_ssize;
ep->e_vm.vm_taddr = vm->vm_taddr;
ep->e_vm.vm_daddr = vm->vm_daddr;
ep->e_vm.vm_minsaddr = vm->vm_minsaddr;
ep->e_vm.vm_maxsaddr = vm->vm_maxsaddr;
ep->e_vm.vm_map = vm->vm_map;
#ifndef sparc
ep->e_vm.vm_pmap = vm->vm_pmap;
#endif
ep->e_vm = *vm;
ep->e_vm.vm_rssize = vmspace_resident_count(vm); /*XXX*/
}
if (p->p_pptr)
ep->e_ppid = p->p_pptr->p_pid;

View File

@ -37,7 +37,7 @@
* SUCH DAMAGE.
*
* @(#)kern_clock.c 8.5 (Berkeley) 1/21/94
* $Id: kern_clock.c,v 1.85 1998/11/23 09:58:53 phk Exp $
* $Id: kern_clock.c,v 1.86 1998/11/29 20:31:02 phk Exp $
*/
#include <sys/param.h>
@ -472,8 +472,7 @@ statclock(frame)
ru->ru_ixrss += vm->vm_tsize * PAGE_SIZE / 1024;
ru->ru_idrss += vm->vm_dsize * PAGE_SIZE / 1024;
ru->ru_isrss += vm->vm_ssize * PAGE_SIZE / 1024;
rss = vm->vm_pmap.pm_stats.resident_count *
PAGE_SIZE / 1024;
rss = vmspace_resident_count(vm) * PAGE_SIZE / 1024;
if (ru->ru_maxrss < rss)
ru->ru_maxrss = rss;
}

View File

@ -22,7 +22,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: mp_machdep.c,v 1.88 1999/01/20 04:24:22 jkh Exp $
* $Id: mp_machdep.c,v 1.89 1999/01/28 01:59:50 dillon Exp $
*/
#include "opt_smp.h"
@ -2390,8 +2390,7 @@ forwarded_statclock(int id, int pscnt, int *astmap)
ru->ru_ixrss += vm->vm_tsize * PAGE_SIZE / 1024;
ru->ru_idrss += vm->vm_dsize * PAGE_SIZE / 1024;
ru->ru_isrss += vm->vm_ssize * PAGE_SIZE / 1024;
rss = vm->vm_pmap.pm_stats.resident_count *
PAGE_SIZE / 1024;
rss = vmspace_resident_count(vm) * PAGE_SIZE / 1024;
if (ru->ru_maxrss < rss)
ru->ru_maxrss = rss;
}

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)tty.c 8.8 (Berkeley) 1/21/94
* $Id: tty.c,v 1.112 1999/01/28 17:32:00 dillon Exp $
* $Id: tty.c,v 1.113 1999/01/30 12:17:36 phk Exp $
*/
/*-
@ -2275,12 +2275,7 @@ ttyinfo(tp)
ttyprintf(tp, "%d%% %ldk\n",
tmp / 100,
pick->p_stat == SIDL || pick->p_stat == SZOMB ? 0 :
#ifdef pmap_resident_count
(long)pgtok(pmap_resident_count(&pick->p_vmspace->vm_pmap))
#else
(long)pgtok(pick->p_vmspace->vm_rssize)
#endif
);
(long)pgtok(vmspace_resident_count(pick->p_vmspace)));
}
tp->t_rocount = 0; /* so pending input will be retyped if BS */
}

View File

@ -13,7 +13,7 @@
* bad that happens because of using this software isn't the responsibility
* of the author. This software is distributed AS-IS.
*
* $Id: vfs_aio.c,v 1.41 1999/01/29 08:29:04 bde Exp $
* $Id: vfs_aio.c,v 1.42 1999/01/29 23:18:49 dillon Exp $
*/
/*
@ -631,7 +631,7 @@ aio_daemon(const void *uproc)
*/
if (myvm->vm_shm)
shmexit(mycp);
pmap_remove_pages(&myvm->vm_pmap, 0, USRSTACK);
pmap_remove_pages(vmspace_pmap(myvm), 0, USRSTACK);
vm_map_remove(&myvm->vm_map, 0, USRSTACK);
myvm->vm_tsize = 0;
myvm->vm_dsize = 0;

View File

@ -36,7 +36,7 @@
*
* @(#)procfs_status.c 8.3 (Berkeley) 2/17/94
*
* $Id: procfs_map.c,v 1.20 1999/02/05 06:18:54 jdp Exp $
* $Id: procfs_map.c,v 1.21 1999/02/07 21:48:21 dillon Exp $
*/
#include <sys/param.h>
@ -76,7 +76,7 @@ procfs_domap(curp, p, pfs, uio)
int len;
int error;
vm_map_t map = &p->p_vmspace->vm_map;
pmap_t pmap = &p->p_vmspace->vm_pmap;
pmap_t pmap = vmspace_pmap(p->p_vmspace);
vm_map_entry_t entry;
char mebuffer[MEBUFFERSIZE];

View File

@ -59,7 +59,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* $Id: vm_glue.c,v 1.82 1999/01/21 09:36:23 dillon Exp $
* $Id: vm_glue.c,v 1.83 1999/01/26 02:38:12 julian Exp $
*/
#include "opt_rlimit.h"
@ -511,8 +511,7 @@ swapout(p)
/*
* remember the process resident count
*/
p->p_vmspace->vm_swrss =
p->p_vmspace->vm_pmap.pm_stats.resident_count;
p->p_vmspace->vm_swrss = vmspace_resident_count(p->p_vmspace);
(void) splhigh();
p->p_flag &= ~P_INMEM;

View File

@ -61,7 +61,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* $Id: vm_map.c,v 1.149 1999/02/12 09:51:42 dillon Exp $
* $Id: vm_map.c,v 1.150 1999/02/19 03:11:37 dillon Exp $
*/
/*
@ -200,8 +200,8 @@ vmspace_alloc(min, max)
vm = zalloc(vmspace_zone);
bzero(&vm->vm_map, sizeof vm->vm_map);
vm_map_init(&vm->vm_map, min, max);
pmap_pinit(&vm->vm_pmap);
vm->vm_map.pmap = &vm->vm_pmap; /* XXX */
pmap_pinit(vmspace_pmap(vm));
vm->vm_map.pmap = vmspace_pmap(vm); /* XXX */
vm->vm_refcnt = 1;
vm->vm_shm = NULL;
return (vm);
@ -240,7 +240,7 @@ vmspace_free(vm)
vm->vm_map.max_offset);
vm_map_unlock(&vm->vm_map);
pmap_release(&vm->vm_pmap);
pmap_release(vmspace_pmap(vm));
zfree(vmspace_zone, vm);
}
}
@ -2290,7 +2290,7 @@ vmspace_fork(vm1)
vm2 = vmspace_alloc(old_map->min_offset, old_map->max_offset);
bcopy(&vm1->vm_startcopy, &vm2->vm_startcopy,
(caddr_t) (vm1 + 1) - (caddr_t) &vm1->vm_startcopy);
new_pmap = &vm2->vm_pmap; /* XXX */
new_pmap = vmspace_pmap(vm2); /* XXX */
new_map = &vm2->vm_map; /* XXX */
new_map->timestamp = 1;
@ -3039,7 +3039,7 @@ DB_SHOW_COMMAND(procvm, procvm)
db_printf("p = %p, vmspace = %p, map = %p, pmap = %p\n",
(void *)p, (void *)p->p_vmspace, (void *)&p->p_vmspace->vm_map,
(void *)&p->p_vmspace->vm_pmap);
(void *)vmspace_pmap(p->p_vmspace));
vm_map_print((db_expr_t)(intptr_t)&p->p_vmspace->vm_map, 1, 0, NULL);
}

View File

@ -61,7 +61,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* $Id: vm_map.h,v 1.34 1999/01/26 02:49:52 julian Exp $
* $Id: vm_map.h,v 1.35 1999/02/07 21:48:22 dillon Exp $
*/
/*
@ -282,6 +282,18 @@ _vm_map_lock_upgrade(vm_map_t map, struct proc *p) {
#define vm_map_max(map) ((map)->max_offset)
#define vm_map_pmap(map) ((map)->pmap)
static __inline struct pmap *
vmspace_pmap(struct vmspace *vmspace)
{
return &vmspace->vm_pmap;
}
static __inline long
vmspace_resident_count(struct vmspace *vmspace)
{
return pmap_resident_count(vmspace_pmap(vmspace));
}
/* XXX: number of kernel maps and entries to statically allocate */
#define MAX_KMAP 10
#define MAX_KMAPENT 128

View File

@ -38,7 +38,7 @@
* from: Utah $Hdr: vm_mmap.c 1.6 91/10/21$
*
* @(#)vm_mmap.c 8.4 (Berkeley) 1/12/94
* $Id: vm_mmap.c,v 1.88 1999/01/26 02:49:52 julian Exp $
* $Id: vm_mmap.c,v 1.89 1999/02/07 21:48:22 dillon Exp $
*/
/*
@ -644,7 +644,7 @@ madvise(p, uap)
end = round_page((vm_offset_t) uap->addr + uap->len);
map = &p->p_vmspace->vm_map;
pmap = &p->p_vmspace->vm_pmap;
pmap = vmspace_pmap(p->p_vmspace);
vm_map_madvise(map, pmap, start, end, uap->behav);
@ -693,7 +693,7 @@ mincore(p, uap)
vec = uap->vec;
map = &p->p_vmspace->vm_map;
pmap = &p->p_vmspace->vm_pmap;
pmap = vmspace_pmap(p->p_vmspace);
vm_map_lock(map);

View File

@ -65,7 +65,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* $Id: vm_pageout.c,v 1.135 1999/02/07 21:48:23 dillon Exp $
* $Id: vm_pageout.c,v 1.136 1999/02/08 00:37:36 dillon Exp $
*/
/*
@ -482,7 +482,7 @@ vm_pageout_object_deactivate_pages(map, object, desired, map_remove_only)
return;
while (object) {
if (vm_map_pmap(map)->pm_stats.resident_count <= desired)
if (pmap_resident_count(vm_map_pmap(map)) <= desired)
return;
if (object->paging_in_progress)
return;
@ -497,7 +497,7 @@ vm_pageout_object_deactivate_pages(map, object, desired, map_remove_only)
p = TAILQ_FIRST(&object->memq);
while (p && (rcount-- > 0)) {
int actcount;
if (vm_map_pmap(map)->pm_stats.resident_count <= desired)
if (pmap_resident_count(vm_map_pmap(map)) <= desired)
return;
next = TAILQ_NEXT(p, listq);
cnt.v_pdpages++;
@ -598,7 +598,7 @@ vm_pageout_map_deactivate_pages(map, desired)
*/
tmpe = map->header.next;
while (tmpe != &map->header) {
if (vm_map_pmap(map)->pm_stats.resident_count <= desired)
if (pmap_resident_count(vm_map_pmap(map)) <= desired)
break;
if ((tmpe->eflags & MAP_ENTRY_IS_SUB_MAP) == 0) {
obj = tmpe->object.vm_object;
@ -1158,7 +1158,7 @@ vm_pageout_scan()
/*
* get the process size
*/
size = p->p_vmspace->vm_pmap.pm_stats.resident_count;
size = vmspace_resident_count(p->p_vmspace);
/*
* if the this process is bigger than the biggest one
* remember it.
@ -1453,7 +1453,7 @@ vm_daemon()
if ((p->p_flag & P_INMEM) == 0)
limit = 0; /* XXX */
size = p->p_vmspace->vm_pmap.pm_stats.resident_count * PAGE_SIZE;
size = vmspace_resident_count(p->p_vmspace) * PAGE_SIZE;
if (limit >= 0 && size >= limit) {
vm_pageout_map_deactivate_pages(&p->p_vmspace->vm_map,
(vm_pindex_t)(limit >> PAGE_SHIFT) );