sunos_exec.c revision 1.57
11.57Spgoyette/* $NetBSD: sunos_exec.c,v 1.57 2018/08/10 21:44:59 pgoyette Exp $ */ 21.5Scgd 31.1Sderaadt/* 41.1Sderaadt * Copyright (c) 1993 Theo de Raadt 51.1Sderaadt * All rights reserved. 61.1Sderaadt * 71.1Sderaadt * Redistribution and use in source and binary forms, with or without 81.1Sderaadt * modification, are permitted provided that the following conditions 91.1Sderaadt * are met: 101.1Sderaadt * 1. Redistributions of source code must retain the above copyright 111.1Sderaadt * notice, this list of conditions and the following disclaimer. 121.1Sderaadt * 2. Redistributions in binary form must reproduce the above copyright 131.1Sderaadt * notice, this list of conditions and the following disclaimer in the 141.1Sderaadt * documentation and/or other materials provided with the distribution. 151.1Sderaadt * 3. The name of the author may not be used to endorse or promote products 161.4Sjtc * derived from this software without specific prior written permission 171.1Sderaadt * 181.1Sderaadt * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 191.1Sderaadt * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 201.1Sderaadt * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 211.1Sderaadt * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 221.1Sderaadt * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 231.1Sderaadt * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 241.1Sderaadt * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 251.1Sderaadt * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 261.1Sderaadt * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 271.1Sderaadt * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 281.1Sderaadt */ 291.36Slukem 301.36Slukem#include <sys/cdefs.h> 311.57Spgoyette__KERNEL_RCSID(0, "$NetBSD: sunos_exec.c,v 1.57 2018/08/10 21:44:59 pgoyette Exp $"); 321.19Ssoren 331.32Smrg#if defined(_KERNEL_OPT) 341.19Ssoren#include "opt_syscall_debug.h" 351.26Sjdolecek#endif 361.1Sderaadt 371.1Sderaadt#include <sys/param.h> 381.1Sderaadt#include <sys/systm.h> 391.1Sderaadt#include <sys/proc.h> 401.1Sderaadt#include <sys/mount.h> 411.8Schristos#include <sys/signalvar.h> 421.1Sderaadt#include <sys/vnode.h> 431.35Sjdolecek#include <sys/exec.h> 441.1Sderaadt 451.47Sfvdl#include <uvm/uvm_extern.h> 461.47Sfvdl 471.11Sbriggs#include <compat/sunos/sunos.h> 481.48Schristos#include <compat/sunos/sunos_exec.h> 491.8Schristos#include <compat/sunos/sunos_syscall.h> 501.1Sderaadt 511.49Schristos#include <machine/sunos_machdep.h> 521.49Schristos 531.8Schristosextern int nsunos_sysent; 541.8Schristosextern struct sysent sunos_sysent[]; 551.57Spgoyetteextern const uint32_t sunos_sysent_nomodbits[]; 561.8Schristos#ifdef SYSCALL_DEBUG 571.21Sjdolecekextern const char * const sunos_syscallnames[]; 581.8Schristos#endif 591.17Schristosextern char sunos_sigcode[], sunos_esigcode[]; 601.48Schristos#ifndef __HAVE_SYSCALL_INTERN 611.51Sdslvoid syscall(void); 621.37Sscw#endif 631.8Schristos 641.41Schsstruct uvm_object *emul_sunos_object; 651.41Schs 661.52Sadstruct emul emul_sunos = { 671.53Schs .e_name = "sunos", 681.53Schs .e_path = "/emul/sunos", 691.40Sjdolecek#ifndef __HAVE_MINIMAL_EMUL 701.53Schs .e_flags = 0, 711.53Schs .e_errno = NULL, 721.53Schs .e_nosys = SUNOS_SYS_syscall, 731.53Schs .e_nsysent = SUNOS_SYS_NSYSENT, 741.40Sjdolecek#endif 751.53Schs .e_sysent = sunos_sysent, 761.57Spgoyette .e_nomodbits = sunos_sysent_nomodbits, 771.8Schristos#ifdef SYSCALL_DEBUG 781.53Schs .e_syscallnames = sunos_syscallnames, 791.8Schristos#else 801.53Schs .e_syscallnames = NULL, 811.8Schristos#endif 821.53Schs .e_sendsig = sunos_sendsig, 831.53Schs .e_trapsignal = trapsignal, 841.53Schs .e_sigcode = sunos_sigcode, 851.53Schs .e_esigcode = sunos_esigcode, 861.53Schs .e_sigobject = &emul_sunos_object, 871.53Schs .e_setregs = setregs, 881.53Schs .e_proc_exec = NULL, 891.53Schs .e_proc_fork = NULL, 901.53Schs .e_proc_exit = NULL, 911.53Schs .e_lwp_fork = NULL, 921.53Schs .e_lwp_exit = NULL, 931.37Sscw#ifdef __HAVE_SYSCALL_INTERN 941.53Schs .e_syscall_intern = sunos_syscall_intern, 951.37Sscw#else 961.53Schs .e_syscall_intern = syscall, 971.37Sscw#endif 981.53Schs .e_sysctlovly = NULL, 991.53Schs .e_vm_default_addr = uvm_default_mapaddr, 1001.53Schs .e_usertrap = NULL, 1011.53Schs .e_ucsize = 0, 1021.53Schs .e_startlwp = NULL 1031.8Schristos}; 104