From 83ca04e61c5d7d05f2d17fe5bbec5822ac6d10d9 Mon Sep 17 00:00:00 2001 From: kib Date: Mon, 24 May 2010 17:24:14 +0000 Subject: Change ia64' struct syscall_args definition so that args is a pointer to the arguments array instead of array itself. ia64 syscall arguments are readily available in the frame, point args to it, do not do unnecessary bcopy. Still reserve the array in syscall_args for ia32 emulation. Suggested and reviewed by: marcel MFC after: 1 month --- sys/ia64/ia32/ia32_trap.c | 3 ++- sys/ia64/ia64/trap.c | 8 +++----- sys/ia64/include/proc.h | 3 ++- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'sys/ia64') diff --git a/sys/ia64/ia32/ia32_trap.c b/sys/ia64/ia32/ia32_trap.c index 9c7f08d..57f4791 100644 --- a/sys/ia64/ia32/ia32_trap.c +++ b/sys/ia64/ia32/ia32_trap.c @@ -132,10 +132,11 @@ ia32_fetch_syscall_args(struct thread *td, struct syscall_args *sa) error = copyin(params, (caddr_t)args, sa->narg * sizeof(int)); else error = 0; + sa->args = &sa->args32[0]; if (error == 0) { for (i = 0; i < sa->narg; i++) - sa->args[i] = args[i]; + sa->args32[i] = args[i]; td->td_retval[0] = 0; td->td_retval[1] = tf->tf_scratch.gr10; /* edx */ } diff --git a/sys/ia64/ia64/trap.c b/sys/ia64/ia64/trap.c index 6ce56b7..f6db8c9 100644 --- a/sys/ia64/ia64/trap.c +++ b/sys/ia64/ia64/trap.c @@ -902,13 +902,12 @@ cpu_fetch_syscall_args(struct thread *td, struct syscall_args *sa) { struct proc *p; struct trapframe *tf; - register_t *args; p = td->td_proc; tf = td->td_frame; sa->code = tf->tf_scratch.gr15; - args = &tf->tf_scratch.gr16; + sa->args = &tf->tf_scratch.gr16; /* * syscall() and __syscall() are handled the same on @@ -918,8 +917,8 @@ cpu_fetch_syscall_args(struct thread *td, struct syscall_args *sa) /* * Code is first argument, followed by actual args. */ - sa->code = args[0]; - args++; + sa->code = sa->args[0]; + sa->args++; } if (p->p_sysent->sv_mask) @@ -929,7 +928,6 @@ cpu_fetch_syscall_args(struct thread *td, struct syscall_args *sa) else sa->callp = &p->p_sysent->sv_table[sa->code]; sa->narg = sa->callp->sy_narg; - bcopy(args, sa->args, sa->narg * sizeof(sa->args[0])); td->td_retval[0] = 0; td->td_retval[1] = 0; diff --git a/sys/ia64/include/proc.h b/sys/ia64/include/proc.h index 574be36..8818b9d 100644 --- a/sys/ia64/include/proc.h +++ b/sys/ia64/include/proc.h @@ -45,7 +45,8 @@ struct mdproc { struct syscall_args { u_int code; struct sysent *callp; - register_t args[8]; + register_t *args; + register_t args32[8]; int narg; }; #define HAVE_SYSCALL_ARGS_DEF 1 -- cgit v1.1