1 /*
2 * Mach Operating System
3 * Copyright (c) 1993,1992,1991,1990,1989,1988,1987 Carnegie Mellon University
4 * All Rights Reserved.
5 *
6 * Permission to use, copy, modify and distribute this software and its
7 * documentation is hereby granted, provided that both the copyright
8 * notice and this permission notice appear in all copies of the
9 * software, derivative works or modified versions, and any portions
10 * thereof, and that both notices appear in supporting documentation.
11 *
12 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
13 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
14 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
15 *
16 * Carnegie Mellon requests users of this software to return to
17 *
18 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
19 * School of Computer Science
20 * Carnegie Mellon University
21 * Pittsburgh PA 15213-3890
22 *
23 * any improvements or extensions that they make and grant Carnegie Mellon
24 * the rights to redistribute these changes.
25 */
26 /*
27 * HISTORY
28 * $Log: syscall_emulation.h,v $
29 * Revision 2.10 93/11/17 17:25:50 dbg
30 * Added ANSI function prototypes. Removed user-visible
31 * definitions.
32 * [93/06/16 dbg]
33 *
34 * Revision 2.9 92/05/21 17:16:01 jfriedl
35 * Removed comment starter from within comments to shut up gcc warnings.
36 * [92/05/16 jfriedl]
37 *
38 * Revision 2.8 92/03/31 15:18:00 rpd
39 * Removed EML_OFFSET.
40 * [92/03/20 rpd]
41 *
42 * Revision 2.7 92/01/03 20:17:50 dbg
43 * Remove fixed lower bound. Fix type declaration for
44 * eml_routine_t. Remove syscall_val structure.
45 * [91/10/31 dbg]
46 *
47 * Revision 2.6 91/06/25 10:29:22 rpd
48 * Fixed includes to avoid circularities.
49 * [91/06/24 rpd]
50 *
51 * Revision 2.5 91/06/06 17:07:37 jsb
52 * Added emulation_vector_t for new get/set emulation vector calls.
53 * [91/05/24 17:47:38 jsb]
54 *
55 * Revision 2.4 91/05/14 16:47:16 mrt
56 * Correcting copyright
57 *
58 * Revision 2.3 91/02/05 17:29:30 mrt
59 * Changed to new Mach copyright
60 * [91/02/01 16:18:04 mrt]
61 *
62 * Revision 2.2 90/09/09 14:32:52 rpd
63 * Use decl_simple_lock_data.
64 * [90/08/30 rpd]
65 *
66 * Allow emulation of syscalls with negative numbers. Clobber MACH
67 * system calls at your own risk!
68 * [89/04/19 dbg]
69 *
70 * Revision 2.1 89/08/03 15:54:14 rwd
71 * Created.
72 *
73 * Revision 2.2 88/08/03 15:34:07 dorr
74 * Get rid of errno and eosys fields. Use return value and
75 * special return code of ERESTART to represent same information.
76 *
77 * 15-Jul-88 David Golub (dbg) at Carnegie-Mellon University
78 * Added lock for reference count.
79 *
80 * 26-Jan-88 Douglas Orr (dorr) at Carnegie-Mellon University
81 * Added maxsyscall variable and typedefs for user space emulation library
82 *
83 */
84
85 #ifndef _KERN_SYSCALL_EMULATION_H_
86 #define _KERN_SYSCALL_EMULATION_H_
87
88 #ifndef ASSEMBLER
89 #include <mach/kern_return.h>
90 #include <mach/machine/vm_types.h>
91 #include <kern/kern_types.h>
92 #include <kern/lock.h>
93
94 typedef vm_offset_t eml_routine_t;
95
96 typedef struct eml_dispatch {
97 decl_simple_lock_data(, lock) /* lock for reference count */
98 int ref_count; /* reference count */
99 int disp_count; /* count of entries in vector */
100 int disp_min; /* index of lowest entry in vector */
101 eml_routine_t disp_vector[1]; /* first entry in array of dispatch */
102 /* routines (array has disp_count */
103 /* elements) */
104 } *eml_dispatch_t;
105
106 typedef vm_offset_t *emulation_vector_t; /* Variable-length array */
107
108 #define EML_ROUTINE_NULL (eml_routine_t)0
109 #define EML_DISPATCH_NULL (eml_dispatch_t)0
110
111 extern void eml_init(void);
112 extern void eml_task_reference(task_t task, task_t parent);
113 extern void eml_task_deallocate(task_t);
114
115 extern kern_return_t task_set_emulation_vector(
116 task_t task,
117 int vector_start,
118 emulation_vector_t emulation_vector,
119 natural_t count);
120
121 extern kern_return_t task_get_emulation_vector(
122 task_t task,
123 int *vector_start,
124 emulation_vector_t *emulation_vector,
125 natural_t *count);
126
127 #endif /* ASSEMBLER */
128
129 #endif /* _KERN_SYSCALL_EMULATION_H_ */
Cache object: 18c3b977372ffc07a254649f33ba2a1f
|