Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F156479908
D27135.id79304.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D27135.id79304.diff
View Options
Index: sys/mips/include/proc.h
===================================================================
--- sys/mips/include/proc.h
+++ sys/mips/include/proc.h
@@ -81,11 +81,11 @@
size_t md_tls_tcb_offset; /* TCB offset */
};
+#define MAXARGS 8
struct syscall_args {
u_int code;
struct sysent *callp;
- register_t args[8];
- struct trapframe *trapframe;
+ register_t args[MAXARGS];
};
#ifdef __mips_n64
Index: sys/mips/mips/trap.c
===================================================================
--- sys/mips/mips/trap.c
+++ sys/mips/mips/trap.c
@@ -349,9 +349,9 @@
bzero(sa->args, sizeof(sa->args));
/* compute next PC after syscall instruction */
- td->td_pcb->pcb_tpc = sa->trapframe->pc; /* Remember if restart */
- if (DELAYBRANCH(sa->trapframe->cause)) /* Check BD bit */
- locr0->pc = MipsEmulateBranch(locr0, sa->trapframe->pc, 0, 0);
+ td->td_pcb->pcb_tpc = locr0->pc; /* Remember if restart */
+ if (DELAYBRANCH(locr0->cause)) /* Check BD bit */
+ locr0->pc = MipsEmulateBranch(locr0, locr0->pc, 0, 0);
else
locr0->pc += sizeof(int);
sa->code = locr0->v0;
@@ -781,7 +781,6 @@
case T_SYSCALL + T_USER:
{
- td->td_sa.trapframe = trapframe;
syscallenter(td);
#if !defined(SMP) && (defined(DDB) || defined(DEBUG))
Index: sys/riscv/riscv/trap.c
===================================================================
--- sys/riscv/riscv/trap.c
+++ sys/riscv/riscv/trap.c
@@ -46,6 +46,7 @@
#include <sys/ptrace.h>
#include <sys/syscall.h>
#include <sys/sysent.h>
+#include <sys/sysproto.h>
#ifdef KDB
#include <sys/kdb.h>
#endif
@@ -106,12 +107,6 @@
sa->code = td->td_frame->tf_t[0];
- if (__predict_false(sa->code == SYS_syscall || sa->code == SYS___syscall)) {
- sa->code = *ap++;
- } else {
- *dst_ap++ = *ap++;
- }
-
if (__predict_false(sa->code >= p->p_sysent->sv_size))
sa->callp = &p->p_sysent->sv_table[0];
else
@@ -120,7 +115,13 @@
KASSERT(sa->callp->sy_narg <= nitems(sa->args),
("Syscall %d takes too many arguments", sa->code));
- memcpy(dst_ap, ap, (NARGREG - 1) * sizeof(register_t));
+ if (__predict_false(sa->callp->sy_call == (sy_call_t *)nosys) &&
+ (sa->code == SYS_syscall || sa->code == SYS___syscall)) {
+ sa->code = *ap++;
+ memcpy(dst_ap, ap, (NARGREG - 1) * sizeof(register_t));
+ } else {
+ memcpy(dst_ap, ap, NARGREG * sizeof(register_t));
+ }
td->td_retval[0] = 0;
td->td_retval[1] = 0;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, May 14, 11:14 PM (15 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33066566
Default Alt Text
D27135.id79304.diff (2 KB)
Attached To
Mode
D27135: Questionable optimization for riscv cpu_fetch_syscall_args()
Attached
Detach File
Event Timeline
Log In to Comment