Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/i386/i386 No point in having separate xxx_syscall_f...
details: https://anonhg.NetBSD.org/src/rev/bf4c9c583c0e
branches: trunk
changeset: 780134:bf4c9c583c0e
user: dsl <dsl%NetBSD.org@localhost>
date: Thu Jul 12 17:26:42 2012 +0000
description:
No point in having separate xxx_syscall_fancy() and xxx_syscall_plain().
Remove the 'plain' ones.
diffstat:
sys/arch/i386/i386/freebsd_syscall.c | 94 +----------------------------------
sys/arch/i386/i386/ibcs2_syscall.c | 92 +---------------------------------
sys/arch/i386/i386/svr4_syscall.c | 90 +--------------------------------
3 files changed, 15 insertions(+), 261 deletions(-)
diffs (truncated from 377 to 300 lines):
diff -r 52832f8d9f16 -r bf4c9c583c0e sys/arch/i386/i386/freebsd_syscall.c
--- a/sys/arch/i386/i386/freebsd_syscall.c Thu Jul 12 17:24:47 2012 +0000
+++ b/sys/arch/i386/i386/freebsd_syscall.c Thu Jul 12 17:26:42 2012 +0000
@@ -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 @@
#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 @@
* 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;
diff -r 52832f8d9f16 -r bf4c9c583c0e sys/arch/i386/i386/ibcs2_syscall.c
--- a/sys/arch/i386/i386/ibcs2_syscall.c Thu Jul 12 17:24:47 2012 +0000
+++ b/sys/arch/i386/i386/ibcs2_syscall.c Thu Jul 12 17:26:42 2012 +0000
@@ -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 @@
#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 @@
* 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;
diff -r 52832f8d9f16 -r bf4c9c583c0e sys/arch/i386/i386/svr4_syscall.c
--- a/sys/arch/i386/i386/svr4_syscall.c Thu Jul 12 17:24:47 2012 +0000
+++ b/sys/arch/i386/i386/svr4_syscall.c Thu Jul 12 17:26:42 2012 +0000
@@ -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 @@
#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 @@
* Like trap(), argument is call by reference.
*/
void
-svr4_syscall_plain(struct trapframe *frame)
-{
- char *params;
- const struct sysent *callp;
Home |
Main Index |
Thread Index |
Old Index