Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/mips Move userret() into a header file, in preparat...



details:   https://anonhg.NetBSD.org/src/rev/53c1ed74ec3d
branches:  trunk
changeset: 502097:53c1ed74ec3d
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Thu Jan 11 18:44:29 2001 +0000

description:
Move userret() into a header file, in preparation for splitting
syscall() into plain and fancy.

diffstat:

 sys/arch/mips/include/userret.h |  60 +++++++++++++++++++++++++++++++++++++++++
 sys/arch/mips/mips/trap.c       |  33 +++++++---------------
 2 files changed, 71 insertions(+), 22 deletions(-)

diffs (179 lines):

diff -r 7cd547359810 -r 53c1ed74ec3d sys/arch/mips/include/userret.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/mips/include/userret.h   Thu Jan 11 18:44:29 2001 +0000
@@ -0,0 +1,60 @@
+/*     $NetBSD: userret.h,v 1.1 2001/01/11 18:44:30 thorpej Exp $      */
+
+/*
+ * Copyright (c) 1988 University of Utah.
+ * Copyright (c) 1992, 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 and Ralph Campbell.
+ *
+ * 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.32 91/04/06
+ *
+ *     @(#)trap.c      8.5 (Berkeley) 1/11/94
+ */
+
+#ifndef _MIPS_USERRET_H_
+#define        _MIPS_USERRET_H_
+
+static __inline void
+userret(struct proc *p)
+{
+       int sig;
+
+       /* take pending signals */
+       while ((sig = CURSIG(p)) != 0)
+               postsig(sig);
+
+       curcpu()->ci_schedstate.spc_curpriority = p->p_priority = p->p_usrpri;
+}
+
+#endif /* _MIPS_USERRET_H_ */
diff -r 7cd547359810 -r 53c1ed74ec3d sys/arch/mips/mips/trap.c
--- a/sys/arch/mips/mips/trap.c Thu Jan 11 18:30:16 2001 +0000
+++ b/sys/arch/mips/mips/trap.c Thu Jan 11 18:44:29 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: trap.c,v 1.153 2001/01/11 18:30:17 thorpej Exp $       */
+/*     $NetBSD: trap.c,v 1.154 2001/01/11 18:44:29 thorpej Exp $       */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -44,7 +44,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.153 2001/01/11 18:30:17 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.154 2001/01/11 18:44:29 thorpej Exp $");
 
 #include "opt_cputype.h"       /* which mips CPU levels do we support? */
 #include "opt_ktrace.h"
@@ -78,6 +78,7 @@
 #include <mips/regnum.h>                       /* symbolic register indices */
 #include <mips/pte.h>
 #include <mips/psl.h>
+#include <mips/userret.h>
 
 #include <net/netisr.h>
 
@@ -136,18 +137,6 @@
 extern void MachEmulateFP __P((unsigned));
 extern void MachFPInterrupt __P((unsigned, unsigned, unsigned, struct frame *));
 
-static __inline void
-userret(struct proc *p, unsigned pc, u_quad_t sticks)
-{
-       int sig;
-
-       /* take pending signals */
-       while ((sig = CURSIG(p)) != 0)
-               postsig(sig);
-
-       curcpu()->ci_schedstate.spc_curpriority = p->p_priority = p->p_usrpri;
-}
-
 #define DELAYBRANCH(x) ((int)(x)<0)
 /*
  * Process a system call.
@@ -259,7 +248,7 @@
 #ifdef SYSCALL_DEBUG
        scdebug_ret(p, code, error, rval);
 #endif
-       userret(p, opc, sticks);
+       userret(p);
 #ifdef KTRACE
        if (KTRPOINT(p, KTR_SYSRET))
                ktrsysret(p, code, error, rval[0]);
@@ -280,7 +269,7 @@
        frame->f_regs[V0] = 0;
        frame->f_regs[V1] = 1;
        frame->f_regs[A3] = 0;
-       userret(p, frame->f_regs[PC] - sizeof(int), 0); /* XXX */
+       userret(p);
 #ifdef KTRACE
        if (KTRPOINT(p, KTR_SYSRET))
                ktrsysret(p, SYS_fork, 0, 0);
@@ -432,7 +421,7 @@
                }
                pmap_set_modified(pa);
                if (type & T_USER)
-                       userret(p, opc, sticks);
+                       userret(p);
                return; /* GEN */
            }
        case T_TLB_LD_MISS:
@@ -503,7 +492,7 @@
                }
                if (rv == KERN_SUCCESS) {
                        if (type & T_USER) {
-                               userret(p, opc, sticks);
+                               userret(p);
                        }
                        return; /* GEN */
                }
@@ -646,13 +635,13 @@
 #else
                MachFPInterrupt(status, cause, opc, p->p_md.md_regs);
 #endif
-               userret(p, opc, sticks);
+               userret(p);
                return; /* GEN */
        case T_FPE+T_USER:
 #if !defined(NOFPU) || defined(SOFTFLOAT)
                MachFPInterrupt(status, cause, opc, p->p_md.md_regs);
 #endif
-               userret(p, opc, sticks);
+               userret(p);
                return; /* GEN */
        case T_OVFLOW+T_USER:
        case T_TRAP+T_USER:
@@ -664,7 +653,7 @@
        trapsignal(p, sig, ucode);
        if ((type & T_USER) == 0)
                panic("trapsignal");
-       userret(p, opc, sticks);
+       userret(p);
        return;
 }
 
@@ -718,7 +707,7 @@
                preempt(NULL);
        }
 
-       userret(p, pc, p->p_sticks);
+       userret(p);
 }
 
 /*



Home | Main Index | Thread Index | Old Index