Module Name:    src
Committed By:   dsl
Date:           Thu Jul 12 17:26:42 UTC 2012

Modified Files:
        src/sys/arch/i386/i386: freebsd_syscall.c ibcs2_syscall.c
            svr4_syscall.c

Log Message:
No point in having separate xxx_syscall_fancy() and xxx_syscall_plain().
Remove the 'plain' ones.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/i386/i386/freebsd_syscall.c
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/i386/i386/ibcs2_syscall.c
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/i386/i386/svr4_syscall.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/i386/i386/freebsd_syscall.c
diff -u src/sys/arch/i386/i386/freebsd_syscall.c:1.37 src/sys/arch/i386/i386/freebsd_syscall.c:1.38
--- src/sys/arch/i386/i386/freebsd_syscall.c:1.37	Sat Nov 21 03:11:00 2009
+++ src/sys/arch/i386/i386/freebsd_syscall.c	Thu Jul 12 17:26:42 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: freebsd_syscall.c,v 1.37 2009/11/21 03:11:00 rmind Exp $	*/
+/*	$NetBSD: freebsd_syscall.c,v 1.38 2012/07/12 17:26:42 dsl Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: freebsd_syscall.c,v 1.37 2009/11/21 03:11:00 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: freebsd_syscall.c,v 1.38 2012/07/12 17:26:42 dsl Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -50,17 +50,13 @@ __KERNEL_RCSID(0, "$NetBSD: freebsd_sysc
 #include <machine/freebsd_machdep.h>
 #include <compat/freebsd/freebsd_syscall.h>
 
-void freebsd_syscall_plain(struct trapframe *);
-void freebsd_syscall_fancy(struct trapframe *);
+void freebsd_syscall(struct trapframe *);
 
 void
 freebsd_syscall_intern(struct proc *p)
 {
 
-	if (trace_is_enabled(p))
-		p->p_md.md_syscall = freebsd_syscall_fancy;
-	else
-		p->p_md.md_syscall = freebsd_syscall_plain;
+	p->p_md.md_syscall = freebsd_syscall;
 }
 
 /*
@@ -69,87 +65,7 @@ freebsd_syscall_intern(struct proc *p)
  * Like trap(), argument is call by reference.
  */
 void
