2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
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.
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
20 * @APPLE_LICENSE_HEADER_END@
26 * Mach Operating System
27 * Copyright (c) 1991,1990,1989 Carnegie Mellon University
28 * All Rights Reserved.
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.
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.
40 * Carnegie Mellon requests users of this software to return to
42 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
43 * School of Computer Science
44 * Carnegie Mellon University
45 * Pittsburgh PA 15213-3890
47 * any improvements or extensions that they make and grant Carnegie Mellon
48 * the rights to redistribute these changes.
53 * File: kern/ipc_kobject.h
57 * Declarations for letting a port represent a kernel object.
60 #include <ipc/ipc_kmsg.h>
61 #include <ipc/ipc_port.h>
63 #ifndef _KERN_IPC_KOBJECT_H_
64 #define _KERN_IPC_KOBJECT_H_
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.
73 #include <mach/machine/vm_types.h>
74 #include <mach/mach_types.h>
76 typedef natural_t ipc_kobject_type_t
;
82 #define IKOT_HOST_PRIV 4
83 #define IKOT_PROCESSOR 5
85 #define IKOT_PSET_NAME 7
87 #define IKOT_PAGING_REQUEST 9
88 #define IKOT_DEVICE 10
89 #define IKOT_XMM_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
95 #define IKOT_HOST_SECURITY 17
96 #define IKOT_LEDGER 18
97 #define IKOT_MASTER_DEVICE 19
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
110 /* << new entries here */
111 #define IKOT_UNKNOWN 32 /* magic catchall */
112 #define IKOT_MAX_TYPE 33 /* # of IKOT_ types */
114 /* Please keep ipc/ipc_object.c:ikot_print_array up to date */
116 #define is_ipc_kobject(ikot) ((ikot) != IKOT_NONE)
119 * Define types of kernel objects that use page lists instead
120 * of entry lists for copyin of out of line memory.
123 #define ipc_kobject_vm_page_list(ikot) \
124 ((ikot) == IKOT_PAGING_REQUEST || (ikot) == IKOT_DEVICE)
126 #define ipc_kobject_vm_page_steal(ikot) ((ikot) == IKOT_PAGING_REQUEST)
128 /* Initialize kernel server dispatch table */
129 extern void mig_init(void);
131 /* Dispatch a kernel server function */
132 extern ipc_kmsg_t
ipc_kobject_server(
135 /* Make a port represent a kernel object of the given type */
136 extern void ipc_kobject_set(
138 ipc_kobject_t kobject
,
139 ipc_kobject_type_t type
);
141 extern void ipc_kobject_set_atomically(
143 ipc_kobject_t kobject
,
144 ipc_kobject_type_t type
);
146 /* Release any kernel object resources associated with a port */
147 extern void ipc_kobject_destroy(
150 #define null_conversion(port) (port)
152 #endif /* KERNEL_PRIVATE */
154 #endif /* _KERN_IPC_KOBJECT_H_ */