Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F109649627
D26629.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D26629.diff
View Options
Index: head/sys/arm64/arm64/trap.c
===================================================================
--- head/sys/arm64/arm64/trap.c
+++ head/sys/arm64/arm64/trap.c
@@ -123,30 +123,31 @@
cpu_fetch_syscall_args(struct thread *td)
{
struct proc *p;
- register_t *ap;
+ register_t *ap, *dst_ap;
struct syscall_args *sa;
- int nap;
- nap = MAXARGS;
p = td->td_proc;
- ap = td->td_frame->tf_x;
sa = &td->td_sa;
+ ap = td->td_frame->tf_x;
+ dst_ap = &sa->args[0];
sa->code = td->td_frame->tf_x[8];
- if (sa->code == SYS_syscall || sa->code == SYS___syscall) {
+ if (__predict_false(sa->code == SYS_syscall || sa->code == SYS___syscall)) {
sa->code = *ap++;
- nap--;
+ } else {
+ *dst_ap++ = *ap++;
}
- if (sa->code >= p->p_sysent->sv_size)
+ if (__predict_false(sa->code >= p->p_sysent->sv_size))
sa->callp = &p->p_sysent->sv_table[0];
else
sa->callp = &p->p_sysent->sv_table[sa->code];
- memcpy(sa->args, ap, nap * sizeof(register_t));
- if (sa->callp->sy_narg > nap)
- panic("ARM64TODO: Could we have more than %d args?", MAXARGS);
+ KASSERT(sa->callp->sy_narg <= nitems(sa->args),
+ ("Syscall %d takes too many arguments", sa->code));
+
+ memcpy(dst_ap, ap, (MAXARGS - 1) * sizeof(register_t));
td->td_retval[0] = 0;
td->td_retval[1] = 0;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Feb 8, 11:17 PM (20 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16535840
Default Alt Text
D26629.diff (1 KB)
Attached To
Mode
D26629: Tweak arm64's cpu_fetch_syscall_args()
Attached
Detach File
Event Timeline
Log In to Comment