BSD 4_4 release
[unix-history] / usr / src / sys / luna68k / luna68k / vm_machdep.c
index 67b28b8..3301c97 100644 (file)
@@ -1,36 +1,60 @@
 /*
  * Copyright (c) 1988 University of Utah.
  * Copyright (c) 1992 OMRON Corporation.
 /*
  * Copyright (c) 1988 University of Utah.
  * Copyright (c) 1992 OMRON Corporation.
- * Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1982, 1986, 1990, 1993
+ *     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
  * Science Department.
  *
  *
  * This code is derived from software contributed to Berkeley by
  * the Systems Programming Group of the University of Utah Computer
  * Science Department.
  *
- * %sccs.include.redist.c%
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *     This product includes software developed by the University of
+ *     California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
  *
  *
- * from: Utah $Hdr: vm_machdep.c 1.21 91/04/06$
- * OMRON: $Id: vm_machdep.c,v 1.2 92/06/14 06:24:23 moti Exp $
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
  *
  *
- * from: hp300/hp300/vm_machdep.c      7.12 (Berkeley) 6/5/92
+ * from: Utah $Hdr: vm_machdep.c 1.21 91/04/06$
+ * from: hp300/hp300/vm_machdep.c      7.14 (Berkeley) 12/27/92
  *
  *
- *     @(#)vm_machdep.c        7.1 (Berkeley) %G%
+ *     @(#)vm_machdep.c        8.1 (Berkeley) 6/10/93
  */
 
  */
 
-#include "param.h"
-#include "systm.h"
-#include "proc.h"
-#include "malloc.h"
-#include "buf.h"
-#include "vnode.h"
-#include "user.h"
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/proc.h>
+#include <sys/malloc.h>
+#include <sys/buf.h>
+#include <sys/vnode.h>
+#include <sys/user.h>
 
 
-#include "../include/cpu.h"
+#include <machine/cpu.h>
 
 
-#include "vm/vm.h"
-#include "vm/vm_kern.h"
-#include "pte.h"
+#include <vm/vm.h>
+#include <vm/vm_kern.h>
+#include <luna68k/luna68k/pte.h>
 
 /*
  * Finish a fork operation, with process p2 nearly set up.
 
 /*
  * Finish a fork operation, with process p2 nearly set up.
@@ -49,6 +73,9 @@ cpu_fork(p1, p2)
        extern caddr_t getsp();
        extern char kstack[];
 
        extern caddr_t getsp();
        extern char kstack[];
 
+       p2->p_md.md_regs = p1->p_md.md_regs;
+       p2->p_md.md_flags = (p1->p_md.md_flags & ~(MDP_AST|MDP_HPUXTRACE));
+
        /*
         * Copy pcb and stack from proc p1 to p2. 
         * We do this as cheaply as possible, copying only the active
        /*
         * Copy pcb and stack from proc p1 to p2. 
         * We do this as cheaply as possible, copying only the active
@@ -139,6 +166,9 @@ pagemove(from, to, size)
                to += NBPG;
                size -= NBPG;
        }
                to += NBPG;
                size -= NBPG;
        }
+#ifdef LUNA2
+       DCIS();
+#endif
 }
 
 /*
 }
 
 /*