FreeBSD/Linux Kernel Cross Reference
sys/mach/mach.defs
1 /*
2 * Mach Operating System
3 * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University
4 * All Rights Reserved.
5 *
6 * Permission to use, copy, modify and distribute this software and its
7 * documentation is hereby granted, provided that both the copyright
8 * notice and this permission notice appear in all copies of the
9 * software, derivative works or modified versions, and any portions
10 * thereof, and that both notices appear in supporting documentation.
11 *
12 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
13 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
14 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
15 *
16 * Carnegie Mellon requests users of this software to return to
17 *
18 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
19 * School of Computer Science
20 * Carnegie Mellon University
21 * Pittsburgh PA 15213-3890
22 *
23 * any improvements or extensions that they make and grant Carnegie Mellon
24 * the rights to redistribute these changes.
25 */
26 /*
27 * HISTORY
28 * $Log: mach.defs,v $
29 * Revision 2.15 93/01/21 12:23:14 danner
30 * New interface for task_ras_control.
31 * [93/01/19 16:35:06 bershad]
32 *
33 * Revision 2.14 92/07/20 13:33:09 cmaeda
34 * Added definition for task_set_ras_pc.
35 * Uses message number recycled from old task_get_io_port.
36 * [92/05/11 14:37:53 cmaeda]
37 *
38 * Revision 2.13 92/01/15 13:45:00 rpd
39 * Changed MACH_IPC_COMPAT conditionals to default to not present.
40 *
41 * Revision 2.12 92/01/14 16:45:18 rpd
42 * Changed mach_port_array_t usages to remain compatible,
43 * because the definition of the type changed incompatibly.
44 * [92/01/13 rpd]
45 * Updated vm_region for new memory_object_name_t definition.
46 * [91/12/31 rpd]
47 *
48 * Revision 2.11 92/01/03 20:20:53 dbg
49 * Changed (new) task_get_emulation_vector,
50 * task_set_emulation_vector to pass data out-of-line. Old
51 * routines still pass data in-line, for compatibility.
52 * [92/01/03 dbg]
53 *
54 * Add 'CountInOut' tag to routines returning variable-length
55 * inline arrays. Remove 'IsLong' tag from routines passing or
56 * returning variable-length arrays. Old routines left under
57 * 'xxx_' names. REMOVE THESE SOON!
58 *
59 * I used the message IDs from the Mach 1.5 thread calls (before
60 * the real thread support went in) - they haven't been used since
61 * 1988.
62 * [91/11/26 dbg]
63 *
64 * Revision 2.10 91/08/28 11:15:04 jsb
65 * Precious page support: Add new version of memory_object_lock_request.
66 * Add memory_object_{ready,change_attributes}.
67 * [91/07/03 14:03:34 dlb]
68 * Added KERNEL_USER definitions (for NORMA support).
69 * [91/08/15 09:58:13 jsb]
70 *
71 * Revision 2.9 91/07/31 17:53:17 dbg
72 * Added user-settable 'dealloc' flag to data argument of
73 * memory_object_data_supply. Needs new MiG.
74 * USERS OF THIS FUNCTION MUST RE-LINK!!
75 * [91/07/29 dbg]
76 *
77 * MACH_IPC_COMPAT: set C type for backup argument to
78 * port_set_backup to be 'mach_port_t'. If mach_interface.h is
79 * included with MACH_IPC_COMPAT == 0, the type 'port_t' is not
80 * defined.
81 *
82 * Removed vm_pageable.
83 * [91/06/24 dbg]
84 *
85 * Revision 2.8 91/07/01 08:25:09 jsb
86 * From David Black at OSF: added memory_object_data_supply.
87 * [91/06/29 14:59:47 jsb]
88 *
89 * Revision 2.7 91/06/06 17:07:51 jsb
90 * Added task_get_emulation_vector, task_set_emulation_vector.
91 * [91/05/24 18:26:01 jsb]
92 *
93 * Revision 2.6 91/05/14 16:54:18 mrt
94 * Correcting copyright
95 *
96 * Revision 2.5 91/02/05 17:33:12 mrt
97 * Changed to new Mach copyright
98 * [91/02/01 17:17:41 mrt]
99 *
100 * Revision 2.4 90/06/02 14:58:09 rpd
101 * Changed reply_to argument of memory_object_lock_request
102 * to default to a send-once right but still allow send rights.
103 * [90/05/31 rpd]
104 *
105 * Changes for the emulator: remove vm_allocate, redefine vm_map.
106 *
107 * Obsoleted vm_allocate_with_pager.
108 * [90/04/08 rpd]
109 * Converted to new IPC. Purged MACH_NP, MACH_NET.
110 * Moved vm_set_default_memory_manager, memory_object_get_attributes.
111 * [90/03/26 22:31:41 rpd]
112 *
113 *
114 * Condensed history:
115 * Added vm_machine_attribute (af).
116 * Added memory_object_get_attributes (mwyoung).
117 * Added vm_set_default_memory_manager (mwyoung).
118 * Added thread_set_priority (dbg).
119 * Added vm_pageable (dbg).
120 * Added port_set_backup (rpd).
121 * Added memory_object_destroy (mwyoung).
122 * Converted to memory_object_* names (mwyoung).
123 * New port and port set calls (rpd).
124 * Added documentation (mwyoung).
125 * Added vm_map, pager_attributes, pager_data_error (mwyoung).
126 * Added task_set_emulation and task_get_io_port (dorr).
127 * Added new thread and task interfaces (dbg).
128 * Reset history (avie).
129 */
130
131 /*
132 * Matchmaker definitions file for Mach kernel interface.
133 */
134
135 #ifdef KERNEL
136 #include <mach_ipc_compat.h>
137
138 simport <kern/compat_xxx_defs.h>; /* for obsolete routines */
139 #endif KERNEL
140
141 subsystem
142 #if KERNEL_USER
143 KernelUser
144 #endif KERNEL_USER
145 #if KERNEL_SERVER
146 KernelServer
147 #endif KERNEL_SERVER
148 mach 2000;
149
150 #ifdef KERNEL_USER
151 userprefix r_;
152 #endif KERNEL_USER
153
154 #include <mach/std_types.defs>
155 #include <mach/mach_types.defs>
156
157 skip; /* old port_allocate */
158 skip; /* old port_deallocate */
159 skip; /* old port_enable */
160 skip; /* old port_disable */
161 skip; /* old port_select */
162 skip; /* old port_set_backlog */
163 skip; /* old port_status */
164
165 /*
166 * Create a new task with an empty set of IPC rights,
167 * and having an address space constructed from the
168 * target task (or empty, if inherit_memory is FALSE).
169 */
170 routine task_create(
171 target_task : task_t;
172 inherit_memory : boolean_t;
173 out child_task : task_t);
174
175 /*
176 * Destroy the target task, causing all of its threads
177 * to be destroyed, all of its IPC rights to be deallocated,
178 * and all of its address space to be deallocated.
179 */
180 routine task_terminate(
181 target_task : task_t);
182
183 /*
184 * Get user-level handler entry points for all
185 * emulated system calls.
186 */
187 routine task_get_emulation_vector(
188 task : task_t;
189 out vector_start : int;
190 out emulation_vector: emulation_vector_t);
191
192 /*
193 * Establish user-level handlers for the specified
194 * system calls. Non-emulated system calls are specified
195 * with emulation_vector[i] == EML_ROUTINE_NULL.
196 */
197 routine task_set_emulation_vector(
198 task : task_t;
199 vector_start : int;
200 emulation_vector: emulation_vector_t);
201
202
203 /*
204 * Returns the set of threads belonging to the target task.
205 */
206 routine task_threads(
207 target_task : task_t;
208 out thread_list : thread_array_t);
209
210 /*
211 * Returns information about the target task.
212 */
213 routine task_info(
214 target_task : task_t;
215 flavor : int;
216 out task_info_out : task_info_t, CountInOut);
217
218
219 skip; /* old task_status */
220 skip; /* old task_set_notify */
221 skip; /* old thread_create */
222
223 /*
224 * Destroy the target thread.
225 */
226 routine thread_terminate(
227 target_thread : thread_t);
228
229 /*
230 * Return the selected state information for the target
231 * thread. If the thread is currently executing, the results
232 * may be stale. [Flavor THREAD_STATE_FLAVOR_LIST provides a
233 * list of valid flavors for the target thread.]
234 */
235 routine thread_get_state(
236 target_thread : thread_t;
237 flavor : int;
238 out old_state : thread_state_t, CountInOut);
239
240 /*
241 * Set the selected state information for the target thread.
242 * If the thread is currently executing, the state change
243 * may be ill-defined.
244 */
245 routine thread_set_state(
246 target_thread : thread_t;
247 flavor : int;
248 new_state : thread_state_t);
249
250 /*
251 * Returns information about the target thread.
252 */
253 routine thread_info(
254 target_thread : thread_t;
255 flavor : int;
256 out thread_info_out : thread_info_t, CountInOut);
257
258 skip; /* old thread_mutate */
259
260 /*
261 * Allocate zero-filled memory in the address space
262 * of the target task, either at the specified address,
263 * or wherever space can be found (if anywhere is TRUE),
264 * of the specified size. The address at which the
265 * allocation actually took place is returned.
266 */
267 #ifdef EMULATOR
268 skip; /* the emulator redefines vm_allocate using vm_map */
269 #else EMULATOR
270 routine vm_allocate(
271 target_task : vm_task_t;
272 inout address : vm_address_t;
273 size : vm_size_t;
274 anywhere : boolean_t);
275 #endif EMULATOR
276
277 skip; /* old vm_allocate_with_pager */
278
279 /*
280 * Deallocate the specified range from the virtual
281 * address space of the target task.
282 */
283 routine vm_deallocate(
284 target_task : vm_task_t;
285 address : vm_address_t;
286 size : vm_size_t);
287
288 /*
289 * Set the current or maximum protection attribute
290 * for the specified range of the virtual address
291 * space of the target task. The current protection
292 * limits the memory access rights of threads within
293 * the task; the maximum protection limits the accesses
294 * that may be given in the current protection.
295 * Protections are specified as a set of {read, write, execute}
296 * *permissions*.
297 */
298 routine vm_protect(
299 target_task : vm_task_t;
300 address : vm_address_t;
301 size : vm_size_t;
302 set_maximum : boolean_t;
303 new_protection : vm_prot_t);
304
305 /*
306 * Set the inheritance attribute for the specified range
307 * of the virtual address space of the target task.
308 * The inheritance value is one of {none, copy, share}, and
309 * specifies how the child address space should acquire
310 * this memory at the time of a task_create call.
311 */
312 routine vm_inherit(
313 target_task : vm_task_t;
314 address : vm_address_t;
315 size : vm_size_t;
316 new_inheritance : vm_inherit_t);
317
318 /*
319 * Returns the contents of the specified range of the
320 * virtual address space of the target task. [The
321 * range must be aligned on a virtual page boundary,
322 * and must be a multiple of pages in extent. The
323 * protection on the specified range must permit reading.]
324 */
325 routine vm_read(
326 target_task : vm_task_t;
327 address : vm_address_t;
328 size : vm_size_t;
329 out data : pointer_t);
330
331 /*
332 * Writes the contents of the specified range of the
333 * virtual address space of the target task. [The
334 * range must be aligned on a virtual page boundary,
335 * and must be a multiple of pages in extent. The
336 * protection on the specified range must permit writing.]
337 */
338 routine vm_write(
339 target_task : vm_task_t;
340 address : vm_address_t;
341 data : pointer_t);
342
343 /*
344 * Copy the contents of the source range of the virtual
345 * address space of the target task to the destination
346 * range in that same address space. [Both of the
347 * ranges must be aligned on a virtual page boundary,
348 * and must be multiples of pages in extent. The
349 * protection on the source range must permit reading,
350 * and the protection on the destination range must
351 * permit writing.]
352 */
353 routine vm_copy(
354 target_task : vm_task_t;
355 source_address : vm_address_t;
356 size : vm_size_t;
357 dest_address : vm_address_t);
358
359 /*
360 * Returns information about the contents of the virtual
361 * address space of the target task at the specified
362 * address. The returned protection, inheritance, sharing
363 * and memory object values apply to the entire range described
364 * by the address range returned; the memory object offset
365 * corresponds to the beginning of the address range.
366 * [If the specified address is not allocated, the next
367 * highest address range is described. If no addresses beyond
368 * the one specified are allocated, the call returns KERN_NO_SPACE.]
369 */
370 routine vm_region(
371 target_task : vm_task_t;
372 inout address : vm_address_t;
373 out size : vm_size_t;
374 out protection : vm_prot_t;
375 out max_protection : vm_prot_t;
376 out inheritance : vm_inherit_t;
377 out is_shared : boolean_t;
378 /* avoid out-translation of the argument */
379 out object_name : memory_object_name_t =
380 MACH_MSG_TYPE_MOVE_SEND
381 ctype: mach_port_t;
382 out offset : vm_offset_t);
383
384 /*
385 * Return virtual memory statistics for the host
386 * on which the target task resides. [Note that the
387 * statistics are not specific to the target task.]
388 */
389 routine vm_statistics(
390 target_task : vm_task_t;
391 out vm_stats : vm_statistics_data_t);
392
393 skip; /* old task_by_u*x_pid */
394 skip; /* old vm_pageable */
395
396 /*
397 * Stash a handful of ports for the target task; child
398 * tasks inherit this stash at task_create time.
399 */
400 routine mach_ports_register(
401 target_task : task_t;
402 init_port_set : mach_port_array_t =
403 ^array[] of mach_port_t);
404
405 /*
406 * Retrieve the stashed ports for the target task.
407 */
408 routine mach_ports_lookup(
409 target_task : task_t;
410 out init_port_set : mach_port_array_t =
411 ^array[] of mach_port_t);
412
413 skip; /* old u*x_pid */
414 skip; /* old netipc_listen */
415 skip; /* old netipc_ignore */
416
417 /*
418 * Provide the data contents of a range of the given memory
419 * object, with the access restriction specified. [Only
420 * whole virtual pages of data can be accepted; partial pages
421 * will be discarded. Data should be provided on request, but
422 * may be provided in advance as desired. When data already
423 * held by this kernel is provided again, the new data is ignored.
424 * The access restriction is the subset of {read, write, execute}
425 * which are prohibited. The kernel may not provide any data (or
426 * protection) consistency among pages with different virtual page
427 * alignments within the same object.]
428 */
429 simpleroutine memory_object_data_provided(
430 memory_control : memory_object_control_t;
431 offset : vm_offset_t;
432 data : pointer_t;
433 lock_value : vm_prot_t);
434
435 /*
436 * Indicate that a range of the given temporary memory object does
437 * not exist, and that the backing memory object should be used
438 * instead (or zero-fill memory be used, if no backing object exists).
439 * [This call is intended for use only by the default memory manager.
440 * It should not be used to indicate a real error --
441 * memory_object_data_error should be used for that purpose.]
442 */
443 simpleroutine memory_object_data_unavailable(
444 memory_control : memory_object_control_t;
445 offset : vm_offset_t;
446 size : vm_size_t);
447
448 /*
449 * Retrieves the attributes currently associated with
450 * a memory object.
451 */
452 routine memory_object_get_attributes(
453 memory_control : memory_object_control_t;
454 out object_ready : boolean_t;
455 out may_cache : boolean_t;
456 out copy_strategy : memory_object_copy_strategy_t);
457
458 /*
459 * Sets the default memory manager, the port to which
460 * newly-created temporary memory objects are delivered.
461 * [See (memory_object_default)memory_object_create.]
462 * The old memory manager port is returned.
463 */
464 routine vm_set_default_memory_manager(
465 host_priv : host_priv_t;
466 inout default_manager : mach_port_make_send_t);
467
468 skip; /* old pager_flush_request */
469
470 /*
471 * Control use of the data associated with the given
472 * memory object. For each page in the given range,
473 * perform the following operations, in order:
474 * 1) restrict access to the page (disallow
475 * forms specified by "prot");
476 * 2) write back modifications (if "should_return"
477 * is RETURN_DIRTY and the page is dirty, or
478 * "should_return" is RETURN_ALL and the page
479 * is either dirty or precious); and,
480 * 3) flush the cached copy (if "should_flush"
481 * is asserted).
482 * The set of pages is defined by a starting offset
483 * ("offset") and size ("size"). Only pages with the
484 * same page alignment as the starting offset are
485 * considered.
486 *
487 * A single acknowledgement is sent (to the "reply_to"
488 * port) when these actions are complete.
489 *
490 * There are two versions of this routine because IPC distinguishes
491 * between booleans and integers (a 2-valued integer is NOT a
492 * boolean). The new routine is backwards compatible at the C
493 * language interface.
494 */
495 simpleroutine xxx_memory_object_lock_request(
496 memory_control : memory_object_control_t;
497 offset : vm_offset_t;
498 size : vm_size_t;
499 should_clean : boolean_t;
500 should_flush : boolean_t;
501 lock_value : vm_prot_t;
502 reply_to : mach_port_t =
503 MACH_MSG_TYPE_MAKE_SEND_ONCE|polymorphic);
504
505
506 simpleroutine memory_object_lock_request(
507 memory_control : memory_object_control_t;
508 offset : vm_offset_t;
509 size : vm_size_t;
510 should_return : memory_object_return_t;
511 should_flush : boolean_t;
512 lock_value : vm_prot_t;
513 reply_to : mach_port_t =
514 MACH_MSG_TYPE_MAKE_SEND_ONCE|polymorphic);
515
516 /* obsolete */
517 routine xxx_task_get_emulation_vector(
518 task : task_t;
519 out vector_start : int;
520 out emulation_vector: xxx_emulation_vector_t, IsLong);
521
522 /* obsolete */
523 routine xxx_task_set_emulation_vector(
524 task : task_t;
525 vector_start : int;
526 emulation_vector: xxx_emulation_vector_t, IsLong);
527
528 /*
529 * Returns information about the host on which the
530 * target object resides. [This object may be
531 * a task, thread, or memory_object_control port.]
532 */
533 routine xxx_host_info(
534 target_task : mach_port_t;
535 out info : machine_info_data_t);
536
537 /*
538 * Returns information about a particular processor on
539 * the host on which the target task resides.
540 */
541 routine xxx_slot_info(
542 target_task : task_t;
543 slot : int;
544 out info : machine_slot_data_t);
545
546 /*
547 * Performs control operations (currently only
548 * turning off or on) on a particular processor on
549 * the host on which the target task resides.
550 */
551 routine xxx_cpu_control(
552 target_task : task_t;
553 cpu : int;
554 running : boolean_t);
555
556 skip; /* old thread_statistics */
557 skip; /* old task_statistics */
558 skip; /* old netport_init */
559 skip; /* old netport_enter */
560 skip; /* old netport_remove */
561 skip; /* old thread_set_priority */
562
563 /*
564 * Increment the suspend count for the target task.
565 * No threads within a task may run when the suspend
566 * count for that task is non-zero.
567 */
568 routine task_suspend(
569 target_task : task_t);
570
571 /*
572 * Decrement the suspend count for the target task,
573 * if the count is currently non-zero. If the resulting
574 * suspend count is zero, then threads within the task
575 * that also have non-zero suspend counts may execute.
576 */
577 routine task_resume(
578 target_task : task_t);
579
580 /*
581 * Returns the current value of the selected special port
582 * associated with the target task.
583 */
584 routine task_get_special_port(
585 task : task_t;
586 which_port : int;
587 out special_port : mach_port_t);
588
589 /*
590 * Set one of the special ports associated with the
591 * target task.
592 */
593 routine task_set_special_port(
594 task : task_t;
595 which_port : int;
596 special_port : mach_port_t);
597
598 /* obsolete */
599 routine xxx_task_info(
600 target_task : task_t;
601 flavor : int;
602 out task_info_out : task_info_t, IsLong);
603
604
605 /*
606 * Create a new thread within the target task, returning
607 * the port representing that new thread. The
608 * initial execution state of the thread is undefined.
609 */
610 routine thread_create(
611 parent_task : task_t;
612 out child_thread : thread_t);
613
614 /*
615 * Increment the suspend count for the target thread.
616 * Once this call has completed, the thread will not
617 * execute any further user or meta- instructions.
618 * Once suspended, a thread may not execute again until
619 * its suspend count is zero, and the suspend count
620 * for its task is also zero.
621 */
622 routine thread_suspend(
623 target_thread : thread_t);
624
625 /*
626 * Decrement the suspend count for the target thread,
627 * if that count is not already zero.
628 */
629 routine thread_resume(
630 target_thread : thread_t);
631
632 /*
633 * Cause any user or meta- instructions currently being
634 * executed by the target thread to be aborted. [Meta-
635 * instructions consist of the basic traps for IPC
636 * (e.g., msg_send, msg_receive) and self-identification
637 * (e.g., task_self, thread_self, thread_reply). Calls
638 * described by MiG interfaces are not meta-instructions
639 * themselves.]
640 */
641 routine thread_abort(
642 target_thread : thread_t);
643
644 /* obsolete */
645 routine xxx_thread_get_state(
646 target_thread : thread_t;
647 flavor : int;
648 out old_state : thread_state_t, IsLong);
649
650 /* obsolete */
651 routine xxx_thread_set_state(
652 target_thread : thread_t;
653 flavor : int;
654 new_state : thread_state_t, IsLong);
655
656 /*
657 * Returns the current value of the selected special port
658 * associated with the target thread.
659 */
660 routine thread_get_special_port(
661 thread : thread_t;
662 which_port : int;
663 out special_port : mach_port_t);
664
665 /*
666 * Set one of the special ports associated with the
667 * target thread.
668 */
669 routine thread_set_special_port(
670 thread : thread_t;
671 which_port : int;
672 special_port : mach_port_t);
673
674 /* obsolete */
675 routine xxx_thread_info(
676 target_thread : thread_t;
677 flavor : int;
678 out thread_info_out : thread_info_t, IsLong);
679
680 /*
681 * Establish a user-level handler for the specified
682 * system call.
683 */
684 routine task_set_emulation(
685 target_port : task_t;
686 routine_entry_pt: vm_address_t;
687 routine_number : int);
688
689 /*
690 * Establish restart pc for interrupted atomic sequences.
691 * This reuses the message number for the old task_get_io_port.
692 * See task_info.h for description of flavors.
693 *
694 */
695 routine task_ras_control(
696 target_task : task_t;
697 basepc : vm_address_t;
698 boundspc : vm_address_t;
699 flavor : int);
700
701
702
703 skip; /* old host_ipc_statistics */
704
705
706 #if MACH_IPC_COMPAT
707
708 /*
709 * Returns the set of port and port set names
710 * to which the target task has access, along with
711 * the type (set or port) for each name.
712 */
713 routine port_names(
714 task : ipc_space_t;
715 out port_names_p : port_name_array_t;
716 out port_types : port_type_array_t);
717
718 /*
719 * Returns the type (set or port) for the port name
720 * within the target task.
721 */
722 routine port_type(
723 task : ipc_space_t;
724 port_name : port_name_t;
725 out port_type_p : port_type_t);
726
727 /*
728 * Changes the name by which a port (or port set) is known to
729 * the target task.
730 */
731 routine port_rename(
732 task : ipc_space_t;
733 old_name : port_name_t;
734 new_name : port_name_t);
735
736 /*
737 * Allocate a new port (with all rights) in the target task.
738 * The port name in that task is returned.
739 */
740 routine port_allocate(
741 task : ipc_space_t;
742 out port_name : port_name_t);
743
744 /*
745 * Deallocate the port with the given name from the target task.
746 */
747 routine port_deallocate(
748 task : ipc_space_t;
749 port_name : port_name_t);
750
751 /*
752 * Set the number of messages that may be queued to
753 * the port in the target task with the given name
754 * before further message queueing operations block.
755 * The target task must hold receive rights for the
756 * port named.
757 */
758 routine port_set_backlog(
759 task : ipc_space_t;
760 port_name : port_name_t;
761 backlog : int);
762
763 /*
764 * Return information about the port with the given
765 * name in the target task. Only the ownership and
766 * receive_rights results are meaningful unless the
767 * target task holds receive rights for the port.
768 */
769 routine port_status(
770 task : ipc_space_t;
771 port_name : port_name_t;
772 out enabled : port_set_name_t;
773 out num_msgs : int;
774 out backlog : int;
775 out ownership : boolean_t;
776 out receive_rights : boolean_t);
777
778 /*
779 * Allocate a new port set in the target task, returning
780 * the name of that new port set. [The new set is
781 * initially empty.]
782 */
783 routine port_set_allocate(
784 task : ipc_space_t;
785 out set_name : port_set_name_t);
786
787 /*
788 * Deallocate the named port set from the target task.
789 * Ports that are currently members of the named port
790 * set are first removed from the set.
791 */
792 routine port_set_deallocate(
793 task : ipc_space_t;
794 set_name : port_set_name_t);
795
796 /*
797 * Add the named port to the port set named within
798 * the target task. [If the port currently is a member
799 * of another port set, it is removed from that set.]
800 */
801 routine port_set_add(
802 task : ipc_space_t;
803 set_name : port_set_name_t;
804 port_name : port_name_t);
805
806 /*
807 * Remove the named port from the port set named within
808 * the target task.
809 */
810 routine port_set_remove(
811 task : ipc_space_t;
812 port_name : port_name_t);
813
814 /*
815 * Returns the current set of ports that are members
816 * of the named port set in the target task.
817 */
818 routine port_set_status(
819 task : ipc_space_t;
820 set_name : port_set_name_t;
821 out members : port_name_array_t);
822
823 /*
824 * Insert send rights for the specified port into
825 * the target task with the specified port name.
826 * [If the name is in use, or the target task already
827 * has another name for the specified port, then
828 * the operation will fail.]
829 */
830 routine port_insert_send(
831 task : ipc_space_t;
832 my_port : port_t;
833 his_name : port_name_t);
834
835 /*
836 * Returns send rights for the named port in the
837 * target task, removing that port name and port
838 * send rights from the target task. [If the
839 * target task holds receive rights for this port,
840 * the operation will fail.]
841 */
842 routine port_extract_send(
843 task : ipc_space_t;
844 his_name : port_name_t;
845 out his_port : port_t);
846
847 /*
848 * Insert receive rights for the specified port into
849 * the target task with the specified port name.
850 * [If the name is in use, or the target task already
851 * has another name for the specified port, then
852 * the operation will fail.
853 */
854 routine port_insert_receive(
855 task : ipc_space_t;
856 my_port : port_all_t;
857 his_name : port_name_t);
858
859 /*
860 * Returns receive rights for the named port in the
861 * target task, removing that port name and all port
862 * rights from the target task.
863 */
864 routine port_extract_receive(
865 task : ipc_space_t;
866 his_name : port_name_t;
867 out his_port : port_all_t);
868
869 #else MACH_IPC_COMPAT
870
871 skip; /* old port_names */
872 skip; /* old port_type */
873 skip; /* old port_rename */
874 skip; /* old port_allocate */
875 skip; /* old port_deallocate */
876 skip; /* old port_set_backlog */
877 skip; /* old port_status */
878 skip; /* old port_set_allocate */
879 skip; /* old port_set_deallocate */
880 skip; /* old port_set_add */
881 skip; /* old port_set_remove */
882 skip; /* old port_set_status */
883 skip; /* old port_insert_send */
884 skip; /* old port_extract_send */
885 skip; /* old port_insert_receive */
886 skip; /* old port_extract_receive */
887
888 #endif MACH_IPC_COMPAT
889
890 /*
891 * Map a user-defined memory object into the virtual address
892 * space of the target task. If desired (anywhere is TRUE),
893 * the kernel will find a suitable address range of the
894 * specified size; else, the specific address will be allocated.
895 *
896 * The beginning address of the range will be aligned on a virtual
897 * page boundary, be at or beyond the address specified, and
898 * meet the mask requirements (bits turned on in the mask must not
899 * be turned on in the result); the size of the range, in bytes,
900 * will be rounded up to an integral number of virtual pages.
901 *
902 * The memory in the resulting range will be associated with the
903 * specified memory object, with the beginning of the memory range
904 * referring to the specified offset into the memory object.
905 *
906 * The mapping will take the current and maximum protections and
907 * the inheritance attributes specified; see the vm_protect and
908 * vm_inherit calls for a description of these attributes.
909 *
910 * If desired (copy is TRUE), the memory range will be filled
911 * with a copy of the data from the memory object; this copy will
912 * be private to this mapping in this target task. Otherwise,
913 * the memory in this mapping will be shared with other mappings
914 * of the same memory object at the same offset (in this task or
915 * in other tasks). [The Mach kernel only enforces shared memory
916 * consistency among mappings on one host with similar page alignments.
917 * The user-defined memory manager for this object is responsible
918 * for further consistency.]
919 */
920 #ifdef EMULATOR
921 routine htg_vm_map(
922 target_task : vm_task_t;
923 ureplyport reply_port : mach_port_make_send_once_t;
924 inout address : vm_address_t;
925 size : vm_size_t;
926 mask : vm_address_t;
927 anywhere : boolean_t;
928 memory_object : memory_object_t;
929 offset : vm_offset_t;
930 copy : boolean_t;
931 cur_protection : vm_prot_t;
932 max_protection : vm_prot_t;
933 inheritance : vm_inherit_t);
934 #else EMULATOR
935 routine vm_map(
936 target_task : vm_task_t;
937 inout address : vm_address_t;
938 size : vm_size_t;
939 mask : vm_address_t;
940 anywhere : boolean_t;
941 memory_object : memory_object_t;
942 offset : vm_offset_t;
943 copy : boolean_t;
944 cur_protection : vm_prot_t;
945 max_protection : vm_prot_t;
946 inheritance : vm_inherit_t);
947 #endif EMULATOR
948
949 /*
950 * Indicate that a range of the specified memory object cannot
951 * be provided at this time. [Threads waiting for memory pages
952 * specified by this call will experience a memory exception.
953 * Only threads waiting at the time of the call are affected.]
954 */
955 simpleroutine memory_object_data_error(
956 memory_control : memory_object_control_t;
957 offset : vm_offset_t;
958 size : vm_size_t;
959 error_value : kern_return_t);
960
961 /*
962 * Make decisions regarding the use of the specified
963 * memory object.
964 */
965 simpleroutine memory_object_set_attributes(
966 memory_control : memory_object_control_t;
967 object_ready : boolean_t;
968 may_cache : boolean_t;
969 copy_strategy : memory_object_copy_strategy_t);
970
971 /*
972 */
973 simpleroutine memory_object_destroy(
974 memory_control : memory_object_control_t;
975 reason : kern_return_t);
976
977 /*
978 * Provide the data contents of a range of the given memory
979 * object, with the access restriction specified, optional
980 * precious attribute, and reply message. [Only
981 * whole virtual pages of data can be accepted; partial pages
982 * will be discarded. Data should be provided on request, but
983 * may be provided in advance as desired. When data already
984 * held by this kernel is provided again, the new data is ignored.
985 * The access restriction is the subset of {read, write, execute}
986 * which are prohibited. The kernel may not provide any data (or
987 * protection) consistency among pages with different virtual page
988 * alignments within the same object. The precious value controls
989 * how the kernel treats the data. If it is FALSE, the kernel treats
990 * its copy as a temporary and may throw it away if it hasn't been
991 * changed. If the precious value is TRUE, the kernel treats its
992 * copy as a data repository and promises to return it to the manager;
993 * the manager may tell the kernel to throw it away instead by flushing
994 * and not cleaning the data -- see memory_object_lock_request. The
995 * reply_to port is for a compeletion message; it will be
996 * memory_object_supply_completed.]
997 */
998
999 simpleroutine memory_object_data_supply(
1000 memory_control : memory_object_control_t;
1001 offset : vm_offset_t;
1002 data : pointer_t, Dealloc[];
1003 lock_value : vm_prot_t;
1004 precious : boolean_t;
1005 reply_to : mach_port_t =
1006 MACH_MSG_TYPE_MAKE_SEND_ONCE|polymorphic);
1007
1008 simpleroutine memory_object_ready(
1009 memory_control : memory_object_control_t;
1010 may_cache : boolean_t;
1011 copy_strategy : memory_object_copy_strategy_t);
1012
1013 simpleroutine memory_object_change_attributes(
1014 memory_control : memory_object_control_t;
1015 may_cache : boolean_t;
1016 copy_strategy : memory_object_copy_strategy_t;
1017 reply_to : mach_port_t =
1018 MACH_MSG_TYPE_MAKE_SEND_ONCE|polymorphic);
1019
1020 skip; /* old host_callout_statistics_reset */
1021 skip; /* old port_set_select */
1022
1023 #if MACH_IPC_COMPAT
1024
1025 /*
1026 * Sets a backup port for the named port. The task
1027 * must have receive rights for the named port.
1028 * Returns the previous backup port, if any.
1029 */
1030
1031 routine port_set_backup(
1032 task : ipc_space_t;
1033 port_name : port_name_t;
1034 backup : port_t = MACH_MSG_TYPE_MAKE_SEND
1035 ctype: mach_port_t;
1036 out previous : port_t);
1037
1038 #else MACH_IPC_COMPAT
1039
1040 skip; /* old port_set_backup */
1041
1042 #endif MACH_IPC_COMPAT
1043
1044 /*
1045 * Set/Get special properties of memory associated
1046 * to some virtual address range, such as cachability,
1047 * migrability, replicability. Machine-dependent.
1048 */
1049 routine vm_machine_attribute(
1050 target_task : vm_task_t;
1051 address : vm_address_t;
1052 size : vm_size_t;
1053 attribute : vm_machine_attribute_t;
1054 inout value : vm_machine_attribute_val_t);
1055
1056 skip; /* old host_fpa_counters_reset */
1057
1058 /*
1059 * There is no more room in this interface for additional calls.
1060 */
Cache object: 76d183b7167b1b7db14a9f1bf834fd30
|