Minor code rearrangement.

This commit is contained in:
mycroft 2000-12-12 20:22:49 +00:00
parent f56e1f272f
commit 2c7eaf2b50
5 changed files with 38 additions and 22 deletions

View File

@ -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 @@ ibcs2_syscall_plain(frame)
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 @@ ibcs2_syscall_plain(frame)
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 @@ ibcs2_syscall_fancy(frame)
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 @@ ibcs2_syscall_fancy(frame)
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 @@ ibcs2_syscall_fancy(frame)
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);

View File

@ -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 @@ linux_syscall_plain(frame)
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 @@ linux_syscall_fancy(frame)
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) {
/*

View File

@ -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 @@ IDTVEC(syscall)
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. */

View File

@ -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 @@ svr4_syscall_plain(frame)
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 @@ svr4_syscall_plain(frame)
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 @@ svr4_syscall_fancy(frame)
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 @@ svr4_syscall_fancy(frame)
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 @@ svr4_syscall_fancy(frame)
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);

View File

@ -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 @@ syscall_plain(frame)
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 @@ syscall_plain(frame)
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 @@ syscall_fancy(frame)
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 @@ syscall_fancy(frame)
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 @@ syscall_fancy(frame)
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);