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