summaryrefslogtreecommitdiff
path: root/sys/mips
diff options
context:
space:
mode:
authorEdward Tomasz Napierala <trasz@FreeBSD.org>2020-09-27 18:47:06 +0000
committerEdward Tomasz Napierala <trasz@FreeBSD.org>2020-09-27 18:47:06 +0000
commit1e2521ffaef4fd0950686f1302283a92ccf9c978 (patch)
treed671479e6d799f2c03bc05d4197fd02648d39f0a /sys/mips
parentc4390e6da671117657ffeaa1b6b5e9ad2d4c0e17 (diff)
downloadsrc-test2-1e2521ffaef4fd0950686f1302283a92ccf9c978.tar.gz
src-test2-1e2521ffaef4fd0950686f1302283a92ccf9c978.zip
Notes
Diffstat (limited to 'sys/mips')
-rw-r--r--sys/mips/include/proc.h1
-rw-r--r--sys/mips/mips/trap.c10
2 files changed, 4 insertions, 7 deletions
diff --git a/sys/mips/include/proc.h b/sys/mips/include/proc.h
index 696854f40992..d0acf5e46c76 100644
--- a/sys/mips/include/proc.h
+++ b/sys/mips/include/proc.h
@@ -85,7 +85,6 @@ struct syscall_args {
u_int code;
struct sysent *callp;
register_t args[8];
- int narg;
struct trapframe *trapframe;
};
diff --git a/sys/mips/mips/trap.c b/sys/mips/mips/trap.c
index fcd0214e0d3e..0fdd8f77c502 100644
--- a/sys/mips/mips/trap.c
+++ b/sys/mips/mips/trap.c
@@ -448,9 +448,7 @@ cpu_fetch_syscall_args(struct thread *td)
else
sa->callp = &se->sv_table[sa->code];
- sa->narg = sa->callp->sy_narg;
-
- if (sa->narg > nsaved) {
+ if (sa->callp->sy_narg > nsaved) {
#if defined(__mips_n32) || defined(__mips_n64)
/*
* XXX
@@ -462,7 +460,7 @@ cpu_fetch_syscall_args(struct thread *td)
if (!SV_PROC_FLAG(td->td_proc, SV_ILP32))
#endif
printf("SYSCALL #%u pid:%u, narg (%u) > nsaved (%u).\n",
- sa->code, td->td_proc->p_pid, sa->narg, nsaved);
+ sa->code, td->td_proc->p_pid, sa->callp->sy_narg, nsaved);
#endif
#if (defined(__mips_n32) || defined(__mips_n64)) && defined(COMPAT_FREEBSD32)
if (SV_PROC_FLAG(td->td_proc, SV_ILP32)) {
@@ -470,7 +468,7 @@ cpu_fetch_syscall_args(struct thread *td)
int32_t arg;
error = 0; /* XXX GCC is awful. */
- for (i = nsaved; i < sa->narg; i++) {
+ for (i = nsaved; i < sa->callp->sy_narg; i++) {
error = copyin((caddr_t)(intptr_t)(locr0->sp +
(4 + (i - nsaved)) * sizeof(int32_t)),
(caddr_t)&arg, sizeof arg);
@@ -482,7 +480,7 @@ cpu_fetch_syscall_args(struct thread *td)
#endif
error = copyin((caddr_t)(intptr_t)(locr0->sp +
4 * sizeof(register_t)), (caddr_t)&sa->args[nsaved],
- (u_int)(sa->narg - nsaved) * sizeof(register_t));
+ (u_int)(sa->callp->sy_narg - nsaved) * sizeof(register_t));
if (error != 0) {
locr0->v0 = error;
locr0->a3 = 1;