-freebsd_syscall_plain(struct trapframe *frame)
-{
-	char *params;
-	const struct sysent *callp;
-	struct lwp *l;
-	struct proc *p;
-	int error;
-	size_t argsize;
-	register_t code, args[8], rval[2];
-
-	l = curlwp;
-	p = l->l_proc;
-	LWP_CACHE_CREDS(l, p);
-
-	code = frame->tf_eax;
-	callp = p->p_emul->e_sysent;
-	params = (char *)frame->tf_esp + sizeof(int);
-
-	switch (code) {
-	case SYS_syscall:
-		/*
-		 * Code is first argument, followed by actual args.
-		 */
-		code = fuword(params);
-		params += sizeof(int);
-		break;
-	case SYS___syscall:
-		/*
-		 * Like syscall, but code is a quad, so as to maintain
-		 * quad alignment for the rest of the arguments.
-		 */
-		code = fuword(params + _QUAD_LOWWORD * sizeof(int));
-		params += sizeof(quad_t);
-		break;
-	default:
-		break;
-	}
-
-	code &= (FREEBSD_SYS_NSYSENT - 1);
-	callp += code;
-	argsize = callp->sy_argsize;
-	if (argsize) {
-		error = copyin(params, (void *)args, argsize);
-		if (error)
-			goto bad;
-	}
-
-	rval[0] = 0;
-	rval[1] = frame->tf_edx; /* need to keep edx for shared FreeBSD bins */
-
-	error = sy_call(callp, l, args, rval);
-
-	switch (error) {
-	case 0:
-		frame->tf_eax = rval[0];
-		frame->tf_edx = rval[1];
-		frame->tf_eflags &= ~PSL_C;	/* carry bit */
-		break;
-	case ERESTART:
-		/*
-		 * The offset to adjust the PC by depends on whether we entered
-		 * the kernel through the trap or call gate.  We pushed the
-		 * size of the instruction into tf_err on entry.
-		 */
-		frame->tf_eip -= frame->tf_err;
-		break;
-	case EJUSTRETURN:
-		/* nothing to do */
-		break;
-	default:
-	bad:
-		frame->tf_eax = error;
-		frame->tf_eflags |= PSL_C;	/* carry bit */
-		break;
-	}
-
-	userret(l);
-}
-
-void
-freebsd_syscall_fancy(struct trapframe *frame)
+freebsd_syscall(struct trapframe *frame)
 {
 	char *params;
 	const struct sysent *callp;

Index: src/sys/arch/i386/i386/ibcs2_syscall.c
diff -u src/sys/arch/i386/i386/ibcs2_syscall.c:1.46 src/sys/arch/i386/i386/ibcs2_syscall.c:1.47
--- src/sys/arch/i386/i386/ibcs2_syscall.c:1.46	Sat Nov 21 03:11:00 2009
+++ src/sys/arch/i386/i386/ibcs2_syscall.c	Thu Jul 12 17:26:42 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ibcs2_syscall.c,v 1.46 2009/11/21 03:11:00 rmind Exp $	*/
+/*	$NetBSD: ibcs2_syscall.c,v 1.47 2012/07/12 17:26:42 dsl Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ibcs2_syscall.c,v 1.46 2009/11/21 03:11:00 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ibcs2_syscall.c,v 1.47 2012/07/12 17:26:42 dsl Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_vm86.h"
@@ -54,18 +54,14 @@ __KERNEL_RCSID(0, "$NetBSD: ibcs2_syscal
 #include <compat/ibcs2/ibcs2_syscall.h>
 #include <machine/ibcs2_machdep.h>
 
-void ibcs2_syscall_plain(struct trapframe *);
-void ibcs2_syscall_fancy(struct trapframe *);
+void ibcs2_syscall(struct trapframe *);
 extern struct sysent ibcs2_sysent[];
 
 void
 ibcs2_syscall_intern(struct proc *p)
 {
 
-	if (trace_is_enabled(p))
-		p->p_md.md_syscall = ibcs2_syscall_fancy;
-	else
-		p->p_md.md_syscall = ibcs2_syscall_plain;
+	p->p_md.md_syscall = ibcs2_syscall;
 }
 
 /*
@@ -74,85 +70,7 @@ ibcs2_syscall_intern(struct proc *p)
  * Like trap(), argument is call by reference.
  */
 void
-ibcs2_syscall_plain(struct trapframe *frame)
-{
-	char *params;
-	const struct sysent *callp;
-	struct lwp *l;
-	int error;
-	size_t argsize;
-	register_t code, args[8], rval[2];
-
-	l = curlwp;
-	LWP_CACHE_CREDS(l, l->l_proc);
-
-	code = frame->tf_eax;
-	if (IBCS2_HIGH_SYSCALL(code))
-		code = IBCS2_CVT_HIGH_SYSCALL(code);
-	callp = ibcs2_sysent;
-	params = (char *)frame->tf_esp + sizeof(int);
-
-	switch (code) {
-	case SYS_syscall:
-		/*
-		 * Code is first argument, followed by actual args.
-		 */
-		code = fuword(params);
-		params += sizeof(int);
-		break;
-	default:
-		break;
-	}
-
-	code &= (IBCS2_SYS_NSYSENT - 1);
-	callp += code;
-	argsize = callp->sy_argsize;
-	if (argsize) {
-		error = copyin(params, (void *)args, argsize);
-		if (error)
-			goto bad;
-	}
-
-	rval[0] = 0;
-	rval[1] = 0;
-
-	error = sy_call(callp, l, args, rval);
-
-	switch (error) {
-	case 0:
-		frame->tf_eax = rval[0];
-		frame->tf_edx = rval[1];
-		frame->tf_eflags &= ~PSL_C;	/* carry bit */
-		break;
-	case ERESTART:
-		/*
-		 * The offset to adjust the PC by depends on whether we entered
-		 * the kernel through the trap or call gate.  We pushed the
-		 * size of the instruction into tf_err on entry.
-		 */
-		frame->tf_eip -= frame->tf_err;
-		break;
-	case EJUSTRETURN:
-		/* nothing to do */
-		break;
-	default:
-	bad:
-		error = native_to_ibcs2_errno[error];
-		frame->tf_eax = error;
-		frame->tf_eflags |= PSL_C;	/* carry bit */
-		break;
-	}
-
-	userret(l);
-}
-
-/*
- * syscall(frame):
- *	System call request from POSIX system call gate interface to kernel.
- * Like trap(), argument is call by reference.
- */
-void
-ibcs2_syscall_fancy(struct trapframe *frame)
+ibcs2_syscall(struct trapframe *frame)
 {
 	char * params;
 	const struct sysent *callp;

Index: src/sys/arch/i386/i386/svr4_syscall.c
diff -u src/sys/arch/i386/i386/svr4_syscall.c:1.45 src/sys/arch/i386/i386/svr4_syscall.c:1.46
--- src/sys/arch/i386/i386/svr4_syscall.c:1.45	Sat Nov 21 03:11:00 2009
+++ src/sys/arch/i386/i386/svr4_syscall.c	Thu Jul 12 17:26:42 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: svr4_syscall.c,v 1.45 2009/11/21 03:11:00 rmind Exp $	*/
+/*	$NetBSD: svr4_syscall.c,v 1.46 2012/07/12 17:26:42 dsl Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: svr4_syscall.c,v 1.45 2009/11/21 03:11:00 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: svr4_syscall.c,v 1.46 2012/07/12 17:26:42 dsl Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_vm86.h"
@@ -53,18 +53,14 @@ __KERNEL_RCSID(0, "$NetBSD: svr4_syscall
 #include <compat/svr4/svr4_syscall.h>
 #include <machine/svr4_machdep.h>
 
-void svr4_syscall_plain(struct trapframe *);
-void svr4_syscall_fancy(struct trapframe *);
+void svr4_syscall(struct trapframe *);
 extern struct sysent svr4_sysent[];
 
 void
 svr4_syscall_intern(struct proc *p)
 {
 
-	if (trace_is_enabled(p))
-		p->p_md.md_syscall = svr4_syscall_fancy;
-	else
-		p->p_md.md_syscall = svr4_syscall_plain;
+	p->p_md.md_syscall = svr4_syscall;
 }
 
 /*
@@ -73,83 +69,7 @@ svr4_syscall_intern(struct proc *p)
  * Like trap(), argument is call by reference.
  */
 void
-svr4_syscall_plain(struct trapframe *frame)
-{
-	char *params;
-	const struct sysent *callp;
-	struct lwp *l;
-	int error;
-	size_t argsize;
-	register_t code, args[8], rval[2];
-
-	l = curlwp;
-	LWP_CACHE_CREDS(l, l->l_proc);
-
-	code = frame->tf_eax;
-	callp = svr4_sysent;
-	params = (char *)frame->tf_esp + sizeof(int);
-
-	switch (code) {
-	case SYS_syscall:
-		/*
-		 * Code is first argument, followed by actual args.
-		 */
-		code = fuword(params);
-		params += sizeof(int);
-		break;
-	default:
-		break;
-	}
-
-	code &= (SVR4_SYS_NSYSENT - 1);
-	callp += code;
-	argsize = callp->sy_argsize;
-	if (argsize) {
-		error = copyin(params, (void *)args, argsize);
-		if (error)
-			goto bad;
-	}
-
-	rval[0] = 0;
-	rval[1] = 0;
-
-	error = sy_call(callp, l, args, rval);
-
-	switch (error) {
-	case 0:
-		frame->tf_eax = rval[0];
-		frame->tf_edx = rval[1];
-		frame->tf_eflags &= ~PSL_C;	/* carry bit */
-		break;
-	case ERESTART:
-		/*
-		 * The offset to adjust the PC by depends on whether we entered
-		 * the kernel through the trap or call gate.  We pushed the
-		 * size of the instruction into tf_err on entry.
-		 */
-		frame->tf_eip -= frame->tf_err;
-		break;
-	case EJUSTRETURN:
-		/* nothing to do */
-		break;
-	default:
-	bad:
-		error = native_to_svr4_errno[error];
-		frame->tf_eax = error;
-		frame->tf_eflags |= PSL_C;	/* carry bit */
-		break;
-	}
-
-	userret(l);
-}
-
-/*
- * syscall(frame):
- *	System call request from POSIX system call gate interface to kernel.
- * Like trap(), argument is call by reference.
- */
-void
-svr4_syscall_fancy(struct trapframe *frame)
+svr4_syscall(struct trapframe *frame)
 {
 	char *params;
 	const struct sysent *callp;

Reply via email to