]>
git.saurik.com Git - apple/xnu.git/blob - osfmk/mach/host_special_ports.h
2 * Copyright (c) 2003 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 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: mach/host_special_ports.h
55 * Defines codes for access to host-wide special ports.
58 #ifndef _MACH_HOST_SPECIAL_PORTS_H_
59 #define _MACH_HOST_SPECIAL_PORTS_H_
62 * Cannot be set or gotten from user space
64 #define HOST_SECURITY_PORT 0
67 * Always provided by kernel (cannot be set from user-space).
70 #define HOST_PRIV_PORT 2
71 #define HOST_IO_MASTER_PORT 3
72 #define HOST_MAX_SPECIAL_KERNEL_PORT 7 /* room to grow */
75 * Not provided by kernel
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 */
84 * Special node identifier to always represent the local node.
86 #define HOST_LOCAL_NODE -1
89 * Definitions for ease of use.
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.
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)
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)
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)
111 * User-settable special ports.
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)))
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)))
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)))
131 #endif /* _MACH_HOST_SPECIAL_PORTS_H_ */