No empty .Rs/.Re
[netbsd-mini2440.git] / sys / compat / pecoff / pecoff_emul.c
blob074dc9f841833db8b72b5e2a90d0b1334a5abd69
1 /* $NetBSD: pecoff_emul.c,v 1.22 2008/11/19 18:36:05 ad Exp $ */
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.
10 * from compat/ibcs2/ibcs2_exec.c
11 * originally from kern/exec_ecoff.c
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
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.
39 #include <sys/cdefs.h>
40 __KERNEL_RCSID(0, "$NetBSD: pecoff_emul.c,v 1.22 2008/11/19 18:36:05 ad Exp $");
42 /*#define DEBUG_PECOFF*/
44 #ifdef _KERNEL_OPT
45 #include "opt_syscall_debug.h"
46 #endif
48 #include <sys/param.h>
49 #include <sys/proc.h>
50 #include <sys/malloc.h>
51 #include <sys/namei.h>
52 #include <sys/vnode.h>
53 #include <sys/mount.h>
54 #include <sys/exec.h>
55 #include <sys/syscall.h>
56 #include <sys/syscallvar.h>
57 #include <sys/signalvar.h>
58 #include <sys/resourcevar.h>
59 #include <sys/stat.h>
61 #include <uvm/uvm_extern.h>
63 #include <sys/exec_coff.h>
64 #include <machine/coff_machdep.h>
66 #include <compat/pecoff/pecoff_exec.h>
67 #include <compat/pecoff/pecoff_util.h>
69 extern struct sysent pecoff_sysent[];
71 #ifdef COMPAT_16
72 extern char sigcode[], esigcode[];
73 struct uvm_object *emul_pecoff_object;
74 #endif
76 #ifndef __HAVE_SYSCALL_INTERN
77 void syscall(void);
78 #endif
80 struct emul emul_pecoff = {
81 "pecoff",
82 "/emul/pecoff",
83 #ifndef __HAVE_MINIMAL_EMUL
84 EMUL_HAS_SYS___syscall,
86 SYS_syscall,
87 SYS_NSYSENT,
88 #endif
89 sysent,
90 #ifdef SYSCALL_DEBUG
91 syscallnames,
92 #else
93 NULL,
94 #endif
95 sendsig,
96 trapsignal,
97 NULL,
98 #ifdef COMPAT_16
99 sigcode,
100 esigcode,
101 &emul_pecoff_object,
102 #else
103 NULL,
104 NULL,
105 NULL,
106 #endif
107 setregs,
108 NULL,
109 NULL,
110 NULL,
111 NULL,
112 NULL,
113 #ifdef __HAVE_SYSCALL_INTERN
114 syscall_intern,
115 #else
116 syscall,
117 #endif
118 NULL,
119 NULL,
121 uvm_default_mapaddr,
122 NULL,
123 NULL,
124 sizeof(ucontext_t),
125 NULL,