sunos32_exec.c revision 1.28
11.28Sdsl/* $NetBSD: sunos32_exec.c,v 1.28 2007/03/16 22:21:42 dsl Exp $ */ 21.1Smrg 31.1Smrg/* 41.1Smrg * Copyright (c) 2001 Matthew R. Green 51.1Smrg * All rights reserved. 61.1Smrg * 71.1Smrg * Redistribution and use in source and binary forms, with or without 81.1Smrg * modification, are permitted provided that the following conditions 91.1Smrg * are met: 101.1Smrg * 1. Redistributions of source code must retain the above copyright 111.1Smrg * notice, this list of conditions and the following disclaimer. 121.1Smrg * 2. Redistributions in binary form must reproduce the above copyright 131.1Smrg * notice, this list of conditions and the following disclaimer in the 141.1Smrg * documentation and/or other materials provided with the distribution. 151.1Smrg * 3. The name of the author may not be used to endorse or promote products 161.1Smrg * derived from this software without specific prior written permission. 171.1Smrg * 181.1Smrg * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 191.1Smrg * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 201.1Smrg * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 211.1Smrg * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 221.1Smrg * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 231.1Smrg * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 241.1Smrg * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 251.1Smrg * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 261.1Smrg * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 271.1Smrg * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 281.1Smrg * SUCH DAMAGE. 291.1Smrg */ 301.10Slukem 311.10Slukem#include <sys/cdefs.h> 321.28Sdsl__KERNEL_RCSID(0, "$NetBSD: sunos32_exec.c,v 1.28 2007/03/16 22:21:42 dsl Exp $"); 331.1Smrg 341.5Smrg#if defined(_KERNEL_OPT) 351.1Smrg#include "opt_syscall_debug.h" 361.1Smrg#endif 371.1Smrg 381.1Smrg#include <sys/param.h> 391.1Smrg#include <sys/proc.h> 401.1Smrg#include <sys/mount.h> 411.1Smrg 421.20Sfvdl#include <uvm/uvm_extern.h> 431.20Sfvdl 441.28Sdsl#include <compat/netbsd32/netbsd32.h> 451.28Sdsl#include <compat/netbsd32/netbsd32_syscallargs.h> 461.1Smrg#include <compat/sunos32/sunos32.h> 471.1Smrg#include <compat/sunos32/sunos32_syscall.h> 481.9Sthorpej#include <compat/sunos32/sunos32_exec.h> 491.1Smrg 501.23Schristos#include <machine/sunos_machdep.h> 511.23Schristos 521.1Smrgextern int nsunos32_sysent; 531.1Smrgextern struct sysent sunos32_sysent[]; 541.1Smrg#ifdef SYSCALL_DEBUG 551.1Smrgextern const char * const sunos32_syscallnames[]; 561.1Smrg#endif 571.1Smrgextern char sunos_sigcode[], sunos_esigcode[]; 581.1Smrg 591.22Schristos#ifndef __HAVE_SYSCALL_INTERN 601.22Schristosvoid syscall(void); 611.22Schristos#endif 621.22Schristos 631.15Schsstruct uvm_object *emul_sunos32_object; 641.15Schs 651.11Sthorpejconst struct emul emul_sunos = { 661.1Smrg "sunos32", 671.1Smrg "/emul/sunos", 681.14Sjdolecek#ifndef __HAVE_MINIMAL_EMUL 691.6Smanu 0, 701.1Smrg NULL, 711.1Smrg SUNOS32_SYS_syscall, 721.13Sjdolecek SUNOS32_SYS_NSYSENT, 731.14Sjdolecek#endif 741.1Smrg sunos32_sysent, 751.1Smrg#ifdef SYSCALL_DEBUG 761.1Smrg sunos32_syscallnames, 771.1Smrg#else 781.1Smrg NULL, 791.1Smrg#endif 801.2Smrg sunos32_sendsig, 811.7Schristos trapsignal, 821.19Sfvdl NULL, 831.1Smrg sunos_sigcode, 841.1Smrg sunos_esigcode, 851.15Schs &emul_sunos32_object, 861.9Sthorpej sunos32_setregs, 871.1Smrg NULL, 881.1Smrg NULL, 891.1Smrg NULL, 901.18Smanu NULL, 911.18Smanu NULL, 921.21Schristos#ifdef __HAVE_SYSCALL_INTERN 931.23Schristos sunos_syscall_intern, 941.21Schristos#else 951.12Smanu syscall, 961.21Schristos#endif 971.12Smanu NULL, 981.12Smanu NULL, 991.20Sfvdl uvm_default_mapaddr, 1001.25Smartin NULL, 1011.27Scube 0, 1021.27Scube NULL, 1031.1Smrg}; 104