-/* $OpenBSD: trap.c,v 1.99 2020/11/07 16:12:20 deraadt Exp $ */
+/* $OpenBSD: trap.c,v 1.100 2021/12/09 00:26:11 guenther Exp $ */
/* $NetBSD: trap.c,v 1.52 2000/05/24 16:48:33 thorpej Exp $ */
/*-
u_int64_t code;
struct trapframe *framep;
{
- struct sysent *callp;
+ const struct sysent *callp;
struct proc *p;
- int error, numsys;
+ int error;
u_int64_t opc;
u_long rval[2];
u_long args[10]; /* XXX */
framep->tf_regs[FRAME_SP] = alpha_pal_rdusp();
opc = framep->tf_regs[FRAME_PC] - 4;
- callp = p->p_p->ps_emul->e_sysent;
- numsys = p->p_p->ps_emul->e_nsysent;
-
switch(code) {
case SYS_syscall:
case SYS___syscall:
}
error = 0;
- if (code < numsys)
- callp += code;
+ callp = sysent;
+ if (code >= SYS_MAXSYSCALL)
+ callp += SYS_syscall;
else
- callp += p->p_p->ps_emul->e_nosys;
+ callp += code;
nargs = callp->sy_narg + hidden;
switch (nargs) {
-/* $OpenBSD: trap.c,v 1.89 2021/06/02 00:39:26 cheloha Exp $ */
+/* $OpenBSD: trap.c,v 1.90 2021/12/09 00:26:11 guenther Exp $ */
/* $NetBSD: trap.c,v 1.2 2003/05/04 23:51:56 fvdl Exp $ */
/*-
const struct sysent *callp;
struct proc *p;
int error;
- int nsys;
size_t argsize, argoff;
register_t code, args[9], rval[2], *argp;
p = curproc;
code = frame->tf_rax;
- callp = p->p_p->ps_emul->e_sysent;
- nsys = p->p_p->ps_emul->e_nsysent;
argp = &args[0];
argoff = 0;
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
callp += code;
-/* $OpenBSD: syscall.c,v 1.23 2021/05/16 03:39:27 jsg Exp $ */
+/* $OpenBSD: syscall.c,v 1.24 2021/12/09 00:26:11 guenther Exp $ */
/* $NetBSD: syscall.c,v 1.24 2003/11/14 19:03:17 scw Exp $ */
/*-
code = frame->tf_r12;
ap = &frame->tf_r0;
- callp = p->p_p->ps_emul->e_sysent;
switch (code) {
case SYS_syscall:
break;
}
- if (code < 0 || code >= p->p_p->ps_emul->e_nsysent) {
- callp += p->p_p->ps_emul->e_nosys;
- } else {
+ callp = sysent;
+ if (code < 0 || code >= SYS_MAXSYSCALL)
+ callp += SYS_syscall;
+ else
callp += code;
- }
+
nargs = callp->sy_argsize / sizeof(register_t);
if (nargs <= nap) {
args = ap;
-/* $OpenBSD: syscall.c,v 1.8 2021/05/16 03:30:33 jsg Exp $ */
+/* $OpenBSD: syscall.c,v 1.9 2021/12/09 00:26:11 guenther Exp $ */
/*
* Copyright (c) 2015 Dale Rahn <drahn@dalerahn.com>
*
code = frame->tf_x[8];
ap = &frame->tf_x[0];
- callp = p->p_p->ps_emul->e_sysent;
switch (code) {
case SYS_syscall:
break;
}
- if (code < 0 || code >= p->p_p->ps_emul->e_nsysent) {
- callp += p->p_p->ps_emul->e_nosys;
- } else {
+ callp = sysent;
+ if (code < 0 || code >= SYS_MAXSYSCALL)
+ callp += SYS_syscall;
+ else
callp += code;
- }
+
nargs = callp->sy_argsize / sizeof(register_t);
if (nargs <= nap) {
args = ap;
-/* $OpenBSD: trap.c,v 1.154 2021/10/07 08:21:22 claudio Exp $ */
+/* $OpenBSD: trap.c,v 1.155 2021/12/09 00:26:11 guenther Exp $ */
/*
* Copyright (c) 1998-2004 Michael Shalayeff
void
syscall(struct trapframe *frame)
{
- register struct proc *p = curproc;
- register const struct sysent *callp;
- int retq, nsys, code, argsize, argoff, error;
+ struct proc *p = curproc;
+ const struct sysent *callp;
+ int retq, code, argsize, argoff, error;
register_t args[8], rval[2];
#ifdef DIAGNOSTIC
int oldcpl = curcpu()->ci_cpl;
panic("syscall");
p->p_md.md_regs = frame;
- nsys = p->p_p->ps_emul->e_nsysent;
- callp = p->p_p->ps_emul->e_sysent;
argoff = 4; retq = 0;
switch (code = frame->tf_t1) {
argoff = 3;
break;
case SYS___syscall:
- if (callp != sysent)
- break;
/*
* this works, because quads get magically swapped
* due to the args being laid backwards on the stack
break;
}
- if (code < 0 || code >= nsys)
- callp += p->p_p->ps_emul->e_nosys; /* bad syscall # */
+ callp = sysent;
+ if (code < 0 || code >= SYS_MAXSYSCALL)
+ callp += SYS_syscall;
else
callp += code;
-/* $OpenBSD: trap.c,v 1.155 2021/09/19 10:43:26 mpi Exp $ */
+/* $OpenBSD: trap.c,v 1.156 2021/12/09 00:26:11 guenther Exp $ */
/* $NetBSD: trap.c,v 1.95 1996/05/05 06:50:02 mycroft Exp $ */
/*-
syscall(struct trapframe *frame)
{
caddr_t params;
- struct sysent *callp;
+ const struct sysent *callp;
struct proc *p;
- int error, nsys;
+ int error;
register_t code, args[8], rval[2];
#ifdef DIAGNOSTIC
int ocpl = lapic_tpr;
p->p_md.md_regs = frame;
code = frame->tf_eax;
- nsys = p->p_p->ps_emul->e_nsysent;
- callp = p->p_p->ps_emul->e_sysent;
-
params = (caddr_t)frame->tf_esp + sizeof(int);
switch (code) {
* Like syscall, but code is a quad, so as to maintain
* quad alignment for the rest of the arguments.
*/
- if (callp != sysent)
- break;
copyin(params + _QUAD_LOWWORD * sizeof(int), &code, sizeof(int));
params += sizeof(quad_t);
break;
default:
break;
}
- if (code < 0 || code >= nsys)
- callp += p->p_p->ps_emul->e_nosys; /* illegal */
+
+ callp = sysent;
+ if (code < 0 || code >= SYS_MAXSYSCALL)
+ callp += SYS_syscall;
else
callp += code;
argsize = callp->sy_argsize;
-/* $OpenBSD: trap.c,v 1.119 2020/10/30 17:11:20 deraadt Exp $ */
+/* $OpenBSD: trap.c,v 1.120 2021/12/09 00:26:11 guenther Exp $ */
/*
* Copyright (c) 2004, Miodrag Vallat.
* Copyright (c) 1998 Steve Murphree, Jr.
void
m88100_syscall(register_t code, struct trapframe *tf)
{
- int i, nsys, nap;
- struct sysent *callp;
+ int i, nap;
+ const struct sysent *callp;
struct proc *p = curproc;
int error;
register_t args[8] __aligned(8);
uvmexp.syscalls++;
- callp = p->p_p->ps_emul->e_sysent;
- nsys = p->p_p->ps_emul->e_nsysent;
-
p->p_md.md_tf = tf;
/*
nap--;
break;
case SYS___syscall:
- if (callp != sysent)
- break;
code = ap[_QUAD_LOWWORD];
ap += 2;
nap -= 2;
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
callp += code;
void
m88110_syscall(register_t code, struct trapframe *tf)
{
- int i, nsys, nap;
- struct sysent *callp;
+ int i, nap;
+ const struct sysent *callp;
struct proc *p = curproc;
int error;
register_t args[8] __aligned(8);
uvmexp.syscalls++;
- callp = p->p_p->ps_emul->e_sysent;
- nsys = p->p_p->ps_emul->e_nsysent;
-
p->p_md.md_tf = tf;
/*
nap--;
break;
case SYS___syscall:
- if (callp != sysent)
- break;
code = ap[_QUAD_LOWWORD];
ap += 2;
nap -= 2;
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
callp += code;
-/* $OpenBSD: trap.c,v 1.155 2021/10/24 15:29:10 visa Exp $ */
+/* $OpenBSD: trap.c,v 1.156 2021/12/09 00:26:11 guenther Exp $ */
/*
* Copyright (c) 1988 University of Utah.
case T_SYSCALL+T_USER:
{
struct trapframe *locr0 = p->p_md.md_regs;
- struct sysent *callp;
+ const struct sysent *callp;
unsigned int code;
register_t tpc;
uint32_t branch = 0;
- int error, numarg, numsys;
+ int error, numarg;
struct args {
register_t i[8];
} args;
trapframe->pc, 0, branch);
} else
locr0->pc += 4;
- callp = p->p_p->ps_emul->e_sysent;
- numsys = p->p_p->ps_emul->e_nsysent;
+ callp = sysent;
code = locr0->v0;
switch (code) {
case SYS_syscall:
* platforms, which doesn't change anything here.
*/
code = locr0->a0;
- if (code >= numsys)
- callp += p->p_p->ps_emul->e_nosys; /* (illegal) */
+ if (code >= SYS_MAXSYSCALL)
+ callp += SYS_syscall;
else
callp += code;
numarg = callp->sy_argsize / sizeof(register_t);
}
break;
default:
- if (code >= numsys)
- callp += p->p_p->ps_emul->e_nosys; /* (illegal) */
+ if (code >= SYS_MAXSYSCALL)
+ callp += SYS_syscall;
else
callp += code;
-/* $OpenBSD: trap.c,v 1.122 2021/11/26 14:59:42 jsg Exp $ */
+/* $OpenBSD: trap.c,v 1.123 2021/12/09 00:26:11 guenther Exp $ */
/* $NetBSD: trap.c,v 1.3 1996/10/13 03:31:37 christos Exp $ */
/*
struct vm_map *map;
vaddr_t va;
int access_type;
- struct sysent *callp;
+ const struct sysent *callp;
size_t argsize;
register_t code, error;
register_t *params, rval[2], args[10];
- int nsys, n;
+ int n;
if (frame->srr1 & PSL_PR) {
type |= EXC_USER;
case EXC_SC|EXC_USER:
uvmexp.syscalls++;
- nsys = p->p_p->ps_emul->e_nsysent;
- callp = p->p_p->ps_emul->e_sysent;
-
code = frame->fixreg[0];
params = frame->fixreg + FIRSTARG;
* so as to maintain quad alignment
* for the rest of the args.
*/
- if (callp != sysent)
- break;
params++;
code = *params++;
break;
default:
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
callp += code;
argsize = callp->sy_argsize;
-/* $OpenBSD: syscall.c,v 1.7 2020/10/09 20:30:18 kettenis Exp $ */
+/* $OpenBSD: syscall.c,v 1.8 2021/12/09 00:26:11 guenther Exp $ */
/*
* Copyright (c) 2015 Dale Rahn <drahn@dalerahn.com>
{
struct proc *p = curproc;
const struct sysent *callp;
- int code, error, nsys;
+ int code, error;
int nap = 8, nargs;
register_t *ap, *args, copyargs[MAXARGS], rval[2];
code = frame->fixreg[0];
- callp = p->p_p->ps_emul->e_sysent;
- nsys = p->p_p->ps_emul->e_nsysent;
ap = &frame->fixreg[3];
switch (code) {
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
callp += code;
nargs = callp->sy_argsize / sizeof(register_t);
-/* $OpenBSD: syscall.c,v 1.10 2021/06/21 14:39:30 deraadt Exp $ */
+/* $OpenBSD: syscall.c,v 1.11 2021/12/09 00:26:11 guenther Exp $ */
/*
* Copyright (c) 2020 Brian Bamsch <bbamsch@google.com>
ap = &frame->tf_a[0];
code = frame->tf_t[0];
- callp = p->p_p->ps_emul->e_sysent;
switch (code) {
case SYS_syscall:
break;
}
- if (code < 0 || code >= p->p_p->ps_emul->e_nsysent) {
- callp += p->p_p->ps_emul->e_nosys;
- } else {
+ callp = sysent;
+ if (code < 0 || code >= SYS_MAXSYSCALL)
+ callp += SYS_syscall;
+ else
callp += code;
- }
nargs = callp->sy_argsize / sizeof(register_t);
if (nargs <= nap) {
args = ap;
-/* $OpenBSD: trap.c,v 1.48 2021/03/11 11:17:00 jsg Exp $ */
+/* $OpenBSD: trap.c,v 1.49 2021/12/09 00:26:11 guenther Exp $ */
/* $NetBSD: exception.c,v 1.32 2006/09/04 23:57:52 uwe Exp $ */
/* $NetBSD: syscall.c,v 1.6 2006/03/07 07:21:50 thorpej Exp $ */
{
caddr_t params;
const struct sysent *callp;
- int error, opc, nsys;
+ int error, opc;
size_t argsize;
register_t code, args[8], rval[2], ocode;
opc = tf->tf_spc;
ocode = code = tf->tf_r0;
- nsys = p->p_p->ps_emul->e_nsysent;
- callp = p->p_p->ps_emul->e_sysent;
-
params = (caddr_t)tf->tf_r15;
switch (code) {
* Like syscall, but code is a quad, so as to maintain
* quad alignment for the rest of the arguments.
*/
- if (callp != sysent)
- break;
#if _BYTE_ORDER == BIG_ENDIAN
code = tf->tf_r5;
#else
default:
break;
}
- if (code < 0 || code >= nsys)
- callp += p->p_p->ps_emul->e_nosys; /* illegal */
+
+ callp = sysent;
+ if (code < 0 || code >= SYS_MAXSYSCALL)
+ callp += SYS_syscall;
else
callp += code;
argsize = callp->sy_argsize;
#ifdef DIAGNOSTIC
if (argsize > sizeof args) {
- callp += p->p_p->ps_emul->e_nosys - code;
+ callp += SYS_syscall - code;
argsize = callp->sy_argsize;
}
#endif
-/* $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 $ */
/*
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;
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
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;
-/* $OpenBSD: dt_prov_syscall.c,v 1.6 2021/09/03 16:45:45 jasper Exp $ */
+/* $OpenBSD: dt_prov_syscall.c,v 1.7 2021/12/09 00:26:11 guenther Exp $ */
/*
* Copyright (c) 2019 Martin Pieuchot <mpi@openbsd.org>
#include <sys/param.h>
#include <sys/malloc.h>
#include <sys/atomic.h>
+#include <sys/systm.h>
#include <sys/syscall.h>
#include <dev/dt/dtvar.h>
-extern struct sysent sysent[];
-
/* Arrays of probes per syscall. */
struct dt_probe **dtps_entry;
struct dt_probe **dtps_return;
-/* $OpenBSD: exec_elf.c,v 1.164 2021/12/07 22:17:02 guenther Exp $ */
+/* $OpenBSD: exec_elf.c,v 1.165 2021/12/09 00:26:10 guenther Exp $ */
/*
* Copyright (c) 1996 Per Fogelstrom
*/
#define ELF_MAX_VALID_PHDR 32
-/*
- * This is the OpenBSD ELF emul
- */
-struct emul emul_elf = {
- SYS_syscall,
- SYS_MAXSYSCALL,
- sysent,
-};
-
#define ELF_NOTE_NAME_OPENBSD 0x01
struct elf_note_name {
exe_base = uvm_map_pie(base_ph->p_align);
}
- /*
- * OK, we want a slightly different twist of the
- * standard emulation package for "real" elf.
- */
- epp->ep_emul = &emul_elf;
-
/*
* Verify this is an OpenBSD executable. If it's marked that way
* via a PT_NOTE then also check for a PT_OPENBSD_WXNEEDED segment.
-/* $OpenBSD: init_main.c,v 1.312 2021/12/07 22:17:02 guenther Exp $ */
+/* $OpenBSD: init_main.c,v 1.313 2021/12/09 00:26:10 guenther Exp $ */
/* $NetBSD: init_main.c,v 1.84.4.1 1996/06/02 09:08:06 mrg Exp $ */
/*
void pool_gc_pages(void *);
void percpu_init(void);
-struct emul emul_native = {
- SYS_syscall,
- SYS_MAXSYSCALL,
- sysent,
-};
-
#ifdef DIAGNOSTIC
int pdevinit_done = 0;
#endif
atomic_setbits_int(&p->p_flag, P_SYSTEM);
p->p_stat = SONPROC;
pr->ps_nice = NZERO;
- pr->ps_emul = &emul_native;
strlcpy(pr->ps_comm, "swapper", sizeof(pr->ps_comm));
/* Init timeouts. */
kqueue_init_percpu();
uvm_init_percpu();
- /* init exec and emul */
+ /* init exec */
init_exec();
/* Start the scheduler */
-/* $OpenBSD: init_sysent.c,v 1.231 2021/11/29 16:31:43 mvs Exp $ */
+/* $OpenBSD: init_sysent.c,v 1.232 2021/12/09 00:26:10 guenther Exp $ */
/*
* System call switch table.
#define s(type) sizeof(type)
-struct sysent sysent[] = {
+const struct sysent sysent[] = {
{ 0, 0, 0,
sys_nosys }, /* 0 = syscall (indir) */
{ 1, s(struct sys_exit_args), 0,
-/* $OpenBSD: kern_exec.c,v 1.227 2021/12/07 22:17:02 guenther Exp $ */
+/* $OpenBSD: kern_exec.c,v 1.228 2021/12/09 00:26:10 guenther Exp $ */
/* $NetBSD: kern_exec.c,v 1.75 1996/02/09 18:59:28 christos Exp $ */
/*-
char *stack;
struct ps_strings arginfo;
struct vmspace *vm;
- extern struct emul emul_native;
struct vnode *otvp;
/* get other threads to stop */
pack.ep_auxinfo = NULL;
VMCMDSET_INIT(&pack.ep_vmcmds);
pack.ep_vap = &attr;
- pack.ep_emul = &emul_native;
pack.ep_flags = 0;
/* see if we can run it. */
else
atomic_clearbits_int(&p->p_p->ps_flags, PS_WXNEEDED);
- /* update ps_emul, the old value is no longer needed */
- pr->ps_emul = pack.ep_emul;
-
atomic_clearbits_int(&pr->ps_flags, PS_INEXEC);
single_thread_clear(p, P_SUSPSIG);
size_t timekeep_sz = round_page(sizeof(struct timekeep));
/*
- * Similar to the sigcode object, except that there is a single
- * timekeep object, and not one per emulation.
+ * Similar to the sigcode object
*/
if (timekeep_object == NULL) {
vaddr_t va = 0;
-/* $OpenBSD: kern_xxx.c,v 1.37 2021/12/07 22:17:02 guenther Exp $ */
+/* $OpenBSD: kern_xxx.c,v 1.38 2021/12/09 00:26:10 guenther Exp $ */
/* $NetBSD: kern_xxx.c,v 1.32 1996/04/22 01:38:41 christos Exp $ */
/*
#ifdef SYSCALL_DEBUG
#include <sys/proc.h>
+#include <sys/syscall.h>
#define SCDEBUG_CALLS 0x0001 /* show calls */
#define SCDEBUG_RETURNS 0x0002 /* show returns */
scdebug_call(struct proc *p, register_t code, const register_t args[])
{
struct process *pr;
- struct sysent *sy;
- struct emul *em;
int i;
if (!(scdebug & SCDEBUG_CALLS))
return;
- pr = p->p_p;
- em = pr->ps_emul;
- sy = &em->e_sysent[code];
- if (!(scdebug & SCDEBUG_ALL || code < 0 || code >= em->e_nsysent ||
- sy->sy_call == sys_nosys))
+ if (!(scdebug & SCDEBUG_ALL || code < 0 || code >= SYS_MAXSYSCALL ||
+ sysent[code].sy_call == sys_nosys))
return;
+ pr = p->p_p;
printf("proc %d (%s): num ", pr->ps_pid, pr->ps_comm);
- if (code < 0 || code >= em->e_nsysent)
+ if (code < 0 || code >= SYS_MAXSYSCALL)
printf("OUT OF RANGE (%ld)", code);
else {
printf("%ld call: %s", code, syscallnames[code]);
if (scdebug & SCDEBUG_SHOWARGS) {
printf("(");
- for (i = 0; i < sy->sy_argsize / sizeof(register_t);
+ for (i = 0; i < sysent[code].sy_argsize / sizeof(register_t);
i++)
printf("%s0x%lx", i == 0 ? "" : ", ", args[i]);
printf(")");
const register_t retval[])
{
struct process *pr;
- struct sysent *sy;
- struct emul *em;
if (!(scdebug & SCDEBUG_RETURNS))
return;
- pr = p->p_p;
- em = pr->ps_emul;
- sy = &em->e_sysent[code];
- if (!(scdebug & SCDEBUG_ALL || code < 0 || code >= em->e_nsysent ||
- sy->sy_call == sys_nosys))
+ if (!(scdebug & SCDEBUG_ALL || code < 0 || code >= SYS_MAXSYSCALL ||
+ sysent[code].sy_call == sys_nosys))
return;
+ pr = p->p_p;
printf("proc %d (%s): num ", pr->ps_pid, pr->ps_comm);
- if (code < 0 || code >= em->e_nsysent)
+ if (code < 0 || code >= SYS_MAXSYSCALL)
printf("OUT OF RANGE (%ld)", code);
else
printf("%ld ret: err = %d, rv = 0x%lx,0x%lx", code,
#! /bin/sh -
-# $OpenBSD: makesyscalls.sh,v 1.14 2021/12/07 22:17:02 guenther Exp $
+# $OpenBSD: makesyscalls.sh,v 1.15 2021/12/09 00:26:10 guenther Exp $
# $NetBSD: makesyscalls.sh,v 1.26 1998/01/09 06:17:51 thorpej Exp $
#
# Copyright (c) 1994,1996 Christopher G. Demetriou
# syssw the syscall switch file
# sysarghdr the syscall argument struct definitions
# compatopts those syscall types that are for 'compat' syscalls
-# switchname the name for the 'struct sysent' we define
+# switchname the name for the 'const struct sysent' we define
# namesname the name for the 'const char *const[]' we define
# constprefix the prefix for the system call constants
#
}
printf "\n#define\ts(type)\tsizeof(type)\n\n" > sysent
- printf "struct sysent %s[] = {\n",switchname > sysent
+ printf "const struct sysent %s[] = {\n",switchname > sysent
printf "/*\t\$OpenBSD\$\t*/\n\n" > sysnames
printf "/*\n * System call names.\n *\n" > sysnames
-/* $OpenBSD: exec.h,v 1.45 2021/12/06 21:21:10 guenther Exp $ */
+/* $OpenBSD: exec.h,v 1.46 2021/12/09 00:26:10 guenther Exp $ */
/* $NetBSD: exec.h,v 1.59 1996/02/09 18:25:09 christos Exp $ */
/*-
/*
* Below the PS_STRINGS and sigtramp, we may require a gap on the stack
- * (used to copyin/copyout various emulation data structures).
+ * (used to copyin/copyout various XXX emulation data structures).
*/
#define STACKGAPLEN (2*1024) /* plenty enough for now */
u_int ep_flags; /* flags; see below. */
char **ep_fa; /* a fake args vector for scripts */
int ep_fd; /* a file descriptor we're holding */
- struct emul *ep_emul; /* os emulation */
struct elf_args *ep_args; /* ELF info */
void *ep_auxinfo; /* userspace auxinfo address */
char *ep_interp; /* name of interpreter if any */
-/* $OpenBSD: proc.h,v 1.321 2021/12/07 22:17:03 guenther Exp $ */
+/* $OpenBSD: proc.h,v 1.322 2021/12/09 00:26:10 guenther Exp $ */
/* $NetBSD: proc.h,v 1.44 1996/04/22 01:23:21 christos Exp $ */
/*-
int pg_jobc; /* # procs qualifying pgrp for job control */
};
-/*
- * One structure allocated per emulation.
- */
-struct exec_package;
-struct proc;
-struct ps_strings;
-struct uvm_object;
-union sigval;
-
-struct emul {
- int e_nosys; /* Offset of the nosys() syscall */
- int e_nsysent; /* Number of system call entries */
- struct sysent *e_sysent; /* System call array */
-};
-
/*
* time usage: accumulated times in ticks
* Once a second, each thread's immediate counts (p_[usi]ticks) are
#ifdef __need_process
struct futex;
LIST_HEAD(futex_list, futex);
+struct proc;
struct tslpentry;
TAILQ_HEAD(tslpqueue, tslpentry);
struct unveil;
#define ps_startcopy ps_limit
struct plimit *ps_limit; /* [m,R] Process limits. */
struct pgrp *ps_pgrp; /* Pointer to process group. */
- struct emul *ps_emul; /* Emulation information */
char ps_comm[MAXCOMLEN+1];
-/* $OpenBSD: systm.h,v 1.154 2021/06/02 00:39:25 cheloha Exp $ */
+/* $OpenBSD: systm.h,v 1.155 2021/12/09 00:26:10 guenther Exp $ */
/* $NetBSD: systm.h,v 1.50 1996/06/09 04:55:09 briggs Exp $ */
/*-
typedef int sy_call_t(struct proc *, void *, register_t *);
-extern struct sysent { /* system call table */
+extern const struct sysent { /* system call table */
short sy_narg; /* number of args */
short sy_argsize; /* total size of arguments */
int sy_flags;