BSD 4_4_Lite1 release
[unix-history] / usr / src / sys / sparc / sparc / trap.c
index 9d2d7cc..855516b 100644 (file)
  *     This product includes software developed by the University of
  *     California, Lawrence Berkeley Laboratory.
  *
  *     This product includes software developed by the University of
  *     California, Lawrence Berkeley Laboratory.
  *
- * %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.
  *
  *
- *     @(#)trap.c      8.2 (Berkeley) %G%
+ *     @(#)trap.c      8.4 (Berkeley) 9/23/93
  *
  * from: $Header: trap.c,v 1.34 93/05/28 04:34:50 torek Exp $
  */
  *
  * from: $Header: trap.c,v 1.34 93/05/28 04:34:50 torek Exp $
  */
@@ -135,40 +161,40 @@ userret(struct proc *p, int pc, u_quad_t oticks)
 
        /* take pending signals */
        while ((sig = CURSIG(p)) != 0)
 
        /* 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_ast) {
                want_ast = 0;
        if (want_ast) {
                want_ast = 0;
-               if (p->p_flag & SOWEUPC) {
-                       p->p_flag &= ~SOWEUPC;
+               if (p->p_flag & P_OWEUPC) {
+                       p->p_flag &= ~P_OWEUPC;
                        ADDUPROF(p);
                }
        }
        if (want_resched) {
                /*
                        ADDUPROF(p);
                }
        }
        if (want_resched) {
                /*
-                * Since we are curproc, a clock interrupt could
-                * change our priority without changing run queues
-                * (the running process is not kept on a run queue).
-                * If this happened after we setrq ourselves but
-                * before we swtch()'ed, we might not be on the queue
+                * 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 put ourselves on the run queue
+                * but before we switched, we might not be on the queue
                 * indicated by our priority.
                 */
                (void) splstatclock();
                 * indicated by our priority.
                 */
                (void) splstatclock();
-               setrq(p);
+               setrunqueue(p);
                p->p_stats->p_ru.ru_nivcsw++;
                p->p_stats->p_ru.ru_nivcsw++;
-               swtch();
+               mi_switch();
                (void) spl0();
                while ((sig = CURSIG(p)) != 0)
                (void) spl0();
                while ((sig = CURSIG(p)) != 0)
-                       psig(sig);
+                       postsig(sig);
        }
 
        /*
         * If profiling, charge recent system time to the trapped pc.
         */
        }
 
        /*
         * If profiling, charge recent system time to the trapped pc.
         */
-       if (p->p_flag & SPROFIL)
+       if (p->p_flag & P_PROFIL)
                addupc_task(p, pc, (int)(p->p_sticks - oticks));
 
                addupc_task(p, pc, (int)(p->p_sticks - oticks));
 
-       curpriority = p->p_pri;
+       curpriority = p->p_priority;
 }
 
 /*
 }
 
 /*