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
This commit is contained in:
parent
0475ecd50a
commit
3341592139
@ -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 */
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user