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