M68K: Fix fetching syscall arguments
* syscall.c (syscall_enter) [M68K]: Properly handle more than five syscall arguments.
This commit is contained in:
parent
5874322739
commit
246888d239
12
syscall.c
12
syscall.c
@ -2249,6 +2249,18 @@ syscall_enter(struct tcb *tcp)
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
#elif defined (M68K)
|
||||
{
|
||||
int i;
|
||||
if (tcp->scno >= 0 && tcp->scno < nsyscalls && sysent[tcp->scno].nargs != -1)
|
||||
tcp->u_nargs = sysent[tcp->scno].nargs;
|
||||
else
|
||||
tcp->u_nargs = MAX_ARGS;
|
||||
for (i = 0; i < tcp->u_nargs; i++) {
|
||||
if (upeek(tcp, (i < 5 ? i : i + 2)*4, &tcp->u_arg[i]) < 0)
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
#else /* Other architecture (like i386) (32bits specific) */
|
||||
{
|
||||
int i;
|
||||
|
Loading…
x
Reference in New Issue
Block a user