4.4 integration (VM and others) and cleanup.

This commit is contained in:
phil 1994-05-25 00:03:06 +00:00
parent 9a848c126d
commit 80678da8e7
7 changed files with 122 additions and 66 deletions

View File

@ -40,7 +40,7 @@
*
* @(#)conf.c 5.8 (Berkeley) 5/12/91
*
* $Id: conf.c,v 1.7 1994/05/17 17:31:33 phil Exp $
* $Id: conf.c,v 1.8 1994/05/25 00:03:06 phil Exp $
*/
#include "param.h"
@ -261,3 +261,14 @@ struct consdev constab[] = {
{ 0 },
};
/* end XXX */
/*
* Returns true if dev is /dev/zero.
*/
iszerodev(dev)
dev_t dev;
{
return (major(dev) == mem_no && minor(dev) == 12);
}

View File

@ -35,21 +35,21 @@
*
* @(#)genassym.c 5.11 (Berkeley) 5/10/91
*
* $Id: genassym.c,v 1.4 1994/05/17 17:31:34 phil Exp $
* $Id: genassym.c,v 1.5 1994/05/25 00:03:09 phil Exp $
*/
#include "sys/param.h"
#include "sys/buf.h"
#include "sys/vmmeter.h"
#include "sys/time.h"
#include "sys/proc.h"
#include "sys/user.h"
#include "sys/mbuf.h"
#include "sys/msgbuf.h"
#include "sys/resourcevar.h"
#include "machine/cpu.h"
#include "machine/trap.h"
#include "sys/syscall.h"
#include <sys/param.h>
#include <sys/buf.h>
#include <sys/time.h>
#include <sys/proc.h>
#include <sys/user.h>
#include <sys/mbuf.h>
#include <sys/msgbuf.h>
#include <sys/resourcevar.h>
#include <sys/syscall.h>
#include <machine/cpu.h>
#include <machine/trap.h>
#include <stdio.h>

View File

@ -321,7 +321,7 @@ cpu_startup(void)
/* avail_end was pre-decremented in pmap_bootstrap to compensate */
for (i = 0; i < btoc(sizeof (struct msgbuf)); i++)
pmap_enter(pmap_kernel(), msgbufp, avail_end + i * NBPG,
pmap_enter(kernel_pmap, msgbufp, avail_end + i * NBPG,
VM_PROT_ALL, TRUE);
msgbufmapped = 1;
@ -416,7 +416,7 @@ again:
*/
size = MAXBSIZE * nbuf;
buffer_map = kmem_suballoc(kernel_map, (vm_offset_t *)&buffers,
&maxaddr, size, FALSE);
&maxaddr, size, TRUE);
minaddr = (vm_offset_t)buffers;
if (vm_map_find(buffer_map, vm_object_allocate(size), (vm_offset_t)0,
&minaddr, size, FALSE) != KERN_SUCCESS)

View File

@ -1,7 +1,6 @@
/*-
* Copyright (c) 1988 University of Utah.
* Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
* All rights reserved.
/*- Copyright (c) 1988 University of Utah. Copyright (c) 1982, 1986,
*1990 The Regents of the University of California. All rights
*reserved.
*
* This code is derived from software contributed to Berkeley by
* the Systems Programming Group of the University of Utah Computer
@ -39,26 +38,23 @@
* from: Utah $Hdr: mem.c 1.13 89/10/08$
* @(#)mem.c 7.2 (Berkeley) 5/9/91
*
* mem.c,v 1.1.1.1 1993/09/09 23:53:47 phil Exp
*/
* mem.c,v 1.1.1.1 1993/09/09 23:53:47 phil Exp /
/*
* Memory special file
*/
#include <sys/param.h>
#include <sys/conf.h>
#include <sys/buf.h>
#include <sys/systm.h>
#include <sys/uio.h>
#include <sys/malloc.h>
#include <sys/proc.h>
#include <sys/fcntl.h>
#include "param.h"
#include "conf.h"
#include "buf.h"
#include "systm.h"
#include "uio.h"
#include "malloc.h"
#include <machine/cpu.h>
#include "machine/cpu.h"
#include "vm/vm_param.h"
#include "vm/lock.h"
#include "vm/pmap.h"
#include "vm/vm_prot.h"
#include <vm/vm.h>
extern char *vmmap; /* poor name! */
@ -162,7 +158,7 @@ mmrw(dev, uio, flags)
/* minor device 0 is physical memory */
case 0:
v = uio->uio_offset;
pmap_enter(pmap_kernel(), vmmap, v,
pmap_enter(kernel_pmap, vmmap, v,
uio->uio_rw == UIO_READ ? VM_PROT_READ : VM_PROT_WRITE,
TRUE);
o = (int)uio->uio_offset & PGOFSET;
@ -170,7 +166,7 @@ mmrw(dev, uio, flags)
c = MIN(c, (u_int)(NBPG - o));
c = MIN(c, (u_int)iov->iov_len);
error = uiomove((caddr_t)&vmmap[o], (int)c, uio);
pmap_remove(pmap_kernel(), vmmap, &vmmap[NBPG]);
pmap_remove(kernel_pmap, vmmap, &vmmap[NBPG]);
continue;
/* minor device 1 is kernel memory */

View File

@ -36,7 +36,7 @@
*
* @(#)pmap.c 7.7 (Berkeley) 5/12/91
*
* $Id: pmap.c,v 1.5 1994/05/03 07:30:33 phil Exp $
* $Id: pmap.c,v 1.6 1994/05/25 00:03:17 phil Exp $
*/
/*
@ -83,17 +83,19 @@
* and to when physical maps must be made correct.
*/
#include "param.h"
#include "proc.h"
#include "malloc.h"
#include "user.h"
#include <sys/param.h>
#include <sys/proc.h>
#include <sys/malloc.h>
#include <sys/user.h>
#include "vm/vm.h"
#include "vm/vm_param.h"
#include "vm/vm_kern.h"
#include "vm/vm_page.h"
#include <vm/vm.h>
#include <vm/vm_param.h>
#include <vm/vm_kern.h>
#include <vm/vm_page.h>
/* #include "vm/vm_pageout.h" */
/* XXX where should this really go? */
vm_offset_t pmap_extract(pmap_t, vm_offset_t);
/*
* Allocate various and sundry SYSMAPs used in the days of old VM
@ -211,6 +213,39 @@ struct msgbuf *msgbufp;
vm_offset_t KPTphys;
extern int PDRPDROFF;
/*
* Bootstrap memory allocator. This function allows for early dynamic
* memory allocation until the virtual memory system has been bootstrapped.
* After that point, either kmem_alloc or malloc should be used. This
* function works by stealing pages from the (to be) managed page pool,
* stealing virtual address space, then mapping the pages and zeroing them.
*
* It should be used from pmap_bootstrap till vm_page_startup, afterwards
* it cannot be used, and will generate a panic if tried. Note that this
* memory will never be freed, and in essence it is wired down.
*/
void *
pmap_bootstrap_alloc(size)
int size;
{
extern boolean_t vm_page_startup_initialized;
vm_offset_t val;
if (vm_page_startup_initialized)
panic("pmap_bootstrap_alloc: called after startup initialized")\
;
size = round_page(size);
val = virtual_avail;
virtual_avail = pmap_map(virtual_avail, avail_start,
avail_start + size, VM_PROT_READ|VM_PROT_WRITE);
avail_start += size;
blkclr ((caddr_t) val, size);
return ((void *) val);
}
/* static */
void
@ -1457,11 +1492,11 @@ pmap_activate(pmap, pcbp)
* Function:
* Returns the physical map handle for the kernel.
*/
pmap_t
/* pmap_t
pmap_kernel()
{
return (kernel_pmap);
}
} */
/*
* pmap_zero_page zeros the specified (machine independent)
@ -1525,6 +1560,7 @@ pmap_copy_page(src, dst)
* will specify that these pages are to be wired
* down (or not) as appropriate.
*/
void
pmap_pageable(pmap, sva, eva, pageable)
pmap_t pmap;
vm_offset_t sva, eva;

View File

@ -42,27 +42,24 @@
* 532 Trap and System call handling
*/
#include "sys/param.h"
#include "sys/systm.h"
#include "sys/proc.h"
#include "sys/user.h"
#include "sys/acct.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/proc.h>
#include <sys/user.h>
#include <sys/acct.h>
#include <sys/kernel.h>
#ifdef KTRACE
#include <sys/ktrace.h>
#endif
#include <sys/vmmeter.h>
#include "sys/syscall.h"
#include "vm/vm_param.h"
#include "vm/pmap.h"
#include "vm/vm_map.h"
#include "machine/cpu.h"
#include "machine/trap.h"
#include "machine/psl.h"
#include <sys/syscall.h>
#include <vm/vm_param.h>
#include <vm/pmap.h>
#include <vm/vm_map.h>
#include <machine/cpu.h>
#include <machine/trap.h>
#include <machine/psl.h>

View File

@ -37,20 +37,21 @@
*
* @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91
*
* $Id: vm_machdep.c,v 1.3 1994/05/20 06:44:35 phil Exp $
* $Id: vm_machdep.c,v 1.4 1994/05/25 00:03:22 phil Exp $
*/
/*
* Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$
*/
static char rcsid[] = "$Header: /cvsroot/src/sys/arch/pc532/pc532/Attic/vm_machdep.c,v 1.3 1994/05/20 06:44:35 phil Exp $";
static char rcsid[] = "$Header: /cvsroot/src/sys/arch/pc532/pc532/Attic/vm_machdep.c,v 1.4 1994/05/25 00:03:22 phil Exp $";
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/proc.h>
#include <sys/malloc.h>
#include <sys/vnode.h>
#include <sys/buf.h>
#include <user.h>
#include <sys/user.h>
#include <vm/vm.h>
#include <vm/vm_kern.h>
@ -167,6 +168,21 @@ cpu_wait(p)
}
#endif
/*
* Dump the machine specific header information at the start of a core dump.
*/
cpu_coredump(p, vp, cred)
struct proc *p;
struct vnode *vp;
struct ucred *cred;
{
return (vn_rdwr(UIO_WRITE, vp, (caddr_t) p->p_addr, ctob(UPAGES),
(off_t)0, UIO_SYSSPACE, IO_NODELOCKED|IO_UNIT, cred, (int *)NULL,
p));
}
/*
* Set a red zone in the kernel stack after the u. area.
*/