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 Minor code rearrangement.
details: https://anonhg.NetBSD.org/src/rev/2505a2beef57
branches: trunk
changeset: 500492:2505a2beef57
user: mycroft <mycroft%NetBSD.org@localhost>
date: Tue Dec 12 20:22:49 2000 +0000
description:
Minor code rearrangement.
diffstat:
sys/arch/i386/i386/ibcs2_syscall.c | 12 +++++++++---
sys/arch/i386/i386/linux_syscall.c | 10 +++++-----
sys/arch/i386/i386/locore.s | 8 ++++----
sys/arch/i386/i386/svr4_syscall.c | 16 +++++++++++-----
sys/arch/i386/i386/syscall.c | 14 +++++++++-----
5 files changed, 38 insertions(+), 22 deletions(-)
diffs (287 lines):
diff -r d3573690d00a -r 2505a2beef57 sys/arch/i386/i386/ibcs2_syscall.c
--- a/sys/arch/i386/i386/ibcs2_syscall.c Tue Dec 12 20:22:45 2000 +0000
+++ b/sys/arch/i386/i386/ibcs2_syscall.c Tue Dec 12 20:22:49 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ibcs2_syscall.c,v 1.11 2000/12/12 03:33:16 mycroft Exp $ */
+/* $NetBSD: ibcs2_syscall.c,v 1.12 2000/12/12 20:22:49 mycroft Exp $ */
/*-
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -107,6 +107,7 @@
code = frame.tf_eax;
if (IBCS2_HIGH_SYSCALL(code))
code = IBCS2_CVT_HIGH_SYSCALL(code);
+ code &= (IBCS2_SYS_NSYSENT - 1);
callp = ibcs2_sysent;
params = (caddr_t)frame.tf_esp + sizeof(int);
@@ -122,16 +123,18 @@
break;
}
- callp += (code & (IBCS2_SYS_NSYSENT - 1));
+ callp += code;
argsize = callp->sy_argsize;
if (argsize) {
error = copyin(params, (caddr_t)args, argsize);
if (error)
goto bad;
}
+
#ifdef SYSCALL_DEBUG
scdebug_call(p, code, args);
#endif /* SYSCALL_DEBUG */
+
rval[0] = 0;
rval[1] = 0;
error = (*callp->sy_call)(p, args, rval);
@@ -188,6 +191,7 @@
code = frame.tf_eax;
if (IBCS2_HIGH_SYSCALL(code))
code = IBCS2_CVT_HIGH_SYSCALL(code);
+ code &= (IBCS2_SYS_NSYSENT - 1);
callp = ibcs2_sysent;
params = (caddr_t)frame.tf_esp + sizeof(int);
@@ -203,13 +207,14 @@
break;
}
- callp += (code & (IBCS2_SYS_NSYSENT - 1));
+ callp += code;
argsize = callp->sy_argsize;
if (argsize) {
error = copyin(params, (caddr_t)args, argsize);
if (error)
goto bad;
}
+
#ifdef SYSCALL_DEBUG
scdebug_call(p, code, args);
#endif /* SYSCALL_DEBUG */
@@ -217,6 +222,7 @@
if (KTRPOINT(p, KTR_SYSCALL))
ktrsyscall(p, code, argsize, args);
#endif /* KTRACE */
+
rval[0] = 0;
rval[1] = 0;
error = (*callp->sy_call)(p, args, rval);
diff -r d3573690d00a -r 2505a2beef57 sys/arch/i386/i386/linux_syscall.c
--- a/sys/arch/i386/i386/linux_syscall.c Tue Dec 12 20:22:45 2000 +0000
+++ b/sys/arch/i386/i386/linux_syscall.c Tue Dec 12 20:22:49 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_syscall.c,v 1.11 2000/12/12 03:33:16 mycroft Exp $ */
+/* $NetBSD: linux_syscall.c,v 1.12 2000/12/12 20:22:49 mycroft Exp $ */
/*-
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -103,10 +103,10 @@
uvmexp.syscalls++;
p = curproc;
- code = frame.tf_eax;
+ code = frame.tf_eax & (LINUX_SYS_NSYSENT - 1);
callp = linux_sysent;
- callp += (code & (LINUX_SYS_NSYSENT - 1));
+ callp += code;
argsize = callp->sy_argsize;
if (argsize) {
/*
@@ -184,10 +184,10 @@
uvmexp.syscalls++;
p = curproc;
- code = frame.tf_eax;
+ code = frame.tf_eax & (LINUX_SYS_NSYSENT - 1);
callp = linux_sysent;
- callp += (code & (LINUX_SYS_NSYSENT - 1));
+ callp += code;
argsize = callp->sy_argsize;
if (argsize) {
/*
diff -r d3573690d00a -r 2505a2beef57 sys/arch/i386/i386/locore.s
--- a/sys/arch/i386/i386/locore.s Tue Dec 12 20:22:45 2000 +0000
+++ b/sys/arch/i386/i386/locore.s Tue Dec 12 20:22:49 2000 +0000
@@ -1,7 +1,7 @@
-/* $NetBSD: locore.s,v 1.231 2000/12/11 05:28:59 mycroft Exp $ */
+/* $NetBSD: locore.s,v 1.232 2000/12/12 20:22:49 mycroft Exp $ */
/*-
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
+ * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
@@ -151,12 +151,12 @@
pushl %ecx ; \
pushl %edx ; \
pushl %ebx ; \
+ movl $GSEL(GDATA_SEL, SEL_KPL),%eax ; \
pushl %ebp ; \
pushl %esi ; \
pushl %edi ; \
pushl %ds ; \
pushl %es ; \
- movl $GSEL(GDATA_SEL, SEL_KPL),%eax ; \
movl %ax,%ds ; \
movl %ax,%es
#define INTRFASTEXIT \
@@ -2357,10 +2357,10 @@
syscall1:
pushl $T_ASTFLT # trap # for doing ASTs
INTRENTRY
+ movl _C_LABEL(curproc),%edx # get pointer to curproc
#ifdef DIAGNOSTIC
movl _C_LABEL(cpl),%ebx
#endif /* DIAGNOSTIC */
- movl _C_LABEL(curproc),%edx # get pointer to curproc
movl %esp,P_MD_REGS(%edx) # save pointer to frame
call P_MD_SYSCALL(%edx) # get pointer to syscall() function
2: /* Check for ASTs on exit to user mode. */
diff -r d3573690d00a -r 2505a2beef57 sys/arch/i386/i386/svr4_syscall.c
--- a/sys/arch/i386/i386/svr4_syscall.c Tue Dec 12 20:22:45 2000 +0000
+++ b/sys/arch/i386/i386/svr4_syscall.c Tue Dec 12 20:22:49 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: svr4_syscall.c,v 1.10 2000/12/12 03:33:16 mycroft Exp $ */
+/* $NetBSD: svr4_syscall.c,v 1.11 2000/12/12 20:22:50 mycroft Exp $ */
/*-
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -103,7 +103,7 @@
uvmexp.syscalls++;
p = curproc;
- code = frame.tf_eax;
+ code = frame.tf_eax & (SVR4_SYS_NSYSENT - 1);
callp = svr4_sysent;
params = (caddr_t)frame.tf_esp + sizeof(int);
@@ -118,16 +118,19 @@
default:
break;
}
- callp += (code & (SVR4_SYS_NSYSENT - 1));
+
+ callp += code;
argsize = callp->sy_argsize;
if (argsize) {
error = copyin(params, (caddr_t)args, argsize);
if (error)
goto bad;
}
+
#ifdef SYSCALL_DEBUG
scdebug_call(p, code, args);
#endif /* SYSCALL_DEBUG */
+
rval[0] = 0;
rval[1] = 0;
error = (*callp->sy_call)(p, args, rval);
@@ -181,7 +184,7 @@
uvmexp.syscalls++;
p = curproc;
- code = frame.tf_eax;
+ code = frame.tf_eax & (SVR4_SYS_NSYSENT - 1);
callp = svr4_sysent;
params = (caddr_t)frame.tf_esp + sizeof(int);
@@ -196,13 +199,15 @@
default:
break;
}
- callp += (code & (SVR4_SYS_NSYSENT - 1));
+
+ callp += code;
argsize = callp->sy_argsize;
if (argsize) {
error = copyin(params, (caddr_t)args, argsize);
if (error)
goto bad;
}
+
#ifdef SYSCALL_DEBUG
scdebug_call(p, code, args);
#endif /* SYSCALL_DEBUG */
@@ -210,6 +215,7 @@
if (KTRPOINT(p, KTR_SYSCALL))
ktrsyscall(p, code, argsize, args);
#endif /* KTRACE */
+
rval[0] = 0;
rval[1] = 0;
error = (*callp->sy_call)(p, args, rval);
diff -r d3573690d00a -r 2505a2beef57 sys/arch/i386/i386/syscall.c
--- a/sys/arch/i386/i386/syscall.c Tue Dec 12 20:22:45 2000 +0000
+++ b/sys/arch/i386/i386/syscall.c Tue Dec 12 20:22:49 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: syscall.c,v 1.5 2000/12/12 03:33:16 mycroft Exp $ */
+/* $NetBSD: syscall.c,v 1.6 2000/12/12 20:22:50 mycroft Exp $ */
/*-
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -100,7 +100,7 @@
uvmexp.syscalls++;
p = curproc;
- code = frame.tf_eax;
+ code = frame.tf_eax & (SYS_NSYSENT - 1);
callp = p->p_emul->e_sysent;
params = (caddr_t)frame.tf_esp + sizeof(int);
@@ -124,16 +124,18 @@
break;
}
- callp += (code & (SYS_NSYSENT - 1));
+ callp += code;
argsize = callp->sy_argsize;
if (argsize) {
error = copyin(params, (caddr_t)args, argsize);
if (error)
goto bad;
}
+
#ifdef SYSCALL_DEBUG
scdebug_call(p, code, args);
#endif /* SYSCALL_DEBUG */
+
rval[0] = 0;
rval[1] = 0;
error = (*callp->sy_call)(p, args, rval);
@@ -181,7 +183,7 @@
uvmexp.syscalls++;
p = curproc;
- code = frame.tf_eax;
+ code = frame.tf_eax & (SYS_NSYSENT - 1);
callp = p->p_emul->e_sysent;
params = (caddr_t)frame.tf_esp + sizeof(int);
@@ -205,13 +207,14 @@
break;
}
- callp += (code & (SYS_NSYSENT - 1));
+ callp += code;
argsize = callp->sy_argsize;
if (argsize) {
error = copyin(params, (caddr_t)args, argsize);
if (error)
goto bad;
}
+
#ifdef SYSCALL_DEBUG
scdebug_call(p, code, args);
#endif /* SYSCALL_DEBUG */
@@ -219,6 +222,7 @@
if (KTRPOINT(p, KTR_SYSCALL))
ktrsyscall(p, code, argsize, args);
#endif /* KTRACE */
+
rval[0] = 0;
rval[1] = 0;
error = (*callp->sy_call)(p, args, rval);
Home |
Main Index |
Thread Index |
Old Index