]> git.saurik.com Git - apple/xnu.git/blame - osfmk/mach/host_special_ports.h
xnu-792.10.96.tar.gz
[apple/xnu.git] / osfmk / mach / host_special_ports.h
CommitLineData
55e303ae
A
1/*
2 * Copyright (c) 2003 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
37839358
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.
55e303ae 11 *
37839358
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
55e303ae
A
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
37839358
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.
55e303ae
A
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
22/*
23 * @OSF_COPYRIGHT@
24 */
25/*
26 * Mach Operating System
27 * Copyright (c) 1991 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: mach/host_special_ports.h
54 *
55 * Defines codes for access to host-wide special ports.
56 */
57
58#ifndef _MACH_HOST_SPECIAL_PORTS_H_
59#define _MACH_HOST_SPECIAL_PORTS_H_
60
61/*
62 * Cannot be set or gotten from user space
63 */
64#define HOST_SECURITY_PORT 0
65
66/*
67 * Always provided by kernel (cannot be set from user-space).
68 */
69#define HOST_PORT 1
70#define HOST_PRIV_PORT 2
71#define HOST_IO_MASTER_PORT 3
72#define HOST_MAX_SPECIAL_KERNEL_PORT 7 /* room to grow */
73
74/*
75 * Not provided by kernel
76 */
77#define HOST_DYNAMIC_PAGER_PORT (1 + HOST_MAX_SPECIAL_KERNEL_PORT)
78#define HOST_AUDIT_CONTROL_PORT (2 + HOST_MAX_SPECIAL_KERNEL_PORT)
79#define HOST_USER_NOTIFICATION_PORT (3 + HOST_MAX_SPECIAL_KERNEL_PORT)
80#define HOST_MAX_SPECIAL_PORT (8 + HOST_MAX_SPECIAL_KERNEL_PORT)
81 /* room to grow here as well */
82
83/*
84 * Special node identifier to always represent the local node.
85 */
86#define HOST_LOCAL_NODE -1
87
88/*
89 * Definitions for ease of use.
90 *
91 * In the get call, the host parameter can be any host, but will generally
92 * be the local node host port. In the set call, the host must the per-node
93 * host port for the node being affected.
94 */
95#define host_get_host_port(host, port) \
96 (host_get_special_port((host), \
97 HOST_LOCAL_NODE, HOST_PORT, (port)))
98#define host_set_host_port(host, port) (KERN_INVALID_ARGUMENT)
99
100#define host_get_host_priv_port(host, port) \
101 (host_get_special_port((host), \
102 HOST_LOCAL_NODE, HOST_PRIV_PORT, (port)))
103#define host_set_host_priv_port(host, port) (KERN_INVALID_ARGUMENT)
104
105#define host_get_io_master_port(host, port) \
106 (host_get_special_port((host), \
107 HOST_LOCAL_NODE, HOST_IO_MASTER_PORT, (port)))
108#define host_set_io_master_port(host, port) (KERN_INVALID_ARGUMENT)
109
110/*
111 * User-settable special ports.
112 */
113#define host_get_dynamic_pager_port(host, port) \
114 (host_get_special_port((host), \
115 HOST_LOCAL_NODE, HOST_DYNAMIC_PAGER_PORT, (port)))
116#define host_set_dynamic_pager_port(host, port) \
117 (host_set_special_port((host), HOST_DYNAMIC_PAGER_PORT, (port)))
118
119#define host_get_audit_control_port(host, port) \
120 (host_get_special_port((host), \
121 HOST_LOCAL_NODE, HOST_AUDIT_CONTROL_PORT, (port)))
122#define host_set_audit_control_port(host, port) \
123 (host_set_special_port((host), HOST_AUDIT_CONTROL_PORT, (port)))
124
125#define host_get_user_notification_port(host, port) \
126 (host_get_special_port((host), \
127 HOST_LOCAL_NODE, HOST_USER_NOTIFICATION_PORT, (port)))
128#define host_set_user_notification_port(host, port) \
129 (host_set_special_port((host), HOST_USER_NOTIFICATION_PORT, (port)))
130
55e303ae 131#endif /* _MACH_HOST_SPECIAL_PORTS_H_ */