xref: /netbsd-src/sys/compat/aoutm68k/aoutm68k_exec.c (revision 3cd7406ad812bfb15bb053c7704c765ee8780abd)
1*3cd7406aSpgoyette /*	$NetBSD: aoutm68k_exec.c,v 1.30 2018/08/10 21:44:58 pgoyette Exp $	*/
247a35be2Sscw 
347a35be2Sscw /*-
447a35be2Sscw  * Copyright (c) 2000 The NetBSD Foundation, Inc.
547a35be2Sscw  * All rights reserved.
647a35be2Sscw  *
747a35be2Sscw  * This code is derived from software contributed to The NetBSD Foundation
847a35be2Sscw  * by Steve C. Woodford.
947a35be2Sscw  *
1047a35be2Sscw  * Redistribution and use in source and binary forms, with or without
1147a35be2Sscw  * modification, are permitted provided that the following conditions
1247a35be2Sscw  * are met:
1347a35be2Sscw  * 1. Redistributions of source code must retain the above copyright
1447a35be2Sscw  *    notice, this list of conditions and the following disclaimer.
1547a35be2Sscw  * 2. Redistributions in binary form must reproduce the above copyright
1647a35be2Sscw  *    notice, this list of conditions and the following disclaimer in the
1747a35be2Sscw  *    documentation and/or other materials provided with the distribution.
1847a35be2Sscw  *
1947a35be2Sscw  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
2047a35be2Sscw  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
2147a35be2Sscw  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
2247a35be2Sscw  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
2347a35be2Sscw  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
2447a35be2Sscw  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
2547a35be2Sscw  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
2647a35be2Sscw  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
2747a35be2Sscw  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
2847a35be2Sscw  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
2947a35be2Sscw  * POSSIBILITY OF SUCH DAMAGE.
3047a35be2Sscw  */
3147a35be2Sscw 
32dab6ef8bSlukem #include <sys/cdefs.h>
33*3cd7406aSpgoyette __KERNEL_RCSID(0, "$NetBSD: aoutm68k_exec.c,v 1.30 2018/08/10 21:44:58 pgoyette Exp $");
34dab6ef8bSlukem 
356a89288aSmrg #if defined(_KERNEL_OPT)
3647a35be2Sscw #include "opt_syscall_debug.h"
3747a35be2Sscw #endif
3847a35be2Sscw 
3947a35be2Sscw #include <sys/param.h>
4047a35be2Sscw #include <sys/systm.h>
4147a35be2Sscw #include <sys/mount.h>
4247a35be2Sscw #include <sys/proc.h>
4347a35be2Sscw #include <sys/exec.h>
4447a35be2Sscw #include <sys/signalvar.h>
45b89c189bSpooka #include <sys/syscallvar.h>
4647a35be2Sscw 
47c487efe4Sfvdl #include <uvm/uvm_extern.h>
48c487efe4Sfvdl 
4947a35be2Sscw #include <compat/aoutm68k/aoutm68k_syscall.h>
5047a35be2Sscw 
5147a35be2Sscw extern struct sysent aoutm68k_sysent[];
52*3cd7406aSpgoyette extern const uint32_t aoutm68k_sysent_nomodbits[];
5347a35be2Sscw extern char sigcode[], esigcode[];
54f2af9174Sdsl void aoutm68k_syscall_intern(struct proc *);
5547a35be2Sscw 
56939df36eSchs struct uvm_object *emul_netbsd_aoutm68k_object;
57939df36eSchs 
5892ce8c6aSad struct emul emul_netbsd_aoutm68k = {
5933fa5ccbSchs 	.e_name =		"aoutm68k",
60afeacd3bStsutsui 	.e_path =		NULL,
61f5024696Sjdolecek #ifndef __HAVE_MINIMAL_EMUL
6233fa5ccbSchs 	.e_flags =		EMUL_HAS_SYS___syscall,
6333fa5ccbSchs 	.e_errno =		NULL,
6433fa5ccbSchs 	.e_nosys =		AOUTM68K_SYS_syscall,
6533fa5ccbSchs 	.e_nsysent =		AOUTM68K_SYS_NSYSENT,
66f5024696Sjdolecek #endif
6733fa5ccbSchs 	.e_sysent =		aoutm68k_sysent,
68*3cd7406aSpgoyette 	.e_nomodbits =		aoutm68k_sysent_nomodbits,
6947a35be2Sscw #ifdef SYSCALL_DEBUG
7033fa5ccbSchs 	.e_syscallnames =	syscallnames,
7147a35be2Sscw #endif
7233fa5ccbSchs 	.e_sendsig =		sendsig,
7333fa5ccbSchs 	.e_trapsignal =		trapsignal,
7433fa5ccbSchs 	.e_sigcode =		sigcode,
7533fa5ccbSchs 	.e_esigcode =		esigcode,
7633fa5ccbSchs 	.e_sigobject =		&emul_netbsd_aoutm68k_object,
7733fa5ccbSchs 	.e_setregs =		setregs,
7833fa5ccbSchs 	.e_proc_exec =		NULL,
7933fa5ccbSchs 	.e_proc_fork =		NULL,
8033fa5ccbSchs 	.e_proc_exit =		NULL,
8133fa5ccbSchs 	.e_lwp_fork =		NULL,
8233fa5ccbSchs 	.e_lwp_exit =		NULL,
8333fa5ccbSchs 	.e_syscall_intern =	aoutm68k_syscall_intern,
8433fa5ccbSchs 	.e_sysctlovly =		NULL,
8533fa5ccbSchs 	.e_vm_default_addr =	uvm_default_mapaddr,
8633fa5ccbSchs 	.e_usertrap =		NULL,
8733fa5ccbSchs 	.e_ucsize =		0,
8833fa5ccbSchs 	.e_startlwp =		NULL
8947a35be2Sscw };
90