Eliminate vmspace.vm_pmap and all references to it unless

__VM_PMAP_HACK is defined (for temporary compatibility).
The __VM_PMAP_HACK code should be removed after all the
ports that define it have removed all vm_pmap references.
This commit is contained in:
gwr 1997-05-16 21:39:50 +00:00
parent e2a58b69f7
commit 09da7e273e
5 changed files with 46 additions and 32 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: init_main.c,v 1.98 1997/03/26 22:38:45 gwr Exp $ */
/* $NetBSD: init_main.c,v 1.99 1997/05/16 21:39:55 gwr Exp $ */
/*
* Copyright (c) 1995 Christopher G. Demetriou. All rights reserved.
@ -240,12 +240,9 @@ main(framep)
limit0.p_refcnt = 1;
/* Allocate a prototype map so we have something to fork. */
p->p_vmspace = &vmspace0;
vmspace0.vm_refcnt = 1;
pmap_pinit(&vmspace0.vm_pmap);
vm_map_init(&p->p_vmspace->vm_map, round_page(VM_MIN_ADDRESS),
trunc_page(VM_MAX_ADDRESS), TRUE);
vmspace0.vm_map.pmap = &vmspace0.vm_pmap;
p->p_vmspace = vmspace_alloc(round_page(VM_MIN_ADDRESS),
trunc_page(VM_MAX_ADDRESS), TRUE);
p->p_addr = proc0paddr; /* XXX */
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_sysctl.c,v 1.25 1997/03/21 06:50:48 mikel Exp $ */
/* $NetBSD: kern_sysctl.c,v 1.26 1997/05/16 21:39:57 gwr Exp $ */
/*-
* Copyright (c) 1982, 1986, 1989, 1993
@ -726,15 +726,10 @@ fill_eproc(p, ep)
} else {
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_rssize = vm_resident_count(vm);
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_pmap = vm->vm_pmap;
}
if (p->p_pptr)
ep->e_ppid = p->p_pptr->p_pid;

View File

@ -1,4 +1,4 @@
/* $NetBSD: tty.c,v 1.89 1997/04/07 16:09:28 kleink Exp $ */
/* $NetBSD: tty.c,v 1.90 1997/05/16 21:39:59 gwr Exp $ */
/*-
* Copyright (c) 1982, 1986, 1990, 1991, 1993
@ -1926,17 +1926,18 @@ ttyinfo(tp)
stime.tv_usec / 10000);
#define pgtok(a) (((u_long) ((a) * NBPG) / 1024))
/* Print percentage cpu, resident set size. */
/* Print percentage cpu. */
tmp = (pick->p_pctcpu * 10000 + FSCALE / 2) >> FSHIFT;
ttyprintf(tp, "%d%% %ldk\n",
tmp / 100,
pick->p_stat == SIDL || pick->p_stat == SZOMB ? 0 :
#ifdef pmap_resident_count
pgtok(pmap_resident_count(&pick->p_vmspace->vm_pmap))
#else
pgtok(pick->p_vmspace->vm_rssize)
#endif
);
ttyprintf(tp, "%d%% ", tmp / 100);
/* Print resident set size. */
if (pick->p_stat == SIDL || pick->p_stat == SZOMB)
tmp = 0;
else {
register struct vmspace *vm = pick->p_vmspace;
tmp = pgtok(vm_resident_count(vm));
}
ttyprintf(tp, "%ldk\n", tmp);
}
tp->t_rocount = 0; /* so pending input will be retyped if BS */
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: vm.h,v 1.13 1994/06/29 06:47:52 cgd Exp $ */
/* $NetBSD: vm.h,v 1.14 1997/05/16 21:39:50 gwr Exp $ */
/*
* Copyright (c) 1991, 1993
@ -76,7 +76,10 @@ typedef struct pager_struct *vm_pager_t;
*/
struct vmspace {
struct vm_map vm_map; /* VM address map */
#ifdef __VM_PMAP_HACK
/* XXX - All should use vm_map.pmap instead. */
struct pmap vm_pmap; /* private physical map */
#endif
int vm_refcnt; /* number of references */
caddr_t vm_shm; /* SYS5 shared memory private data XXX */
/* we copy from vm_startcopy to the end of the structure on fork */
@ -90,4 +93,11 @@ struct vmspace {
caddr_t vm_daddr; /* user virtual address of data XXX */
caddr_t vm_maxsaddr; /* user VA at max stack growth */
};
#ifdef pmap_resident_count
#define vm_resident_count(vm) (pmap_resident_count((vm)->vm_map.pmap))
#else
#define vm_resident_count(vm) ((vm)->vm_rssize)
#endif
#endif /* VM_H */

View File

@ -1,4 +1,4 @@
/* $NetBSD: vm_map.c,v 1.26 1997/02/25 23:27:08 thorpej Exp $ */
/* $NetBSD: vm_map.c,v 1.27 1997/05/16 21:39:53 gwr Exp $ */
/*
* Copyright (c) 1991, 1993
@ -186,11 +186,17 @@ vmspace_alloc(min, max, pageable)
{
register struct vmspace *vm;
MALLOC(vm, struct vmspace *, sizeof(struct vmspace), M_VMMAP, M_WAITOK);
bzero(vm, (caddr_t) &vm->vm_startcopy - (caddr_t) vm);
vm = (struct vmspace *)
malloc(sizeof(struct vmspace), M_VMMAP, M_WAITOK);
/* Just clear the whole struct. It is not large anyway. */
bzero(vm, sizeof(*vm));
vm_map_init(&vm->vm_map, min, max, pageable);
pmap_pinit(&vm->vm_pmap);
#ifdef __VM_PMAP_HACK
pmap_pinit(&vm->vm_pmap); /* XXX */
vm->vm_map.pmap = &vm->vm_pmap; /* XXX */
#else /* __VM_PMAP_HACK */
vm->vm_map.pmap = pmap_create(0);
#endif /* __VM_PMAP_HACK */
vm->vm_refcnt = 1;
return (vm);
}
@ -209,7 +215,12 @@ vmspace_free(vm)
vm_map_lock(&vm->vm_map);
(void) vm_map_delete(&vm->vm_map, vm->vm_map.min_offset,
vm->vm_map.max_offset);
pmap_release(&vm->vm_pmap);
#ifdef __VM_PMAP_HACK
pmap_release(&vm->vm_pmap); /* XXX */
#else /* __VM_PMAP_HACK */
pmap_destroy(vm->vm_map.pmap);
vm->vm_map.pmap = NULL;
#endif /* __VM_PMAP_HACK */
FREE(vm, M_VMMAP);
}
}
@ -2128,8 +2139,8 @@ vmspace_fork(vm1)
old_map->entries_pageable);
bcopy(&vm1->vm_startcopy, &vm2->vm_startcopy,
(caddr_t) (vm1 + 1) - (caddr_t) &vm1->vm_startcopy);
new_pmap = &vm2->vm_pmap; /* XXX */
new_map = &vm2->vm_map; /* XXX */
new_pmap = new_map->pmap;
old_entry = old_map->header.next;