summaryrefslogtreecommitdiff
path: root/sys/arch/sparc64
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2021-12-09 00:26:12 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2021-12-09 00:26:12 +0000
commit7e6e414e2c08159131c872247dcdcf8ef812a294 (patch)
treeca5f0e06b96c8fcbbcc7167df41d831d6f3302d3 /sys/arch/sparc64
parentb6288ade839f9de0cd569d091510068f0e78bb51 (diff)
We only have one syscall table: inline sysent/SYS_MAXSYSCALL and
SYS_syscall as the nosys() function into the MD syscall entry routines and the SYSCALL_DEBUG support. Adjust alpha's syscall check to match the other archs. Also, make sysent const to get it into .rodata. With that, 'struct emul' is unused: delete it and all its references ok millert@
Diffstat (limited to 'sys/arch/sparc64')
-rw-r--r--sys/arch/sparc64/sparc64/trap.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/sys/arch/sparc64/sparc64/trap.c b/sys/arch/sparc64/sparc64/trap.c
index 1d7165d172f..0f996f913bf 100644
--- a/sys/arch/sparc64/sparc64/trap.c
+++ b/sys/arch/sparc64/sparc64/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.109 2021/05/05 07:29:01 mpi Exp $ */
+/* $OpenBSD: trap.c,v 1.110 2021/12/09 00:26:11 guenther Exp $ */
/* $NetBSD: trap.c,v 1.73 2001/08/09 01:03:01 eeh Exp $ */
/*
@@ -1102,7 +1102,7 @@ out:
void
syscall(struct trapframe64 *tf, register_t code, register_t pc)
{
- int i, nsys, nap;
+ int i, nap;
int64_t *ap;
const struct sysent *callp;
struct proc *p = curproc;
@@ -1126,9 +1126,6 @@ syscall(struct trapframe64 *tf, register_t code, register_t pc)
new = code & SYSCALL_G2RFLAG;
code &= ~SYSCALL_G2RFLAG;
- callp = p->p_p->ps_emul->e_sysent;
- nsys = p->p_p->ps_emul->e_nsysent;
-
/*
* The first six system call arguments are in the six %o registers.
* Any arguments beyond that are in the `argument extension' area
@@ -1151,8 +1148,9 @@ syscall(struct trapframe64 *tf, register_t code, register_t pc)
break;
}
- if (code < 0 || code >= nsys)
- callp += p->p_p->ps_emul->e_nosys;
+ callp = sysent;
+ if (code < 0 || code >= SYS_MAXSYSCALL)
+ callp += SYS_syscall;
else {
register_t *argp;