1 /* $NetBSD: mach_exec.h,v 1.30 2005/12/11 12:20:20 christos Exp $ */
2
3 /*-
4 * Copyright (c) 2001 The NetBSD Foundation, Inc.
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Christos Zoulas.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. All advertising materials mentioning features or use of this software
19 * must display the following acknowledgement:
20 * This product includes software developed by the NetBSD
21 * Foundation, Inc. and its contributors.
22 * 4. Neither the name of The NetBSD Foundation nor the names of its
23 * contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 * POSSIBILITY OF SUCH DAMAGE.
37 */
38
39 #ifndef _MACH_EXEC_H_
40 #define _MACH_EXEC_H_
41
42 #include <uvm/uvm_extern.h>
43
44 #include <compat/mach/mach_types.h>
45 #include <compat/mach/mach_message.h>
46 #include <compat/mach/mach_port.h>
47 #include <compat/mach/mach_exception.h>
48
49
50 struct mach_emuldata {
51 int med_inited; /* Is this structure initialized? */
52 int med_thpri; /* Saved priority */
53 LIST_HEAD(med_right, mach_right) med_right;
54 struct lock med_rightlock; /* process right list and lock */
55 mach_port_t med_nextright; /* next unused right */
56
57 struct mach_port *med_bootstrap;/* task bootstrap port */
58 struct mach_port *med_kernel; /* task kernel port */
59 struct mach_port *med_host; /* task host port */
60 struct mach_port *med_exc[MACH_EXC_MAX + 1]; /* Exception ports */
61
62 int med_dirty_thid; /* Thread id not yet initialized */
63 int med_suspend; /* Suspend semaphore */
64 struct lock med_exclock; /* Process exception handler lock */
65 };
66
67 struct mach_lwp_emuldata {
68 struct mach_port *mle_kernel; /* Thread's kernel port */
69 };
70
71 int exec_mach_copyargs(struct lwp *, struct exec_package *,
72 struct ps_strings *, char **, void *);
73 int exec_mach_probe(const char **);
74 void mach_e_proc_init(struct proc *, struct vmspace *);
75 void mach_e_proc_exit(struct proc *);
76 void mach_e_proc_exec(struct proc *, struct exec_package *);
77 void mach_e_proc_fork(struct proc *, struct proc *, int);
78 void mach_e_proc_fork1(struct proc *, struct proc *, int);
79 void mach_e_lwp_fork(struct lwp *, struct lwp *);
80 void mach_e_lwp_exit(struct lwp *);
81
82 extern const struct emul emul_mach;
83
84 #endif /* !_MACH_EXEC_H_ */
Cache object: 01a9c3d13e040ff43f53c96d0b86d324
|