]> git.saurik.com Git - apple/xnu.git/blame - osfmk/kern/ipc_kobject.h
xnu-344.23.tar.gz
[apple/xnu.git] / osfmk / kern / ipc_kobject.h
CommitLineData
1c79356b
A
1/*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
de355530
A
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.
1c79356b 11 *
de355530
A
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
1c79356b
A
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
de355530
A
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.
1c79356b
A
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
76typedef 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
0b4e3aa0
A
88#define IKOT_MIG 10
89#define IKOT_MEMORY_OBJECT 11
1c79356b
A
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/* NOT DEFINED 16 */
95#define IKOT_HOST_SECURITY 17
96#define IKOT_LEDGER 18
97#define IKOT_MASTER_DEVICE 19
98#define IKOT_ACT 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
1c79356b
A
123/* Initialize kernel server dispatch table */
124extern void mig_init(void);
125
126/* Dispatch a kernel server function */
127extern ipc_kmsg_t ipc_kobject_server(
128 ipc_kmsg_t request);
129
130/* Make a port represent a kernel object of the given type */
131extern void ipc_kobject_set(
132 ipc_port_t port,
133 ipc_kobject_t kobject,
134 ipc_kobject_type_t type);
135
136extern void ipc_kobject_set_atomically(
137 ipc_port_t port,
138 ipc_kobject_t kobject,
139 ipc_kobject_type_t type);
140
141/* Release any kernel object resources associated with a port */
142extern void ipc_kobject_destroy(
143 ipc_port_t port);
144
145#define null_conversion(port) (port)
146
147#endif /* KERNEL_PRIVATE */
148
149#endif /* _KERN_IPC_KOBJECT_H_ */