From 24adaab477dca6fe334057a5f75c7a6b372b244a Mon Sep 17 00:00:00 2001 From: Edward Tomasz Napierala Date: Fri, 6 Nov 2020 19:19:51 +0000 Subject: [PATCH] Remove 'struct trapframe' pointer from mips64's 'struct syscall_args'. While here, use MAXARGS. This brings its 'struct syscall_args' in sync with most other architectures. Reviewed by: arichardson, brooks MFC after: 2 weeks Sponsored by: EPSRC Differential Revision: https://reviews.freebsd.org/D26619 --- sys/mips/include/proc.h | 4 ++-- sys/mips/mips/trap.c | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/sys/mips/include/proc.h b/sys/mips/include/proc.h index d0acf5e46c76..0cb1d433387c 100644 --- a/sys/mips/include/proc.h +++ b/sys/mips/include/proc.h @@ -81,11 +81,11 @@ struct mdproc { 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 diff --git a/sys/mips/mips/trap.c b/sys/mips/mips/trap.c index 0fdd8f77c502..78e7c0ed8113 100644 --- a/sys/mips/mips/trap.c +++ b/sys/mips/mips/trap.c @@ -349,9 +349,9 @@ cpu_fetch_syscall_args(struct thread *td) 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 @@ dofault: case T_SYSCALL + T_USER: { - td->td_sa.trapframe = trapframe; syscallenter(td); #if !defined(SMP) && (defined(DDB) || defined(DEBUG))