svn commit: r208514 - in head/sys/ia64: ia32 ia64 include

Konstantin Belousov kib at FreeBSD.org
Mon May 24 17:24:14 UTC 2010


Author: kib
Date: Mon May 24 17:24:14 2010
New Revision: 208514
URL: http://svn.freebsd.org/changeset/base/208514

Log:
  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

Modified:
  head/sys/ia64/ia32/ia32_trap.c
  head/sys/ia64/ia64/trap.c
  head/sys/ia64/include/proc.h

Modified: head/sys/ia64/ia32/ia32_trap.c
==============================================================================
--- head/sys/ia64/ia32/ia32_trap.c	Mon May 24 17:23:14 2010	(r208513)
+++ head/sys/ia64/ia32/ia32_trap.c	Mon May 24 17:24:14 2010	(r208514)
@@ -132,10 +132,11 @@ ia32_fetch_syscall_args(struct thread *t
 		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 */
 	}

Modified: head/sys/ia64/ia64/trap.c
==============================================================================
--- head/sys/ia64/ia64/trap.c	Mon May 24 17:23:14 2010	(r208513)
+++ head/sys/ia64/ia64/trap.c	Mon May 24 17:24:14 2010	(r208514)
@@ -902,13 +902,12 @@ cpu_fetch_syscall_args(struct thread *td
 {
 	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
 		/*
 		 * 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
  	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;

Modified: head/sys/ia64/include/proc.h
==============================================================================
--- head/sys/ia64/include/proc.h	Mon May 24 17:23:14 2010	(r208513)
+++ head/sys/ia64/include/proc.h	Mon May 24 17:24:14 2010	(r208514)
@@ -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


More information about the svn-src-head mailing list