]> git.saurik.com Git - apple/xnu.git/blob - osfmk/kern/ipc_kobject.h
xnu-517.tar.gz
[apple/xnu.git] / osfmk / kern / ipc_kobject.h
1 /*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
7 *
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * file.
14 *
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
22 *
23 * @APPLE_LICENSE_HEADER_END@
24 */
25 /*
26 * @OSF_COPYRIGHT@
27 */
28 /*
29 * Mach Operating System
30 * Copyright (c) 1991,1990,1989 Carnegie Mellon University
31 * All Rights Reserved.
32 *
33 * Permission to use, copy, modify and distribute this software and its
34 * documentation is hereby granted, provided that both the copyright
35 * notice and this permission notice appear in all copies of the
36 * software, derivative works or modified versions, and any portions
37 * thereof, and that both notices appear in supporting documentation.
38 *
39 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
40 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
41 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
42 *
43 * Carnegie Mellon requests users of this software to return to
44 *
45 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
46 * School of Computer Science
47 * Carnegie Mellon University
48 * Pittsburgh PA 15213-3890
49 *
50 * any improvements or extensions that they make and grant Carnegie Mellon
51 * the rights to redistribute these changes.
52 */
53 /*
54 */
55 /*
56 * File: kern/ipc_kobject.h
57 * Author: Rich Draves
58 * Date: 1989
59 *
60 * Declarations for letting a port represent a kernel object.
61 */
62
63 #include <ipc/ipc_kmsg.h>
64 #include <ipc/ipc_port.h>
65
66 #ifndef _KERN_IPC_KOBJECT_H_
67 #define _KERN_IPC_KOBJECT_H_
68
69 #ifdef KERNEL_PRIVATE
70 /*
71 * This is the legacy in-kernel ipc-object mechanism. Over the next
72 * several months, this will be phased out in favor of a mechanism that
73 * is less Mach IPC specific, and common across in-mach, in-kernel-component,
74 * and user-level-component (Plugin) models.
75 */
76 #include <mach/machine/vm_types.h>
77 #include <mach/mach_types.h>
78
79 typedef natural_t ipc_kobject_type_t;
80
81 #define IKOT_NONE 0
82 #define IKOT_THREAD 1
83 #define IKOT_TASK 2
84 #define IKOT_HOST 3
85 #define IKOT_HOST_PRIV 4
86 #define IKOT_PROCESSOR 5
87 #define IKOT_PSET 6
88 #define IKOT_PSET_NAME 7
89 #define IKOT_TIMER 8
90 #define IKOT_PAGING_REQUEST 9
91 #define IKOT_MIG 10
92 #define IKOT_MEMORY_OBJECT 11
93 #define IKOT_XMM_PAGER 12
94 #define IKOT_XMM_KERNEL 13
95 #define IKOT_XMM_REPLY 14
96 #define IKOT_UND_REPLY 15
97 #define IKOT_HOST_NOTIFY 16
98 #define IKOT_HOST_SECURITY 17
99 #define IKOT_LEDGER 18
100 #define IKOT_MASTER_DEVICE 19
101 #define IKOT_ACT 20
102 #define IKOT_SUBSYSTEM 21
103 #define IKOT_IO_DONE_QUEUE 22
104 #define IKOT_SEMAPHORE 23
105 #define IKOT_LOCK_SET 24
106 #define IKOT_CLOCK 25
107 #define IKOT_CLOCK_CTRL 26
108 #define IKOT_IOKIT_SPARE 27
109 #define IKOT_NAMED_ENTRY 28
110 #define IKOT_IOKIT_CONNECT 29
111 #define IKOT_IOKIT_OBJECT 30
112 #define IKOT_UPL 31
113 /* << new entries here */
114 #define IKOT_UNKNOWN 32 /* magic catchall */
115 #define IKOT_MAX_TYPE 33 /* # of IKOT_ types */
116
117 /* Please keep ipc/ipc_object.c:ikot_print_array up to date */
118
119 #define is_ipc_kobject(ikot) ((ikot) != IKOT_NONE)
120
121 /*
122 * Define types of kernel objects that use page lists instead
123 * of entry lists for copyin of out of line memory.
124 */
125
126 /* Initialize kernel server dispatch table */
127 extern void mig_init(void);
128
129 /* Dispatch a kernel server function */
130 extern ipc_kmsg_t ipc_kobject_server(
131 ipc_kmsg_t request);
132
133 /* Make a port represent a kernel object of the given type */
134 extern void ipc_kobject_set(
135 ipc_port_t port,
136 ipc_kobject_t kobject,
137 ipc_kobject_type_t type);
138
139 extern void ipc_kobject_set_atomically(
140 ipc_port_t port,
141 ipc_kobject_t kobject,
142 ipc_kobject_type_t type);
143
144 /* Release any kernel object resources associated with a port */
145 extern void ipc_kobject_destroy(
146 ipc_port_t port);
147
148 #define null_conversion(port) (port)
149
150 #endif /* KERNEL_PRIVATE */
151
152 #endif /* _KERN_IPC_KOBJECT_H_ */