Loading...
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 | /* * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. * * @APPLE_LICENSE_HEADER_START@ * * The contents of this file constitute Original Code as defined in and * are subject to the Apple Public Source License Version 1.1 (the * "License"). You may not use this file except in compliance with the * License. Please obtain a copy of the License at * http://www.apple.com/publicsource and read it before using this file. * * This Original Code and all software distributed under the License are * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the * License for the specific language governing rights and limitations * under the License. * * @APPLE_LICENSE_HEADER_END@ */ /* * @OSF_FREE_COPYRIGHT@ */ /* * Mach Operating System * Copyright (c) 1991,1990,1989 Carnegie Mellon University * All Rights Reserved. * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. * * Carnegie Mellon requests users of this software to return to * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 * * any improvements or extensions that they make and grant Carnegie Mellon * the rights to redistribute these changes. */ /* */ /* * File: mach/mach_port.defs * Author: Rich Draves * * Exported kernel calls. */ subsystem #if KERNEL_SERVER KernelServer #endif /* KERNEL_SERVER */ thread_act 3600; #include <mach/std_types.defs> #include <mach/mach_types.defs> /* * Destroy the target thread. * * JMM - For legacy reasons this consumes a reference to the * target thread. This will have to change in the future because * we want the interfaces to be able to be defined in more standard * IDLs and transports, and most of them do not support the notion * of reference ownership transfers (just sharing). */ routine thread_terminate( target_act : thread_act_consume_ref_t); /* * Return the selected state information for the target * thr_act. If the thr_act is currently executing, the results * may be stale. [Flavor THREAD_STATE_FLAVOR_LIST provides a * list of valid flavors for the target thread.] */ routine act_get_state( target_act : thread_act_t; flavor : int; out old_state : thread_state_t, CountInOut); /* * Set the selected state information for the target thread. * If the thread is currently executing, the state change * may be ill-defined. */ routine act_set_state( target_act : thread_act_t; flavor : int; new_state : thread_state_t); /* * Backward compatible old-style thread routines. * These have different semantics than the new activation versions. * * Return the selected state information for the target * thread. If the thread is currently executing, the results * may be stale. [Flavor THREAD_STATE_FLAVOR_LIST provides a * list of valid flavors for the target thr_act.] */ routine thread_get_state( target_act : thread_act_t; flavor : thread_state_flavor_t; out old_state : thread_state_t, CountInOut); /* * Set the selected state information for the target thread. * If the thread is currently executing, the state change * may be ill-defined. */ routine thread_set_state( target_act : thread_act_t; flavor : thread_state_flavor_t; new_state : thread_state_t); /* * Increment the suspend count for the target thread. * Once this call has completed, the thread will not * execute any further user or meta- instructions. * Once suspended, a thread may not execute again until * its suspend count is zero, and the suspend count * for its task is also zero. */ routine thread_suspend( target_act : thread_act_t); /* * Decrement the suspend count for the target thread, * if that count is not already zero. */ routine thread_resume( target_act : thread_act_t); /* * Cause any user or meta- instructions currently being * executed by the target thread to be aborted. [Meta- * instructions consist of the basic traps for IPC * (e.g., msg_send, msg_receive) and self-identification * (e.g., task_self, thread_self, thread_reply). Calls * described by MiG interfaces are not meta-instructions * themselves.] */ routine thread_abort( target_act : thread_act_t); /* * Cause any user or meta- instructions currently being * executed by the target thread to be aborted so that * they are transparently restartable. This call fails * if the abort would result in a non-restartable condition. * Retry is the caller's responsibility. [Meta- * instructions consist of the basic traps for IPC * (e.g., msg_send, msg_receive) and self-identification * (e.g., task_self, thread_self, thread_reply). Calls * described by MiG interfaces are not meta-instructions * themselves.] */ routine thread_abort_safely( target_act : thread_act_t); routine thread_depress_abort( thread : thread_act_t); /* * Returns the current value of the selected special port * associated with the target thread. */ routine thread_get_special_port( thr_act : thread_act_t; which_port : int; out special_port : mach_port_t); /* * Set one of the special ports associated with the * target thread. */ routine thread_set_special_port( thr_act : thread_act_t; which_port : int; special_port : mach_port_t); /* * Returns information about the target thread. */ routine thread_info( target_act : thread_act_t; flavor : thread_flavor_t; out thread_info_out : thread_info_t, CountInOut); /* * Set an exception handler for a thread on one or more exception types */ routine thread_set_exception_ports( thread : thread_act_t; exception_mask : exception_mask_t; new_port : mach_port_t; behavior : exception_behavior_t; new_flavor : thread_state_flavor_t); /* * Lookup some of the old exception handlers for a thread */ routine thread_get_exception_ports( thread : thread_act_t; exception_mask : exception_mask_t; out masks : exception_mask_array_t; out old_handlers : exception_handler_array_t, SameCount; out old_behaviors : exception_behavior_array_t, SameCount; out old_flavors : exception_flavor_array_t, SameCount); /* * Set an exception handler for a thread on one or more exception types. * At the same time, return the previously defined exception handlers for * those types. */ routine thread_swap_exception_ports( thread : thread_act_t; exception_mask : exception_mask_t; new_port : mach_port_t; behavior : exception_behavior_t; new_flavor : thread_state_flavor_t; out masks : exception_mask_array_t; out old_handlers : exception_handler_array_t, SameCount; out old_behaviors : exception_behavior_array_t, SameCount; out old_flavors : exception_flavor_array_t, SameCount); /* * OBSOLETE interface. */ routine thread_policy( thr_act : thread_act_t; policy : policy_t; base : policy_base_t; set_limit : boolean_t); /* * Set/get policy information for a thread. * (Approved Mac OS X microkernel interface) */ routine thread_policy_set( thread : thread_act_t; flavor : thread_policy_flavor_t; policy_info : thread_policy_t); routine thread_policy_get( thread : thread_act_t; flavor : thread_policy_flavor_t; out policy_info : thread_policy_t, CountInOut; inout get_default : boolean_t); /* * Thread profiling * This call is only valid for MACH_PROF compiled kernels. * Otherwise, KERN_FAILURE is returned. */ routine thread_sample( thread : thread_act_t; reply : mach_port_make_send_t); /* * ETAP has been removed from the kernel. */ #if KERNEL_SERVER skip; #else routine etap_trace_thread( target_act : thread_act_t; trace_status : boolean_t); #endif /* * Assign thread to processor set. */ routine thread_assign( thread : thread_act_t; new_set : processor_set_t); /* * Assign thread to default set. */ routine thread_assign_default( thread : thread_act_t); /* * Get current assignment for thread. */ routine thread_get_assignment( thread : thread_act_t; out assigned_set : processor_set_name_t); /* * OBSOLETE interface. */ routine thread_set_policy( thr_act : thread_act_t; pset : processor_set_t; policy : policy_t; base : policy_base_t; limit : policy_limit_t); |