summaryrefslogtreecommitdiffstats
path: root/sys/ia64
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2010-05-24 17:24:14 +0000
committerkib <kib@FreeBSD.org>2010-05-24 17:24:14 +0000
commit83ca04e61c5d7d05f2d17fe5bbec5822ac6d10d9 (patch)
tree3871b51737ab67ec769f768c2dd5adb8dd61bbe6 /sys/ia64
parentf3e521941db62f14add692cbd5abd7d2e3e3d08b (diff)
downloadFreeBSD-src-83ca04e61c5d7d05f2d17fe5bbec5822ac6d10d9.zip
FreeBSD-src-83ca04e61c5d7d05f2d17fe5bbec5822ac6d10d9.tar.gz
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
Diffstat (limited to 'sys/ia64')
-rw-r--r--sys/ia64/ia32/ia32_trap.c3
-rw-r--r--sys/ia64/ia64/trap.c8
-rw-r--r--sys/ia64/include/proc.h3
3 files changed, 7 insertions, 7 deletions
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
OpenPOWER on IntegriCloud