BSD 4_4_Lite1 release
[unix-history] / usr / src / sys / luna68k / luna68k / trap.c
index a2d6fb3..bc30b5e 100644 (file)
@@ -1,19 +1,45 @@
 /*
  * 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.
+ *
+ * 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: Utah $Hdr: trap.c 1.35 91/12/26$
  *
  * from: Utah $Hdr: trap.c 1.35 91/12/26$
- * from: hp300/hp300/trap.c    7.26 (Berkeley) 12/27/92
+ * from: hp300/hp300/trap.c    8.4 (Berkeley) 9/23/93
  *
  *
- *     @(#)trap.c      7.6 (Berkeley) %G%
+ *     @(#)trap.c      8.5 (Berkeley) 12/6/93
  */
 
 #include <sys/param.h>
  */
 
 #include <sys/param.h>
@@ -118,30 +144,30 @@ again:
 #endif
        /* take pending signals */
        while ((sig = CURSIG(p)) != 0)
 #endif
        /* take pending signals */
        while ((sig = CURSIG(p)) != 0)
-               psig(sig);
-       p->p_pri = p->p_usrpri;
+               postsig(sig);
+       p->p_priority = p->p_usrpri;
        if (want_resched) {
                /*
                 * Since we are curproc, clock will normally just change
                 * our priority without moving us from one queue to another
                 * (since the running process is not on a queue.)
        if (want_resched) {
                /*
                 * Since we are curproc, clock will normally just change
                 * our priority without moving us from one queue to another
                 * (since the running process is not on a queue.)
-                * If that happened after we setrq ourselves but before we
-                * swtch()'ed, we might not be on the queue indicated by
-                * our priority.
+                * If that happened after we put ourselves on the run queue
+                * but before we switched, we might not be on the queue
+                * indicated by our priority.
                 */
                s = splstatclock();
                 */
                s = splstatclock();
-               setrq(p);
+               setrunqueue(p);
                p->p_stats->p_ru.ru_nivcsw++;
                p->p_stats->p_ru.ru_nivcsw++;
-               swtch();
+               mi_switch();
                splx(s);
                while ((sig = CURSIG(p)) != 0)
                splx(s);
                while ((sig = CURSIG(p)) != 0)
-                       psig(sig);
+                       postsig(sig);
        }
 
        /*
         * If profiling, charge system time to the trapped pc.
         */
        }
 
        /*
         * If profiling, charge system time to the trapped pc.
         */
-       if (p->p_flag & SPROFIL) {
+       if (p->p_flag & P_PROFIL) {
                extern int psratio;
 
                addupc_task(p, fp->f_pc,
                extern int psratio;
 
                addupc_task(p, fp->f_pc,
@@ -173,7 +199,7 @@ again:
                }
        }
 #endif
                }
        }
 #endif
-       curpri = p->p_pri;
+       curpriority = p->p_priority;
 }
 
 /*
 }
 
 /*
@@ -372,8 +398,8 @@ copyfault:
                        return;
                }
                spl0();
                        return;
                }
                spl0();
-               if (p->p_flag & SOWEUPC) {
-                       p->p_flag &= ~SOWEUPC;
+               if (p->p_flag & P_OWEUPC) {
+                       p->p_flag &= ~P_OWEUPC;
                        ADDUPROF(p);
                }
                goto out;
                        ADDUPROF(p);
                }
                goto out;