The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/compat/pecoff/pecoff_emul.c

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*      $NetBSD: pecoff_emul.c,v 1.16 2006/06/20 14:11:56 oki Exp $     */
    2 
    3 /*
    4  * Copyright (c) 2000 Masaru OKI
    5  * Copyright (c) 1994, 1995, 1998 Scott Bartram
    6  * Copyright (c) 1994 Adam Glass
    7  * Copyright (c) 1993, 1994 Christopher G. Demetriou
    8  * All rights reserved.
    9  *
   10  * from compat/ibcs2/ibcs2_exec.c
   11  * originally from kern/exec_ecoff.c
   12  *
   13  * Redistribution and use in source and binary forms, with or without
   14  * modification, are permitted provided that the following conditions
   15  * are met:
   16  * 1. Redistributions of source code must retain the above copyright
   17  *    notice, this list of conditions and the following disclaimer.
   18  * 2. Redistributions in binary form must reproduce the above copyright
   19  *    notice, this list of conditions and the following disclaimer in the
   20  *    documentation and/or other materials provided with the distribution.
   21  * 3. All advertising materials mentioning features or use of this software
   22  *    must display the following acknowledgement:
   23  *      This product includes software developed by Scott Bartram.
   24  * 4. The name of the author may not be used to endorse or promote products
   25  *    derived from this software without specific prior written permission
   26  *
   27  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
   28  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   29  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
   30  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
   31  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
   32  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
   33  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
   34  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   35  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
   36  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   37  */
   38 
   39 #include <sys/cdefs.h>
   40 __KERNEL_RCSID(0, "$NetBSD: pecoff_emul.c,v 1.16 2006/06/20 14:11:56 oki Exp $");
   41 
   42 /*#define DEBUG_PECOFF*/
   43 
   44 #ifdef _KERNEL_OPT
   45 #include "opt_syscall_debug.h"
   46 #endif
   47 
   48 #include <sys/param.h>
   49 #include <sys/proc.h>
   50 #include <sys/sa.h>
   51 #include <sys/savar.h>
   52 #include <sys/malloc.h>
   53 #include <sys/namei.h>
   54 #include <sys/vnode.h>
   55 #include <sys/mount.h>
   56 #include <sys/exec.h>
   57 #include <sys/syscall.h>
   58 #include <sys/signalvar.h>
   59 #include <sys/resourcevar.h>
   60 #include <sys/stat.h>
   61 
   62 #include <uvm/uvm_extern.h>
   63 
   64 #include <sys/exec_coff.h>
   65 #include <machine/coff_machdep.h>
   66 
   67 #include <compat/pecoff/pecoff_exec.h>
   68 #include <compat/pecoff/pecoff_util.h>
   69 #include <compat/pecoff/pecoff_syscall.h>
   70 
   71 extern struct sysent pecoff_sysent[];
   72 #ifdef SYSCALL_DEBUG
   73 extern const char * const pecoff_syscallnames[];
   74 #endif
   75 
   76 #ifdef COMPAT_16
   77 extern char sigcode[], esigcode[];
   78 struct uvm_object *emul_pecoff_object;
   79 #endif
   80 
   81 #ifndef __HAVE_SYSCALL_INTERN
   82 void    syscall(void);
   83 #endif
   84 
   85 const struct sa_emul saemul_pecoff = {
   86         sizeof(ucontext_t),
   87         sizeof(struct sa_t),
   88         sizeof(struct sa_t *),
   89         NULL,
   90         NULL,
   91         cpu_upcall,
   92         (void (*)(struct lwp *, void *))getucontext,
   93         sa_ucsp
   94 };
   95 
   96 const struct emul emul_pecoff = {
   97         "pecoff",
   98         "/emul/pecoff",
   99 #ifndef __HAVE_MINIMAL_EMUL
  100         EMUL_HAS_SYS___syscall,
  101         0,
  102         PECOFF_SYS_syscall,
  103         PECOFF_SYS_NSYSENT,
  104 #endif
  105         pecoff_sysent,
  106 #ifdef SYSCALL_DEBUG
  107         pecoff_syscallnames,
  108 #else
  109         NULL,
  110 #endif
  111         sendsig,
  112         trapsignal,
  113         NULL,
  114 #ifdef COMPAT_16
  115         sigcode,
  116         esigcode,
  117         &emul_pecoff_object,
  118 #else
  119         NULL,
  120         NULL,
  121         NULL,
  122 #endif
  123         setregs,
  124         NULL,
  125         NULL,
  126         NULL,
  127         NULL,
  128         NULL,
  129 #ifdef __HAVE_SYSCALL_INTERN
  130         syscall_intern,
  131 #else
  132         syscall,
  133 #endif
  134         NULL,
  135         NULL,
  136 
  137         uvm_default_mapaddr,
  138         NULL,
  139         &saemul_pecoff,
  140 };

Cache object: 3ae1b38b6e0fafbe30a9eea2fbbb3dcf


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.