this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Adding kernel defs for MIG

+6626
+49
kernel/mach/audit_triggers.defs
··· 1 + /* 2 + * Copyright (c) 2004-2008, Apple Inc. All rights reserved. 3 + * 4 + * @APPLE_BSD_LICENSE_HEADER_START@ 5 + * 6 + * Redistribution and use in source and binary forms, with or without 7 + * modification, are permitted provided that the following conditions 8 + * are met: 9 + * 10 + * 1. Redistributions of source code must retain the above copyright 11 + * notice, this list of conditions and the following disclaimer. 12 + * 2. Redistributions in binary form must reproduce the above copyright 13 + * notice, this list of conditions and the following disclaimer in the 14 + * documentation and/or other materials provided with the distribution. 15 + * 3. Neither the name of Apple Inc. ("Apple") nor the names of 16 + * its contributors may be used to endorse or promote products derived 17 + * from this software without specific prior written permission. 18 + * 19 + * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY 20 + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21 + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 + * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY 23 + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 26 + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 + * 30 + * @APPLE_BSD_LICENSE_HEADER_END@ 31 + */ 32 + 33 + /* 34 + * Interface definition for the audit logging facility. 35 + */ 36 + 37 + subsystem 38 + #if KERNEL_USER 39 + KernelUser 40 + #endif /* KERNEL_USER */ 41 + audit_triggers 123; 42 + 43 + #include <mach/std_types.defs> 44 + #include <mach/mach_types.defs> 45 + 46 + simpleroutine audit_triggers( 47 + audit_port : mach_port_t; 48 + in flags : int); 49 +
+81
kernel/mach/clock.defs
··· 1 + /* 2 + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. 3 + * 4 + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ 5 + * 6 + * This file contains Original Code and/or Modifications of Original Code 7 + * as defined in and that are subject to the Apple Public Source License 8 + * Version 2.0 (the 'License'). You may not use this file except in 9 + * compliance with the License. The rights granted to you under the License 10 + * may not be used to create, or enable the creation or redistribution of, 11 + * unlawful or unlicensed copies of an Apple operating system, or to 12 + * circumvent, violate, or enable the circumvention or violation of, any 13 + * terms of an Apple operating system software license agreement. 14 + * 15 + * Please obtain a copy of the License at 16 + * http://www.opensource.apple.com/apsl/ and read it before using this file. 17 + * 18 + * The Original Code and all software distributed under the License are 19 + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 20 + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 21 + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 22 + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 23 + * Please see the License for the specific language governing rights and 24 + * limitations under the License. 25 + * 26 + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ 27 + */ 28 + /* 29 + * @OSF_COPYRIGHT@ 30 + */ 31 + /* 32 + * File: mach/clock.defs 33 + * Purpose: Kernel clock subsystem definitions. This 34 + * file defines the clock request interface. 35 + */ 36 + 37 + subsystem 38 + #if KERNEL_SERVER 39 + KernelServer 40 + #endif /* KERNEL_SERVER */ 41 + clock 1000; 42 + 43 + #include <mach/std_types.defs> 44 + #include <mach/mach_types.defs> 45 + #include <mach/clock_types.defs> 46 + 47 + /* 48 + * References to clock objects are returned by: 49 + * host_get_clock_service(host_t,...) 50 + * host_get_clock_control(host_priv_t,...) - Priviledged subclass 51 + */ 52 + 53 + /* 54 + * Get the clock time. 55 + * Available to all. 56 + */ 57 + routine clock_get_time( 58 + clock_serv : clock_serv_t; 59 + out cur_time : mach_timespec_t); 60 + 61 + /* 62 + * Get clock attributes. 63 + * Available to all. 64 + */ 65 + routine clock_get_attributes( 66 + clock_serv : clock_serv_t; 67 + in flavor : clock_flavor_t; 68 + out clock_attr : clock_attr_t, CountInOut); 69 + 70 + /* 71 + * Setup a clock alarm. 72 + * Available to all. 73 + */ 74 + routine clock_alarm( 75 + clock_serv : clock_serv_t; 76 + alarm_type : alarm_type_t; 77 + alarm_time : mach_timespec_t; 78 + alarm_port : clock_reply_t = 79 + MACH_MSG_TYPE_MAKE_SEND_ONCE|polymorphic); 80 + 81 + /* vim: set ft=c : */
+69
kernel/mach/clock_priv.defs
··· 1 + /* 2 + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. 3 + * 4 + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ 5 + * 6 + * This file contains Original Code and/or Modifications of Original Code 7 + * as defined in and that are subject to the Apple Public Source License 8 + * Version 2.0 (the 'License'). You may not use this file except in 9 + * compliance with the License. The rights granted to you under the License 10 + * may not be used to create, or enable the creation or redistribution of, 11 + * unlawful or unlicensed copies of an Apple operating system, or to 12 + * circumvent, violate, or enable the circumvention or violation of, any 13 + * terms of an Apple operating system software license agreement. 14 + * 15 + * Please obtain a copy of the License at 16 + * http://www.opensource.apple.com/apsl/ and read it before using this file. 17 + * 18 + * The Original Code and all software distributed under the License are 19 + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 20 + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 21 + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 22 + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 23 + * Please see the License for the specific language governing rights and 24 + * limitations under the License. 25 + * 26 + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ 27 + */ 28 + /* 29 + * @OSF_COPYRIGHT@ 30 + */ 31 + /* 32 + * File: mach/clock_priv.defs 33 + * Purpose: Kernel clock subsystem definitions. This 34 + * file defines the clock request interface. 35 + */ 36 + 37 + subsystem 38 + #if KERNEL_SERVER 39 + KernelServer 40 + #endif /* KERNEL_SERVER */ 41 + clock_priv 1200; 42 + 43 + #include <mach/std_types.defs> 44 + #include <mach/mach_types.defs> 45 + #include <mach/clock_types.defs> 46 + 47 + /* 48 + * References to clock_priv objects are returned by: 49 + * host_get_clock_control(host_priv_t,...) - Priviledged subclass 50 + */ 51 + 52 + /* 53 + * Set the clock time. 54 + * Privileged. 55 + */ 56 + routine clock_set_time( 57 + clock_ctrl : clock_ctrl_t; 58 + new_time : mach_timespec_t); 59 + 60 + /* 61 + * Set clock attributes. 62 + * Privileged. 63 + */ 64 + routine clock_set_attributes( 65 + clock_ctrl : clock_ctrl_t; 66 + in flavor : clock_flavor_t; 67 + in clock_attr : clock_attr_t); 68 + 69 + /* vim: set ft=c : */
+56
kernel/mach/clock_reply.defs
··· 1 + /* 2 + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. 3 + * 4 + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ 5 + * 6 + * This file contains Original Code and/or Modifications of Original Code 7 + * as defined in and that are subject to the Apple Public Source License 8 + * Version 2.0 (the 'License'). You may not use this file except in 9 + * compliance with the License. The rights granted to you under the License 10 + * may not be used to create, or enable the creation or redistribution of, 11 + * unlawful or unlicensed copies of an Apple operating system, or to 12 + * circumvent, violate, or enable the circumvention or violation of, any 13 + * terms of an Apple operating system software license agreement. 14 + * 15 + * Please obtain a copy of the License at 16 + * http://www.opensource.apple.com/apsl/ and read it before using this file. 17 + * 18 + * The Original Code and all software distributed under the License are 19 + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 20 + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 21 + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 22 + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 23 + * Please see the License for the specific language governing rights and 24 + * limitations under the License. 25 + * 26 + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ 27 + */ 28 + /* 29 + * @OSF_COPYRIGHT@ 30 + */ 31 + /* 32 + * File: clock_reply.defs 33 + * Purpose: Kernel clock subsystem definitions. This 34 + * file defines the clock reply interface. 35 + */ 36 + 37 + subsystem 38 + #if KERNEL_USER 39 + KernelUser 40 + #endif /* KERNEL_USER */ 41 + clock_reply 3125107; /* Matches up with old value */ 42 + 43 + #include <mach/std_types.defs> 44 + #include <mach/clock_types.defs> 45 + 46 + 47 + /* 48 + * Reply routine for clock_alarm. 49 + */ 50 + simpleroutine clock_alarm_reply( 51 + alarm_port : clock_reply_t; 52 + alarm_code : kern_return_t; 53 + alarm_type : alarm_type_t; 54 + alarm_time : mach_timespec_t); 55 + 56 + /* vim: set ft=c : */
+73
kernel/mach/clock_types.defs
··· 1 + /* 2 + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. 3 + * 4 + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ 5 + * 6 + * This file contains Original Code and/or Modifications of Original Code 7 + * as defined in and that are subject to the Apple Public Source License 8 + * Version 2.0 (the 'License'). You may not use this file except in 9 + * compliance with the License. The rights granted to you under the License 10 + * may not be used to create, or enable the creation or redistribution of, 11 + * unlawful or unlicensed copies of an Apple operating system, or to 12 + * circumvent, violate, or enable the circumvention or violation of, any 13 + * terms of an Apple operating system software license agreement. 14 + * 15 + * Please obtain a copy of the License at 16 + * http://www.opensource.apple.com/apsl/ and read it before using this file. 17 + * 18 + * The Original Code and all software distributed under the License are 19 + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 20 + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 21 + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 22 + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 23 + * Please see the License for the specific language governing rights and 24 + * limitations under the License. 25 + * 26 + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ 27 + */ 28 + /* 29 + * @OSF_COPYRIGHT@ 30 + */ 31 + /* 32 + * File: clock_types.defs 33 + * Purpose: 34 + * Clock kernel interface type declarations 35 + */ 36 + 37 + #ifndef _MACH_CLOCK_TYPES_DEFS_ 38 + #define _MACH_CLOCK_TYPES_DEFS_ 39 + 40 + #include <mach/std_types.defs> 41 + 42 + type clock_serv_t = mach_port_t 43 + cusertype: clock_serv_t 44 + #if KERNEL_SERVER 45 + intran: clock_serv_t convert_port_to_clock(mach_port_t) 46 + outtran: mach_port_t convert_clock_to_port(clock_serv_t) 47 + #endif /* KERNEL_SERVER */ 48 + ; 49 + 50 + type clock_ctrl_t = mach_port_t 51 + cusertype: clock_ctrl_t 52 + #if KERNEL_SERVER 53 + intran: clock_ctrl_t convert_port_to_clock_ctrl(mach_port_t) 54 + outtran: mach_port_t convert_clock_ctrl_to_port(clock_ctrl_t) 55 + #endif /* KERNEL_SERVER */ 56 + ; 57 + 58 + type clock_reply_t = polymorphic|MACH_MSG_TYPE_MAKE_SEND_ONCE; 59 + 60 + type clock_flavor_t = int; 61 + type clock_attr_t = array[*:1] of int; 62 + type mach_timespec_t = struct[2] of int; 63 + type time_t = int; 64 + type sleep_type_t = int; 65 + type alarm_type_t = int; 66 + type clock_res_t = int; 67 + type clock_id_t = int; 68 + 69 + import <mach/mach_types.h>; 70 + 71 + #endif /* _MACH_CLOCK_TYPES_DEFS_ */ 72 + 73 + /* vim: set ft=c : */
+22
kernel/mach/coalition_notification.defs
··· 1 + /* 2 + * Copyright (c) 2013, Apple Inc. All rights reserved. 3 + */ 4 + 5 + /* 6 + * Interface definition for the coalition facility. 7 + */ 8 + 9 + subsystem 10 + #if KERNEL_USER 11 + KernelUser 12 + #endif /* KERNEL_USER */ 13 + coalition_notification 5300; 14 + 15 + #include <mach/std_types.defs> 16 + #include <mach/mach_types.defs> 17 + 18 + /* This is likely to change with 15385886. */ 19 + simpleroutine coalition_notification( 20 + RequestPort coalition_port : mach_port_t; 21 + in id : uint64_t; 22 + in flags : uint32_t);
+119
kernel/mach/exc.defs
··· 1 + /* 2 + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. 3 + * 4 + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ 5 + * 6 + * This file contains Original Code and/or Modifications of Original Code 7 + * as defined in and that are subject to the Apple Public Source License 8 + * Version 2.0 (the 'License'). You may not use this file except in 9 + * compliance with the License. The rights granted to you under the License 10 + * may not be used to create, or enable the creation or redistribution of, 11 + * unlawful or unlicensed copies of an Apple operating system, or to 12 + * circumvent, violate, or enable the circumvention or violation of, any 13 + * terms of an Apple operating system software license agreement. 14 + * 15 + * Please obtain a copy of the License at 16 + * http://www.opensource.apple.com/apsl/ and read it before using this file. 17 + * 18 + * The Original Code and all software distributed under the License are 19 + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 20 + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 21 + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 22 + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 23 + * Please see the License for the specific language governing rights and 24 + * limitations under the License. 25 + * 26 + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ 27 + */ 28 + /* 29 + * @OSF_COPYRIGHT@ 30 + */ 31 + /* 32 + * Mach Operating System 33 + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University 34 + * All Rights Reserved. 35 + * 36 + * Permission to use, copy, modify and distribute this software and its 37 + * documentation is hereby granted, provided that both the copyright 38 + * notice and this permission notice appear in all copies of the 39 + * software, derivative works or modified versions, and any portions 40 + * thereof, and that both notices appear in supporting documentation. 41 + * 42 + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 43 + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR 44 + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 45 + * 46 + * Carnegie Mellon requests users of this software to return to 47 + * 48 + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 49 + * School of Computer Science 50 + * Carnegie Mellon University 51 + * Pittsburgh PA 15213-3890 52 + * 53 + * any improvements or extensions that they make and grant Carnegie Mellon 54 + * the rights to redistribute these changes. 55 + */ 56 + /* 57 + */ 58 + /* 59 + * Abstract: 60 + * MiG definitions file for Mach exception interface. 61 + */ 62 + 63 + subsystem 64 + #if KERNEL_USER 65 + KernelUser 66 + #endif 67 + exc 2401; 68 + 69 + #include <mach/std_types.defs> 70 + #include <mach/mach_types.defs> 71 + 72 + ServerPrefix catch_; 73 + 74 + type exception_data_t = array[*:2] of integer_t; 75 + type exception_type_t = int; 76 + 77 + routine exception_raise( 78 + #if KERNEL_USER 79 + exception_port : mach_port_move_send_t; 80 + thread : mach_port_move_send_t; 81 + task : mach_port_move_send_t; 82 + #else /* KERNEL_USER */ 83 + exception_port : mach_port_t; 84 + thread : mach_port_t; 85 + task : mach_port_t; 86 + #endif /* KERNEL_USER */ 87 + exception : exception_type_t; 88 + code : exception_data_t 89 + ); 90 + 91 + routine exception_raise_state( 92 + #if KERNEL_USER 93 + exception_port : mach_port_move_send_t; 94 + #else /* KERNEL_USER */ 95 + exception_port : mach_port_t; 96 + #endif /* KERNEL_USER */ 97 + exception : exception_type_t; 98 + code : exception_data_t, const; 99 + inout flavor : int; 100 + old_state : thread_state_t, const; 101 + out new_state : thread_state_t); 102 + 103 + routine exception_raise_state_identity( 104 + #if KERNEL_USER 105 + exception_port : mach_port_move_send_t; 106 + thread : mach_port_move_send_t; 107 + task : mach_port_move_send_t; 108 + #else /* KERNEL_USER */ 109 + exception_port : mach_port_t; 110 + thread : mach_port_t; 111 + task : mach_port_t; 112 + #endif /* KERNEL_USER */ 113 + exception : exception_type_t; 114 + code : exception_data_t; 115 + inout flavor : int; 116 + old_state : thread_state_t; 117 + out new_state : thread_state_t); 118 + 119 + /* vim: set ft=c : */
+40
kernel/mach/host_notify_reply.defs
··· 1 + /* 2 + * Copyright (c) 2003 Apple Computer, Inc. All rights reserved. 3 + * 4 + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ 5 + * 6 + * This file contains Original Code and/or Modifications of Original Code 7 + * as defined in and that are subject to the Apple Public Source License 8 + * Version 2.0 (the 'License'). You may not use this file except in 9 + * compliance with the License. The rights granted to you under the License 10 + * may not be used to create, or enable the creation or redistribution of, 11 + * unlawful or unlicensed copies of an Apple operating system, or to 12 + * circumvent, violate, or enable the circumvention or violation of, any 13 + * terms of an Apple operating system software license agreement. 14 + * 15 + * Please obtain a copy of the License at 16 + * http://www.opensource.apple.com/apsl/ and read it before using this file. 17 + * 18 + * The Original Code and all software distributed under the License are 19 + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 20 + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 21 + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 22 + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 23 + * Please see the License for the specific language governing rights and 24 + * limitations under the License. 25 + * 26 + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ 27 + */ 28 + 29 + subsystem 30 + #if KERNEL_USER 31 + KernelUser 32 + #endif /* KERN_USER */ 33 + host_notify_reply 950; 34 + 35 + #include <mach/std_types.defs> 36 + 37 + simpleroutine host_calendar_changed( 38 + notify_port : mach_port_move_send_once_t); 39 + 40 + /* vim: set ft=c : */
+369
kernel/mach/host_priv.defs
··· 1 + /* 2 + * Copyright (c) 2000-2004 Apple Inc. All rights reserved. 3 + * 4 + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ 5 + * 6 + * This file contains Original Code and/or Modifications of Original Code 7 + * as defined in and that are subject to the Apple Public Source License 8 + * Version 2.0 (the 'License'). You may not use this file except in 9 + * compliance with the License. The rights granted to you under the License 10 + * may not be used to create, or enable the creation or redistribution of, 11 + * unlawful or unlicensed copies of an Apple operating system, or to 12 + * circumvent, violate, or enable the circumvention or violation of, any 13 + * terms of an Apple operating system software license agreement. 14 + * 15 + * Please obtain a copy of the License at 16 + * http://www.opensource.apple.com/apsl/ and read it before using this file. 17 + * 18 + * The Original Code and all software distributed under the License are 19 + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 20 + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 21 + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 22 + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 23 + * Please see the License for the specific language governing rights and 24 + * limitations under the License. 25 + * 26 + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ 27 + */ 28 + /* 29 + * @OSF_COPYRIGHT@ 30 + */ 31 + /* 32 + * Mach Operating System 33 + * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University 34 + * All Rights Reserved. 35 + * 36 + * Permission to use, copy, modify and distribute this software and its 37 + * documentation is hereby granted, provided that both the copyright 38 + * notice and this permission notice appear in all copies of the 39 + * software, derivative works or modified versions, and any portions 40 + * thereof, and that both notices appear in supporting documentation. 41 + * 42 + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 43 + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR 44 + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 45 + * 46 + * Carnegie Mellon requests users of this software to return to 47 + * 48 + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 49 + * School of Computer Science 50 + * Carnegie Mellon University 51 + * Pittsburgh PA 15213-3890 52 + * 53 + * any improvements or extensions that they make and grant Carnegie Mellon 54 + * the rights to redistribute these changes. 55 + */ 56 + /* 57 + */ 58 + 59 + /* 60 + * Matchmaker definitions file for Mach kernel interface. 61 + */ 62 + subsystem 63 + #if KERNEL_USER 64 + KernelUser 65 + #endif /* KERNEL_USER */ 66 + #if KERNEL_SERVER 67 + KernelServer 68 + #endif /* KERNEL_SERVER */ 69 + host_priv 400; 70 + 71 + #ifdef KERNEL_USER 72 + userprefix r_; 73 + #endif /* KERNEL_USER */ 74 + 75 + #include <mach/std_types.defs> 76 + #include <mach/mach_types.defs> 77 + #include <mach/clock_types.defs> 78 + #include <mach_debug/mach_debug_types.defs> 79 + 80 + /* 81 + * Get boot configuration information from kernel. 82 + */ 83 + routine host_get_boot_info( 84 + host_priv : host_priv_t; 85 + out boot_info : kernel_boot_info_t); 86 + 87 + /* 88 + * Reboot this host. 89 + * Only available to privileged users. 90 + */ 91 + routine host_reboot( 92 + host_priv : host_priv_t; 93 + options : int); 94 + 95 + 96 + /* 97 + * Return privileged statistics from this host. 98 + */ 99 + routine host_priv_statistics( 100 + host_priv : host_priv_t; 101 + flavor : host_flavor_t; 102 + out host_info_out : host_info_t, CountInOut); 103 + 104 + /* 105 + * Sets the default memory manager, the port to which 106 + * newly-created temporary memory objects are delivered. 107 + * [See (memory_object_default)memory_object_create.] 108 + * Also sets the default cluster size used for pagein/pageout 109 + * to this port. 110 + * The old memory manager port is returned. 111 + */ 112 + routine host_default_memory_manager( 113 + host_priv : host_priv_t; 114 + inout default_manager : memory_object_default_t = 115 + MACH_MSG_TYPE_MAKE_SEND; 116 + cluster_size : memory_object_cluster_size_t); 117 + 118 + 119 + /* 120 + * Specify that the range of the virtual address space 121 + * of the target task must not cause page faults for 122 + * the indicated accesses. 123 + * 124 + * [ To unwire the pages, specify VM_PROT_NONE. ] 125 + */ 126 + routine vm_wire( 127 + host_priv : host_priv_t; 128 + task : vm_map_t; 129 + address : vm_address_t; 130 + size : vm_size_t; 131 + desired_access : vm_prot_t); 132 + 133 + /* 134 + * Specify that the target thread must always be able 135 + * to run and to allocate memory. 136 + */ 137 + routine thread_wire( 138 + host_priv : host_priv_t; 139 + thread : thread_act_t; 140 + wired : boolean_t); 141 + 142 + /* 143 + * Allocate zero-filled, wired, contiguous physical memory 144 + * in the address space of the target task, either at the 145 + * specified address, or wherever space can be found (if 146 + * anywhere is TRUE), of the specified size. The address 147 + * at which the allocation actually took place is returned. 148 + * All pages will be entered into the task's pmap immediately, 149 + * with VM_PROT_ALL. 150 + * 151 + * In addition to all the failure modes of its cousin, 152 + * vm_allocate, this call may also fail if insufficient 153 + * contiguous memory exists to satisfy the request. 154 + * 155 + * Memory obtained from this call should be freed the 156 + * normal way, via vm_deallocate. 157 + * 158 + * N.B. This is an EXPERIMENTAL interface! 159 + */ 160 + routine vm_allocate_cpm( 161 + host_priv : host_priv_t; 162 + task : vm_map_t; 163 + inout address : vm_address_t; 164 + size : vm_size_t; 165 + flags : int); 166 + 167 + /* 168 + * Get list of processors on this host. 169 + */ 170 + routine host_processors( 171 + host_priv : host_priv_t; 172 + out out_processor_list : processor_array_t); 173 + 174 + 175 + /* 176 + * Get control port for a system-wide clock. 177 + * Privileged. 178 + */ 179 + routine host_get_clock_control( 180 + host_priv : host_priv_t; 181 + clock_id : clock_id_t; 182 + out clock_ctrl : clock_ctrl_t); 183 + 184 + 185 + /* 186 + * kernel module interface (obsolete as of SnowLeopard) 187 + * see mach/kmod.h 188 + */ 189 + /* kmod_ MIG calls now return KERN_NOT_SUPPORTED on PPC/i386/x86_64. */ 190 + routine kmod_create( 191 + host_priv : host_priv_t; 192 + info : vm_address_t; 193 + out module : kmod_t); 194 + 195 + routine kmod_destroy( 196 + host_priv : host_priv_t; 197 + module : kmod_t); 198 + 199 + routine kmod_control( 200 + host_priv : host_priv_t; 201 + module : kmod_t; 202 + flavor : kmod_control_flavor_t; 203 + inout data : kmod_args_t); 204 + 205 + /* 206 + * Get a given special port for a given node. 207 + * Special ports are defined in host_special_ports.h; 208 + * examples include the master device port. 209 + * There are a limited number of slots available for system servers. 210 + */ 211 + routine host_get_special_port( 212 + host_priv : host_priv_t; 213 + node : int; 214 + which : int; 215 + out port : mach_port_t); 216 + 217 + /* 218 + * Set a given special port for the local node. 219 + * See host_get_special_port. 220 + */ 221 + routine host_set_special_port( 222 + host_priv : host_priv_t; 223 + which : int; 224 + port : mach_port_t); 225 + 226 + /* 227 + * Set an exception handler for a host on one or more exception types. 228 + * These handlers are invoked for all threads on the host if there are 229 + * no task or thread-specific exception handlers or those handlers returned 230 + * an error. 231 + */ 232 + routine host_set_exception_ports( 233 + host_priv : host_priv_t; 234 + exception_mask : exception_mask_t; 235 + new_port : mach_port_t; 236 + behavior : exception_behavior_t; 237 + new_flavor : thread_state_flavor_t); 238 + 239 + 240 + /* 241 + * Lookup some of the old exception handlers for a host 242 + */ 243 + routine host_get_exception_ports( 244 + host_priv : host_priv_t; 245 + exception_mask : exception_mask_t; 246 + out masks : exception_mask_array_t; 247 + out old_handlers : exception_handler_array_t, SameCount; 248 + out old_behaviors : exception_behavior_array_t, SameCount; 249 + out old_flavors : exception_flavor_array_t, SameCount); 250 + 251 + 252 + /* 253 + * Set an exception handler for a host on one or more exception types. 254 + * At the same time, return the previously defined exception handlers for 255 + * those types. 256 + */ 257 + routine host_swap_exception_ports( 258 + host_priv : host_priv_t; 259 + exception_mask : exception_mask_t; 260 + new_port : mach_port_t; 261 + behavior : exception_behavior_t; 262 + new_flavor : thread_state_flavor_t; 263 + out masks : exception_mask_array_t; 264 + out old_handlerss : exception_handler_array_t, SameCount; 265 + out old_behaviors : exception_behavior_array_t, SameCount; 266 + out old_flavors : exception_flavor_array_t, SameCount); 267 + 268 + skip; /* old host_load_symbol_table */ 269 + 270 + /* 271 + * Specify that the range of the virtual address space 272 + * of the target task must not cause page faults for 273 + * the indicated accesses. 274 + * 275 + * [ To unwire the pages, specify VM_PROT_NONE. ] 276 + */ 277 + routine mach_vm_wire( 278 + host_priv : host_priv_t; 279 + task : vm_map_t; 280 + address : mach_vm_address_t; 281 + size : mach_vm_size_t; 282 + desired_access : vm_prot_t); 283 + 284 + /* 285 + * JMM - Keep all processor_set related items at the end for easy 286 + * removal. 287 + */ 288 + /* 289 + * List all processor sets on host. 290 + */ 291 + routine host_processor_sets( 292 + host_priv : host_priv_t; 293 + out processor_sets : processor_set_name_array_t); 294 + 295 + /* 296 + * Get control port for a processor set. 297 + */ 298 + routine host_processor_set_priv( 299 + host_priv : host_priv_t; 300 + set_name : processor_set_name_t; 301 + out set : processor_set_t); 302 + 303 + /************************** Warning *************************************/ 304 + /* The following routines are going away in a future release */ 305 + /* use the appropriate variant of host_set_special_port instead */ 306 + /************************************************************************/ 307 + 308 + /* 309 + * Set the dynamic_pager control port. Other entities 310 + * can request a send right to this port to talk with 311 + * the dynamic_pager utility, setting behavioral parameters 312 + * within the dynamic pager and getting low/high backing store 313 + * resource notifications. 314 + */ 315 + routine set_dp_control_port( 316 + host : host_priv_t; 317 + in control_port : mach_port_t); 318 + 319 + /* 320 + * Get the dynamic_pager control port. This port 321 + * allows the holder to talk directly with the dynamic 322 + * pager utility. 323 + */ 324 + routine get_dp_control_port( 325 + host : host_priv_t; 326 + out contorl_port :mach_port_t); 327 + 328 + /* 329 + * Set the UserNotification daemon access port for this host. 330 + * If this value is already set, the kernel will discard its 331 + * reference to the previously registered port. 332 + */ 333 + routine host_set_UNDServer( 334 + host : host_priv_t; 335 + in server : UNDServerRef); 336 + 337 + /* 338 + * Get the UserNotification daemon access port for this host. 339 + * This can then be used to communicate with that daemon, which 340 + * in turn communicates with the User through whatever means 341 + * available (pop-up-menus for GUI systems, text for non-GUI, etc..). 342 + * 343 + * Access to this port is restricted to privileged clients because 344 + * it is a special purpose port intended for kernel clients. User 345 + * level clients should go directly to the CFUserNotifcation services. 346 + */ 347 + routine host_get_UNDServer( 348 + host : host_priv_t; 349 + out server : UNDServerRef); 350 + 351 + /* 352 + * Perform an operation with a kernel extension, on the kext loading system, 353 + * or request information about loaded kexts or the state of the kext loading 354 + * system. 355 + * Active operations (load, unload, disable/enable) require host_priv/root access. 356 + * Info retrieval does not. 357 + * 358 + * WARNING: THIS ROUTINE IS PRIVATE TO THE KEXT-MANAGEMENT STACK AND IS 359 + * SUBJECT TO CHANGE AT ANY TIME. 360 + */ 361 + routine kext_request( 362 + host_priv : host_priv_t; 363 + in user_log_flags : uint32_t; 364 + in request_data : pointer_t; 365 + out response_data : pointer_t; 366 + out log_data : pointer_t; 367 + out op_result : kern_return_t); 368 + 369 + /* vim: set ft=c : */
+101
kernel/mach/host_security.defs
··· 1 + /* 2 + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. 3 + * 4 + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ 5 + * 6 + * This file contains Original Code and/or Modifications of Original Code 7 + * as defined in and that are subject to the Apple Public Source License 8 + * Version 2.0 (the 'License'). You may not use this file except in 9 + * compliance with the License. The rights granted to you under the License 10 + * may not be used to create, or enable the creation or redistribution of, 11 + * unlawful or unlicensed copies of an Apple operating system, or to 12 + * circumvent, violate, or enable the circumvention or violation of, any 13 + * terms of an Apple operating system software license agreement. 14 + * 15 + * Please obtain a copy of the License at 16 + * http://www.opensource.apple.com/apsl/ and read it before using this file. 17 + * 18 + * The Original Code and all software distributed under the License are 19 + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 20 + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 21 + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 22 + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 23 + * Please see the License for the specific language governing rights and 24 + * limitations under the License. 25 + * 26 + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ 27 + */ 28 + /* 29 + * @OSF_COPYRIGHT@ 30 + */ 31 + /* 32 + * Mach Operating System 33 + * Copyright (c) 1991,1990,1989 Carnegie Mellon University 34 + * All Rights Reserved. 35 + * 36 + * Permission to use, copy, modify and distribute this software and its 37 + * documentation is hereby granted, provided that both the copyright 38 + * notice and this permission notice appear in all copies of the 39 + * software, derivative works or modified versions, and any portions 40 + * thereof, and that both notices appear in supporting documentation. 41 + * 42 + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 43 + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR 44 + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 45 + * 46 + * Carnegie Mellon requests users of this software to return to 47 + * 48 + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 49 + * School of Computer Science 50 + * Carnegie Mellon University 51 + * Pittsburgh PA 15213-3890 52 + * 53 + * any improvements or extensions that they make and grant Carnegie Mellon 54 + * the rights to redistribute these changes. 55 + */ 56 + /* 57 + */ 58 + 59 + /* 60 + * File: mach/host_security.defs 61 + * 62 + * Abstract: 63 + * Mach host security operations support. 64 + */ 65 + subsystem 66 + #if KERNEL_SERVER 67 + KernelServer 68 + #endif /* KERNEL_SERVER */ 69 + host_security 600; 70 + 71 + /* 72 + * Basic types 73 + */ 74 + #include <mach/std_types.defs> 75 + #include <mach/mach_types.defs> 76 + 77 + 78 + /* 79 + * Create a new task with an explicit security token 80 + */ 81 + routine host_security_create_task_token( 82 + host_security : host_security_t; 83 + parent_task : task_t; 84 + sec_token : security_token_t; 85 + audit_token : audit_token_t; 86 + host : host_t; 87 + ledgers : ledger_array_t; 88 + inherit_memory : boolean_t; 89 + out child_task : task_t); 90 + 91 + /* 92 + * Change a task's security token 93 + */ 94 + routine host_security_set_task_token( 95 + host_security : host_security_t; 96 + target_task : task_t; 97 + sec_token : security_token_t; 98 + audit_token : audit_token_t; 99 + host : host_t); 100 + 101 + /* vim: set ft=c : */
+48
kernel/mach/ledger.defs
··· 1 + /* 2 + * Copyright (c) 2010 Apple Computer, Inc. All rights reserved. 3 + * 4 + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ 5 + * 6 + * This file contains Original Code and/or Modifications of Original Code 7 + * as defined in and that are subject to the Apple Public Source License 8 + * Version 2.0 (the 'License'). You may not use this file except in 9 + * compliance with the License. The rights granted to you under the License 10 + * may not be used to create, or enable the creation or redistribution of, 11 + * unlawful or unlicensed copies of an Apple operating system, or to 12 + * circumvent, violate, or enable the circumvention or violation of, any 13 + * terms of an Apple operating system software license agreement. 14 + * 15 + * Please obtain a copy of the License at 16 + * http://www.opensource.apple.com/apsl/ and read it before using this file. 17 + * 18 + * The Original Code and all software distributed under the License are 19 + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 20 + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 21 + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 22 + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 23 + * Please see the License for the specific language governing rights and 24 + * limitations under the License. 25 + * 26 + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ 27 + */ 28 + /* 29 + * @OSF_COPYRIGHT@ 30 + */ 31 + 32 + subsystem 33 + #if KERNEL_USER 34 + KernelUser 35 + #endif /* KERNEL_USER */ 36 + #if KERNEL_SERVER 37 + KernelServer 38 + #endif /* KERNEL_SERVER */ 39 + ledger 5000; 40 + 41 + #ifdef KERNEL_USER 42 + userprefix r_; 43 + #endif /* KERNEL_USER */ 44 + 45 + #include <mach/std_types.defs> 46 + #include <mach/mach_types.defs> 47 + 48 + /* vim: set ft=c : */
+83
kernel/mach/lock_set.defs
··· 1 + /* 2 + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. 3 + * 4 + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ 5 + * 6 + * This file contains Original Code and/or Modifications of Original Code 7 + * as defined in and that are subject to the Apple Public Source License 8 + * Version 2.0 (the 'License'). You may not use this file except in 9 + * compliance with the License. The rights granted to you under the License 10 + * may not be used to create, or enable the creation or redistribution of, 11 + * unlawful or unlicensed copies of an Apple operating system, or to 12 + * circumvent, violate, or enable the circumvention or violation of, any 13 + * terms of an Apple operating system software license agreement. 14 + * 15 + * Please obtain a copy of the License at 16 + * http://www.opensource.apple.com/apsl/ and read it before using this file. 17 + * 18 + * The Original Code and all software distributed under the License are 19 + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 20 + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 21 + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 22 + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 23 + * Please see the License for the specific language governing rights and 24 + * limitations under the License. 25 + * 26 + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ 27 + */ 28 + /* 29 + * @OSF_COPYRIGHT@ 30 + * 31 + */ 32 + /* 33 + * File: mach/lock_set.defs 34 + * Author: Joseph CaraDonna 35 + * 36 + * Exported kernel calls 37 + * 38 + */ 39 + 40 + subsystem 41 + #if KERNEL_SERVER 42 + KernelServer 43 + #endif /* KERNEL_SERVER */ 44 + lock_set 617000; 45 + 46 + #include <mach/std_types.defs> 47 + #include <mach/mach_types.defs> 48 + 49 + /* 50 + * OBSOLETE interfaces 51 + * a lock_set_t is created and destroyed through the task object. 52 + * lock_set_create(task,&lock_set_t,...); 53 + * lock_set_destroy(task,lock_set_t); 54 + */ 55 + 56 + /* 57 + * OBSOLETE interfaces 58 + */ 59 + routine lock_acquire( 60 + lock_set : lock_set_t; 61 + lock_id : int); 62 + 63 + routine lock_release( 64 + lock_set : lock_set_t; 65 + lock_id : int); 66 + 67 + routine lock_try( 68 + lock_set : lock_set_t; 69 + lock_id : int); 70 + 71 + routine lock_make_stable( 72 + lock_set : lock_set_t; 73 + lock_id : int); 74 + 75 + routine lock_handoff( 76 + lock_set : lock_set_t; 77 + lock_id : int); 78 + 79 + routine lock_handoff_accept( 80 + lock_set : lock_set_t; 81 + lock_id : int); 82 + 83 + /* vim: set ft=c : */
+119
kernel/mach/mach_exc.defs
··· 1 + /* 2 + * Copyright (c) 2006 Apple Computer, Inc. All rights reserved. 3 + * 4 + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ 5 + * 6 + * This file contains Original Code and/or Modifications of Original Code 7 + * as defined in and that are subject to the Apple Public Source License 8 + * Version 2.0 (the 'License'). You may not use this file except in 9 + * compliance with the License. The rights granted to you under the License 10 + * may not be used to create, or enable the creation or redistribution of, 11 + * unlawful or unlicensed copies of an Apple operating system, or to 12 + * circumvent, violate, or enable the circumvention or violation of, any 13 + * terms of an Apple operating system software license agreement. 14 + * 15 + * Please obtain a copy of the License at 16 + * http://www.opensource.apple.com/apsl/ and read it before using this file. 17 + * 18 + * The Original Code and all software distributed under the License are 19 + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 20 + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 21 + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 22 + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 23 + * Please see the License for the specific language governing rights and 24 + * limitations under the License. 25 + * 26 + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ 27 + */ 28 + /* 29 + * @OSF_COPYRIGHT@ 30 + */ 31 + /* 32 + * Mach Operating System 33 + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University 34 + * All Rights Reserved. 35 + * 36 + * Permission to use, copy, modify and distribute this software and its 37 + * documentation is hereby granted, provided that both the copyright 38 + * notice and this permission notice appear in all copies of the 39 + * software, derivative works or modified versions, and any portions 40 + * thereof, and that both notices appear in supporting documentation. 41 + * 42 + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 43 + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR 44 + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 45 + * 46 + * Carnegie Mellon requests users of this software to return to 47 + * 48 + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 49 + * School of Computer Science 50 + * Carnegie Mellon University 51 + * Pittsburgh PA 15213-3890 52 + * 53 + * any improvements or extensions that they make and grant Carnegie Mellon 54 + * the rights to redistribute these changes. 55 + */ 56 + /* 57 + */ 58 + /* 59 + * Abstract: 60 + * MiG definitions file for Mach exception interface. 61 + */ 62 + 63 + subsystem 64 + #if KERNEL_USER 65 + KernelUser 66 + #endif 67 + mach_exc 2405; 68 + 69 + #include <mach/std_types.defs> 70 + #include <mach/mach_types.defs> 71 + 72 + ServerPrefix catch_; 73 + 74 + type mach_exception_data_t = array[*:2] of int64_t; 75 + type exception_type_t = int; 76 + 77 + routine mach_exception_raise( 78 + #if KERNEL_USER 79 + exception_port : mach_port_move_send_t; 80 + thread : mach_port_move_send_t; 81 + task : mach_port_move_send_t; 82 + #else /* KERNEL_USER */ 83 + exception_port : mach_port_t; 84 + thread : mach_port_t; 85 + task : mach_port_t; 86 + #endif /* KERNEL_USER */ 87 + exception : exception_type_t; 88 + code : mach_exception_data_t 89 + ); 90 + 91 + routine mach_exception_raise_state( 92 + #if KERNEL_USER 93 + exception_port : mach_port_move_send_t; 94 + #else /* KERNEL_USER */ 95 + exception_port : mach_port_t; 96 + #endif /* KERNEL_USER */ 97 + exception : exception_type_t; 98 + code : mach_exception_data_t, const; 99 + inout flavor : int; 100 + old_state : thread_state_t, const; 101 + out new_state : thread_state_t); 102 + 103 + routine mach_exception_raise_state_identity( 104 + #if KERNEL_USER 105 + exception_port : mach_port_move_send_t; 106 + thread : mach_port_move_send_t; 107 + task : mach_port_move_send_t; 108 + #else /* KERNEL_USER */ 109 + exception_port : mach_port_t; 110 + thread : mach_port_t; 111 + task : mach_port_t; 112 + #endif /* KERNEL_USER */ 113 + exception : exception_type_t; 114 + code : mach_exception_data_t; 115 + inout flavor : int; 116 + old_state : thread_state_t; 117 + out new_state : thread_state_t); 118 + 119 + /* vim: set ft=c : */
+303
kernel/mach/mach_host.defs
··· 1 + /* 2 + * Copyright (c) 2000-2009 Apple Inc. All rights reserved. 3 + * 4 + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ 5 + * 6 + * This file contains Original Code and/or Modifications of Original Code 7 + * as defined in and that are subject to the Apple Public Source License 8 + * Version 2.0 (the 'License'). You may not use this file except in 9 + * compliance with the License. The rights granted to you under the License 10 + * may not be used to create, or enable the creation or redistribution of, 11 + * unlawful or unlicensed copies of an Apple operating system, or to 12 + * circumvent, violate, or enable the circumvention or violation of, any 13 + * terms of an Apple operating system software license agreement. 14 + * 15 + * Please obtain a copy of the License at 16 + * http://www.opensource.apple.com/apsl/ and read it before using this file. 17 + * 18 + * The Original Code and all software distributed under the License are 19 + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 20 + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 21 + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 22 + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 23 + * Please see the License for the specific language governing rights and 24 + * limitations under the License. 25 + * 26 + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ 27 + */ 28 + /* 29 + * @OSF_COPYRIGHT@ 30 + */ 31 + /* 32 + * Mach Operating System 33 + * Copyright (c) 1991,1990,1989 Carnegie Mellon University 34 + * All Rights Reserved. 35 + * 36 + * Permission to use, copy, modify and distribute this software and its 37 + * documentation is hereby granted, provided that both the copyright 38 + * notice and this permission notice appear in all copies of the 39 + * software, derivative works or modified versions, and any portions 40 + * thereof, and that both notices appear in supporting documentation. 41 + * 42 + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 43 + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR 44 + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 45 + * 46 + * Carnegie Mellon requests users of this software to return to 47 + * 48 + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 49 + * School of Computer Science 50 + * Carnegie Mellon University 51 + * Pittsburgh PA 15213-3890 52 + * 53 + * any improvements or extensions that they make and grant Carnegie Mellon 54 + * the rights to redistribute these changes. 55 + */ 56 + /* 57 + */ 58 + 59 + /* 60 + * File: mach/mach_host.defs 61 + * 62 + * Abstract: 63 + * Mach host operations support. Includes processor allocation and 64 + * control. 65 + */ 66 + 67 + subsystem 68 + #if KERNEL_SERVER 69 + KernelServer 70 + #endif /* KERNEL_SERVER */ 71 + mach_host 200; 72 + 73 + /* 74 + * Basic types 75 + */ 76 + 77 + #include <mach/std_types.defs> 78 + #include <mach/mach_types.defs> 79 + #include <mach/clock_types.defs> 80 + #include <mach_debug/mach_debug_types.defs> 81 + 82 + /* 83 + * References to host objects are returned by: 84 + * mach_host_self() - trap 85 + */ 86 + 87 + /* 88 + * Return information about this host. 89 + */ 90 + routine host_info( 91 + host : host_t; 92 + flavor : host_flavor_t; 93 + out host_info_out : host_info_t, CountInOut); 94 + 95 + /* 96 + * Get string describing current kernel version. 97 + */ 98 + routine host_kernel_version( 99 + host : host_t; 100 + out kernel_version : kernel_version_t); 101 + 102 + /* 103 + * Get host page size 104 + * (compatibility for running old libraries on new kernels - 105 + * host_page_size() is now a library routine based on constants) 106 + */ 107 + #if KERNEL 108 + routine host_page_size( 109 + #else 110 + routine _host_page_size( 111 + #endif 112 + host : host_t; 113 + out out_page_size : vm_size_t); 114 + 115 + /* 116 + * Allow pagers to create named entries that point to un-mapped 117 + * abstract memory object. The named entries are generally mappable 118 + * and can be subsetted through the mach_make_memory_entry call 119 + */ 120 + routine mach_memory_object_memory_entry( 121 + host :host_t; 122 + internal :boolean_t; 123 + size :vm_size_t; 124 + permission :vm_prot_t; 125 + pager :memory_object_t; 126 + out entry_handle :mach_port_move_send_t); 127 + 128 + 129 + /* 130 + * Get processor info for all the processors on this host. 131 + * The returned data is an OOL array of processor info. 132 + */ 133 + routine host_processor_info( 134 + host : host_t; 135 + flavor : processor_flavor_t; 136 + out out_processor_count : natural_t; 137 + out out_processor_info : processor_info_array_t); 138 + 139 + /* 140 + * Return host IO master access port 141 + */ 142 + routine host_get_io_master( 143 + host : host_t; 144 + out io_master : io_master_t); 145 + 146 + /* 147 + * Get service port for a processor set. 148 + * Available to all. 149 + */ 150 + routine host_get_clock_service( 151 + host : host_t; 152 + clock_id : clock_id_t; 153 + out clock_serv : clock_serv_t); 154 + 155 + /* 156 + * kernel module interface (obsolete as of SnowLeopard) 157 + * see mach/kmod.h 158 + */ 159 + /* kmod_ MIG calls now return KERN_NOT_SUPPORTED on PPC/i386/x86_64. */ 160 + routine kmod_get_info( 161 + host : host_t; 162 + out modules : kmod_args_t); 163 + 164 + /* 165 + * Returns information about the memory allocation zones. 166 + * Supported in all kernels.. 167 + * 168 + * DEPRECATED! Use mach_zone_info() instead. 169 + */ 170 + routine host_zone_info( 171 + host : host_priv_t; 172 + out names : zone_name_array_t, 173 + Dealloc; 174 + out info : zone_info_array_t, 175 + Dealloc); 176 + 177 + /* 178 + * Returns information about the global VP table. 179 + * Only supported in MACH_VM_DEBUG kernels, 180 + * otherwise returns KERN_FAILURE. 181 + */ 182 + routine host_virtual_physical_table_info( 183 + host : host_t; 184 + out info : hash_info_bucket_array_t, 185 + Dealloc); 186 + 187 + 188 + skip; /* was host_ipc_hash_info */ 189 + skip; /* was enable_bluebox */ 190 + skip; /* was disable_bluebox */ 191 + 192 + /* 193 + * JMM - Keep processor_set related items at the end for easy 194 + * removal. 195 + */ 196 + /* 197 + * Get default processor set for host. 198 + */ 199 + routine processor_set_default( 200 + host : host_t; 201 + out default_set : processor_set_name_t); 202 + 203 + /* 204 + * Create new processor set. Returns real port for manipulations, 205 + * and name port for obtaining information. 206 + */ 207 + routine processor_set_create( 208 + host : host_t; 209 + out new_set : processor_set_t; 210 + out new_name : processor_set_name_t); 211 + 212 + /* 213 + * Temporary interfaces for conversion to 64 bit data path 214 + */ 215 + 216 + routine mach_memory_object_memory_entry_64( 217 + host :host_t; 218 + internal :boolean_t; 219 + size :memory_object_size_t; 220 + permission :vm_prot_t; 221 + pager :memory_object_t; 222 + out entry_handle :mach_port_move_send_t); 223 + 224 + /* 225 + * Return statistics from this host. 226 + */ 227 + routine host_statistics( 228 + host_priv : host_t; 229 + flavor : host_flavor_t; 230 + out host_info_out : host_info_t, CountInOut); 231 + 232 + routine host_request_notification( 233 + host : host_t; 234 + notify_type : host_flavor_t; 235 + notify_port : mach_port_make_send_once_t); 236 + 237 + routine host_lockgroup_info( 238 + host : host_t; 239 + out lockgroup_info : lockgroup_info_array_t, 240 + Dealloc); 241 + 242 + /* 243 + * Return 64-bit statistics from this host. 244 + */ 245 + routine host_statistics64( 246 + host_priv : host_t; 247 + flavor : host_flavor_t; 248 + out host_info64_out : host_info64_t, CountInOut); 249 + 250 + /* 251 + * Returns information about the memory allocation zones. 252 + * Data returned is compatible with various caller and kernel 253 + * address space sizes (unlike host_zone_info()). 254 + */ 255 + routine mach_zone_info( 256 + host : host_priv_t; 257 + out names : mach_zone_name_array_t, 258 + Dealloc; 259 + out info : mach_zone_info_array_t, 260 + Dealloc); 261 + 262 + #ifdef PRIVATE 263 + /* 264 + * Forces a zone allocator garbage collections pass. 265 + * Pages with no in-use allocations are returned to 266 + * the VM system for re-use. 267 + */ 268 + routine mach_zone_force_gc( 269 + host : host_t); 270 + #else 271 + skip; 272 + #endif 273 + 274 + /* 275 + * Create a new voucher by running a series of commands against 276 + * <key, previous-voucher> pairs of resource attributes. 277 + */ 278 + routine host_create_mach_voucher( 279 + host : host_t; 280 + recipes : mach_voucher_attr_raw_recipe_array_t; 281 + out voucher : ipc_voucher_t); 282 + 283 + /* 284 + * Register a resource manager with the kernel. A new key is selected. 285 + */ 286 + routine host_register_mach_voucher_attr_manager( 287 + host : host_t; 288 + attr_manager : mach_voucher_attr_manager_t; 289 + default_value : mach_voucher_attr_value_handle_t; 290 + out new_key : mach_voucher_attr_key_t; 291 + out new_attr_control: ipc_voucher_attr_control_t); 292 + 293 + /* 294 + * Register a resource manager (with a well-known key value) with the kernel. 295 + */ 296 + routine host_register_well_known_mach_voucher_attr_manager( 297 + host : host_t; 298 + attr_manager : mach_voucher_attr_manager_t; 299 + default_value : mach_voucher_attr_value_handle_t; 300 + key : mach_voucher_attr_key_t; 301 + out new_attr_control: ipc_voucher_attr_control_t); 302 + 303 + /* vim: set ft=c : */
+38
kernel/mach/mach_notify.defs
··· 1 + /* 2 + * Copyright (c) 2000-2003 Apple Computer, Inc. All rights reserved. 3 + * 4 + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ 5 + * 6 + * This file contains Original Code and/or Modifications of Original Code 7 + * as defined in and that are subject to the Apple Public Source License 8 + * Version 2.0 (the 'License'). You may not use this file except in 9 + * compliance with the License. The rights granted to you under the License 10 + * may not be used to create, or enable the creation or redistribution of, 11 + * unlawful or unlicensed copies of an Apple operating system, or to 12 + * circumvent, violate, or enable the circumvention or violation of, any 13 + * terms of an Apple operating system software license agreement. 14 + * 15 + * Please obtain a copy of the License at 16 + * http://www.opensource.apple.com/apsl/ and read it before using this file. 17 + * 18 + * The Original Code and all software distributed under the License are 19 + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 20 + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 21 + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 22 + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 23 + * Please see the License for the specific language governing rights and 24 + * limitations under the License. 25 + * 26 + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ 27 + */ 28 + /* 29 + * The mach/notify.h file is hand-crafted. 30 + * It contains additional data that cannot be generated by MIG at this time. 31 + * But its existence keeps us from having MIG generate the client-side 32 + * routines to send Mach notifications. This file exists simply to give 33 + * those routines a new home (mach/mach_notify.h and mach_notify_user.c) 34 + * until the real notify.h becomes "MIG-safe." 35 + */ 36 + #include <mach/notify.defs> 37 + 38 + /* vim: set ft=c : */
+614
kernel/mach/mach_port.defs
··· 1 + /* 2 + * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. 3 + * 4 + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ 5 + * 6 + * This file contains Original Code and/or Modifications of Original Code 7 + * as defined in and that are subject to the Apple Public Source License 8 + * Version 2.0 (the 'License'). You may not use this file except in 9 + * compliance with the License. The rights granted to you under the License 10 + * may not be used to create, or enable the creation or redistribution of, 11 + * unlawful or unlicensed copies of an Apple operating system, or to 12 + * circumvent, violate, or enable the circumvention or violation of, any 13 + * terms of an Apple operating system software license agreement. 14 + * 15 + * Please obtain a copy of the License at 16 + * http://www.opensource.apple.com/apsl/ and read it before using this file. 17 + * 18 + * The Original Code and all software distributed under the License are 19 + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 20 + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 21 + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 22 + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 23 + * Please see the License for the specific language governing rights and 24 + * limitations under the License. 25 + * 26 + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ 27 + */ 28 + /* 29 + * @OSF_FREE_COPYRIGHT@ 30 + */ 31 + /* 32 + * Mach Operating System 33 + * Copyright (c) 1991,1990,1989 Carnegie Mellon University 34 + * All Rights Reserved. 35 + * 36 + * Permission to use, copy, modify and distribute this software and its 37 + * documentation is hereby granted, provided that both the copyright 38 + * notice and this permission notice appear in all copies of the 39 + * software, derivative works or modified versions, and any portions 40 + * thereof, and that both notices appear in supporting documentation. 41 + * 42 + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 43 + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR 44 + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 45 + * 46 + * Carnegie Mellon requests users of this software to return to 47 + * 48 + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 49 + * School of Computer Science 50 + * Carnegie Mellon University 51 + * Pittsburgh PA 15213-3890 52 + * 53 + * any improvements or extensions that they make and grant Carnegie Mellon 54 + * the rights to redistribute these changes. 55 + */ 56 + /* 57 + */ 58 + /* 59 + * File: mach/mach_port.defs 60 + * Author: Rich Draves 61 + * 62 + * Exported kernel calls. 63 + */ 64 + 65 + subsystem 66 + #if KERNEL_SERVER 67 + KernelServer 68 + #endif /* KERNEL_SERVER */ 69 + mach_port 3200; 70 + 71 + #if !KERNEL && !LIBSYSCALL_INTERFACE 72 + UserPrefix _kernelrpc_; 73 + #endif 74 + 75 + #include <mach/std_types.defs> 76 + #include <mach/mach_types.defs> 77 + #include <mach_debug/mach_debug_types.defs> 78 + 79 + /* 80 + * Returns the set of port and port set names 81 + * to which the target task has access, along with 82 + * the type (set or port) for each name. 83 + */ 84 + 85 + routine mach_port_names( 86 + task : ipc_space_t; 87 + out names : mach_port_name_array_t; 88 + out types : mach_port_type_array_t); 89 + 90 + /* 91 + * Returns the type (set or port) for the port name 92 + * within the target task. Also indicates whether 93 + * there is a dead-name request for the name. 94 + */ 95 + 96 + routine mach_port_type( 97 + task : ipc_space_t; 98 + name : mach_port_name_t; 99 + out ptype : mach_port_type_t); 100 + 101 + /* 102 + * Changes the name by which a port (or port set) is known to 103 + * the target task. The new name can't be in use. The 104 + * old name becomes available for recycling. 105 + * 106 + * This interface is OBSOLETE and will always 107 + * return KERN_NOT_SUPPORTED. 108 + */ 109 + 110 + routine mach_port_rename( 111 + task : ipc_space_t; 112 + old_name : mach_port_name_t; 113 + new_name : mach_port_name_t); 114 + 115 + /* 116 + * Allocates the specified kind of object, with the given name. 117 + * The right must be one of 118 + * MACH_PORT_RIGHT_RECEIVE 119 + * MACH_PORT_RIGHT_PORT_SET 120 + * MACH_PORT_RIGHT_DEAD_NAME 121 + * New port sets are empty. New ports don't have any 122 + * send/send-once rights or queued messages. The make-send 123 + * count is zero and their queue limit is MACH_PORT_QLIMIT_DEFAULT. 124 + * New sets, ports, and dead names have one user reference. 125 + */ 126 + 127 + routine mach_port_allocate_name( 128 + task : ipc_space_t; 129 + right : mach_port_right_t; 130 + name : mach_port_name_t); 131 + 132 + /* 133 + * Allocates the specified kind of object. 134 + * The right must be one of 135 + * MACH_PORT_RIGHT_RECEIVE 136 + * MACH_PORT_RIGHT_PORT_SET 137 + * MACH_PORT_RIGHT_DEAD_NAME 138 + * Like port_allocate_name, but the kernel picks a name. 139 + * It can use any name not associated with a right. 140 + */ 141 + 142 + routine mach_port_allocate( 143 + task : ipc_space_t; 144 + right : mach_port_right_t; 145 + out name : mach_port_name_t); 146 + 147 + /* 148 + * Destroys all rights associated with the name and makes it 149 + * available for recycling immediately. The name can be a 150 + * port (possibly with multiple user refs), a port set, or 151 + * a dead name (again, with multiple user refs). 152 + */ 153 + 154 + routine mach_port_destroy( 155 + task : ipc_space_t; 156 + name : mach_port_name_t); 157 + 158 + /* 159 + * Releases one send/send-once/dead-name user ref. 160 + * Just like mach_port_mod_refs -1, but deduces the 161 + * correct type of right. This allows a user task 162 + * to release a ref for a port without worrying 163 + * about whether the port has died or not. 164 + */ 165 + 166 + routine mach_port_deallocate( 167 + task : ipc_space_t; 168 + name : mach_port_name_t); 169 + 170 + /* 171 + * A port set always has one user ref. 172 + * A send-once right always has one user ref. 173 + * A dead name always has one or more user refs. 174 + * A send right always has one or more user refs. 175 + * A receive right always has one user ref. 176 + * The right must be one of 177 + * MACH_PORT_RIGHT_RECEIVE 178 + * MACH_PORT_RIGHT_PORT_SET 179 + * MACH_PORT_RIGHT_DEAD_NAME 180 + * MACH_PORT_RIGHT_SEND 181 + * MACH_PORT_RIGHT_SEND_ONCE 182 + */ 183 + 184 + routine mach_port_get_refs( 185 + task : ipc_space_t; 186 + name : mach_port_name_t; 187 + right : mach_port_right_t; 188 + out refs : mach_port_urefs_t); 189 + 190 + /* 191 + * The delta is a signed change to the task's 192 + * user ref count for the right. Only dead names 193 + * and send rights can have a positive delta. 194 + * The resulting user ref count can't be negative. 195 + * If it is zero, the right is deallocated. 196 + * If the name isn't a composite right, it becomes 197 + * available for recycling. The right must be one of 198 + * MACH_PORT_RIGHT_RECEIVE 199 + * MACH_PORT_RIGHT_PORT_SET 200 + * MACH_PORT_RIGHT_DEAD_NAME 201 + * MACH_PORT_RIGHT_SEND 202 + * MACH_PORT_RIGHT_SEND_ONCE 203 + */ 204 + 205 + routine mach_port_mod_refs( 206 + task : ipc_space_t; 207 + name : mach_port_name_t; 208 + right : mach_port_right_t; 209 + delta : mach_port_delta_t); 210 + 211 + /* 212 + * Peek at the message queue for the specified receive 213 + * right and return info about the message with the 214 + * sequence number matching the input. If zero is 215 + * specified as the seqno, the first message in the 216 + * queue will be peeked. 217 + * 218 + * Only the following trailer types are currently supported: 219 + * MACH_RCV_TRAILER_TYPE(MACH_MSG_TRAILER_FORMAT_0) 220 + * 221 + * or'ed with one of these element types: 222 + * MACH_RCV_TRAILER_ELEMENTS(MACH_RCV_TRAILER_NULL) 223 + * MACH_RCV_TRAILER_ELEMENTS(MACH_RCV_TRAILER_SEQNO) 224 + * MACH_RCV_TRAILER_ELEMENTS(MACH_RCV_TRAILER_SENDER) 225 + * MACH_RCV_TRAILER_ELEMENTS(MACH_RCV_TRAILER_AUDIT) 226 + */ 227 + routine mach_port_peek( 228 + task : ipc_space_t; 229 + name : mach_port_name_t; 230 + trailer_type : mach_msg_trailer_type_t; 231 + inout request_seqnop : mach_port_seqno_t; 232 + out msg_sizep : mach_msg_size_t; 233 + out msg_idp : mach_msg_id_t; 234 + out trailer_infop : mach_msg_trailer_info_t, CountInOut); 235 + 236 + /* 237 + * Only valid for receive rights. 238 + * Sets the make-send count for the port. 239 + */ 240 + routine mach_port_set_mscount( 241 + task : ipc_space_t; 242 + name : mach_port_name_t; 243 + mscount : mach_port_mscount_t); 244 + 245 + /* 246 + * Only valid for port sets. Returns a list of 247 + * the members. 248 + */ 249 + 250 + routine mach_port_get_set_status( 251 + task : ipc_space_t; 252 + name : mach_port_name_t; 253 + out members : mach_port_name_array_t); 254 + 255 + /* 256 + * Puts the member port (the task must have receive rights) 257 + * into the after port set. If the port is already a member 258 + * of any set(s), it is atomically removed from those sets as 259 + * part of this operation. (If after is MACH_PORT_NULL, the 260 + * port is still removed from all current sets). 261 + */ 262 + 263 + routine mach_port_move_member( 264 + task : ipc_space_t; 265 + member : mach_port_name_t; 266 + after : mach_port_name_t); 267 + 268 + /* 269 + * Requests a notification from the kernel. The request 270 + * must supply the send-once right which is used for 271 + * the notification. If a send-once right was previously 272 + * registered, it is returned. The msgid must be one of: 273 + * MACH_NOTIFY_PORT_DESTROYED (receive rights) 274 + * MACH_NOTIFY_DEAD_NAME (send/receive/send-once rights) 275 + * MACH_NOTIFY_SEND_POSSIBLE (send/receive/send-once rights) 276 + * MACH_NOTIFY_NO_SENDERS (receive rights) 277 + * 278 + * The sync value specifies whether a notification should 279 + * get sent immediately, if appropriate. The exact meaning 280 + * depends on the notification: 281 + * MACH_NOTIFY_PORT_DESTROYED: must be zero. 282 + * MACH_NOTIFY_DEAD_NAME: if non-zero, then name can be dead, 283 + * and the notification gets sent immediately. 284 + * If zero, then name can't be dead. 285 + * MACH_NOTIFY_SEND_POSSIBLE: if non-zero, will generate a send- 286 + * possible notification as soon as it is possible to send 287 + * to the port. If zero, will generate a send-possible 288 + * notification only after a subsequent failed send 289 + * (with MACH_SEND_NOTIFY option to mach_msg call). Can 290 + * generate a dead-name notification if name is already dead 291 + * or becomes dead before a send-possible notification fires. 292 + * MACH_NOTIFY_NO_SENDERS: the notification gets sent 293 + * immediately if the current mscount is greater 294 + * than or equal to the sync value and there are no 295 + * extant send rights. 296 + * 297 + * If the name is deleted before a successfully registered notification 298 + * is delivered, it is replaced with a port-deleted notification. 299 + */ 300 + 301 + routine mach_port_request_notification( 302 + task : ipc_space_t; 303 + name : mach_port_name_t; 304 + msgid : mach_msg_id_t; 305 + sync : mach_port_mscount_t; 306 + notify : mach_port_send_once_t; 307 + out previous : mach_port_move_send_once_t); 308 + 309 + /* 310 + * Inserts the specified rights into the target task, 311 + * using the specified name. If inserting send/receive 312 + * rights and the task already has send/receive rights 313 + * for the port, then the names must agree. In any case, 314 + * the task gains a user ref for the port. 315 + */ 316 + 317 + routine mach_port_insert_right( 318 + task : ipc_space_t; 319 + name : mach_port_name_t; 320 + poly : mach_port_poly_t); 321 + 322 + /* 323 + * Returns the specified right for the named port 324 + * in the target task, extracting that right from 325 + * the target task. The target task loses a user 326 + * ref and the name may be available for recycling. 327 + * msgt_name must be one of 328 + * MACH_MSG_TYPE_MOVE_RECEIVE 329 + * MACH_MSG_TYPE_COPY_SEND 330 + * MACH_MSG_TYPE_MAKE_SEND 331 + * MACH_MSG_TYPE_MOVE_SEND 332 + * MACH_MSG_TYPE_MAKE_SEND_ONCE 333 + * MACH_MSG_TYPE_MOVE_SEND_ONCE 334 + */ 335 + 336 + routine mach_port_extract_right( 337 + task : ipc_space_t; 338 + name : mach_port_name_t; 339 + msgt_name : mach_msg_type_name_t; 340 + out poly : mach_port_poly_t); 341 + 342 + /* 343 + * Only valid for receive rights. 344 + * Sets the sequence number for the port. 345 + */ 346 + 347 + routine mach_port_set_seqno( 348 + task : ipc_space_t; 349 + name : mach_port_name_t; 350 + seqno : mach_port_seqno_t); 351 + 352 + /* 353 + * Returns information about a port. 354 + */ 355 + 356 + routine mach_port_get_attributes( 357 + task : ipc_space_t; 358 + name : mach_port_name_t; 359 + flavor : mach_port_flavor_t; 360 + out port_info_out : mach_port_info_t, CountInOut); 361 + 362 + /* 363 + * Set attributes of a port 364 + */ 365 + 366 + routine mach_port_set_attributes( 367 + task : ipc_space_t; 368 + name : mach_port_name_t; 369 + flavor : mach_port_flavor_t; 370 + port_info : mach_port_info_t); 371 + 372 + 373 + /* 374 + * Allocates the specified kind of object, qos version. 375 + * The right must be 376 + * MACH_PORT_RIGHT_RECEIVE 377 + * Like port_allocate_name, but the kernel picks a name. 378 + * It can use any name not associated with a right. 379 + */ 380 + 381 + routine mach_port_allocate_qos( 382 + task : ipc_space_t; 383 + right : mach_port_right_t; 384 + inout qos : mach_port_qos_t; 385 + out name : mach_port_name_t); 386 + 387 + 388 + /* 389 + * Generic interface to allocation various kinds of ports. 390 + * Should never be called directly by users (at least not 391 + * unless they are exceedingly masochistic). 392 + */ 393 + 394 + routine mach_port_allocate_full( 395 + task : ipc_space_t; 396 + right : mach_port_right_t; 397 + proto : mach_port_t; 398 + inout qos : mach_port_qos_t; 399 + inout name : mach_port_name_t); 400 + 401 + 402 + /* 403 + * Pre-expand task port name space. 404 + */ 405 + routine task_set_port_space( 406 + task : ipc_space_t; 407 + table_entries : int); 408 + 409 + 410 + /* 411 + * Returns the exact number of extant send rights 412 + * for the given receive right. 413 + * This call is only valid on MACH_IPC_DEBUG kernels. 414 + * Otherwise, KERN_FAILURE is returned. 415 + */ 416 + routine mach_port_get_srights( 417 + task : ipc_space_t; 418 + name : mach_port_name_t; 419 + out srights : mach_port_rights_t); 420 + 421 + 422 + /* 423 + * Returns information about an IPC space. 424 + * This call is only valid on MACH_IPC_DEBUG kernels. 425 + * Otherwise, KERN_FAILURE is returned. 426 + */ 427 + routine mach_port_space_info( 428 + task : ipc_space_t; 429 + out space_info : ipc_info_space_t; 430 + out table_info : ipc_info_name_array_t; 431 + out tree_info : ipc_info_tree_name_array_t); 432 + 433 + /* 434 + * Returns information about the dead-name requests 435 + * registered with the named receive right. 436 + * This call is only valid on MACH_IPC_DEBUG kernels. 437 + * Otherwise, KERN_FAILURE is returned. 438 + */ 439 + routine mach_port_dnrequest_info( 440 + task : ipc_space_t; 441 + name : mach_port_name_t; 442 + out dnr_total : unsigned; /* total size of table */ 443 + out dnr_used : unsigned); /* amount used */ 444 + 445 + /* 446 + * Return the type and address of the kernel object 447 + * that the given send/receive right represents. 448 + * This call is only valid on MACH_IPC_DEBUG kernels. 449 + * Otherwise, KERN_FAILURE is returned. 450 + * 451 + * This interface is DEPRECATED in favor of the new 452 + * mach_port_kernel_object64() call (see below). 453 + */ 454 + routine mach_port_kernel_object( 455 + task : ipc_space_t; 456 + name : mach_port_name_t; 457 + out object_type : unsigned; 458 + out object_addr : unsigned); 459 + 460 + 461 + /* 462 + * Inserts the specified rights into the portset identified 463 + * by the <task, pset> pair. The results of passing in the 464 + * Poly argument via the supplied disposition must yield a 465 + * receive right. 466 + * 467 + * If the <task,pset> pair does not represent a valid portset 468 + * KERN_INVALID_RIGHT is returned. 469 + * 470 + * If the passed in name argument does not represent a receive 471 + * right, KERN_INVALID_CAPABILITY will be returned. 472 + * 473 + * If the port represented by the receive right is already in 474 + * the portset, KERN_ALREADY_IN_SET is returned. 475 + */ 476 + routine mach_port_insert_member( 477 + task : ipc_space_t; 478 + name : mach_port_name_t; 479 + pset : mach_port_name_t); 480 + 481 + /* 482 + * Extracts the specified right from the named portset 483 + * in the target task. 484 + * the target task. The target task loses a user 485 + * ref and the name may be available for recycling. 486 + * msgt_name must be one of 487 + * MACH_MSG_TYPE_MOVE_RECEIVE 488 + * MACH_MSG_TYPE_COPY_SEND 489 + * MACH_MSG_TYPE_MAKE_SEND 490 + * MACH_MSG_TYPE_MOVE_SEND 491 + * MACH_MSG_TYPE_MAKE_SEND_ONCE 492 + * MACH_MSG_TYPE_MOVE_SEND_ONCE 493 + */ 494 + 495 + routine mach_port_extract_member( 496 + task : ipc_space_t; 497 + name : mach_port_name_t; 498 + pset : mach_port_name_t); 499 + 500 + /* 501 + * Only valid for receive rights. 502 + * Gets the context pointer for the port. 503 + */ 504 + 505 + routine mach_port_get_context( 506 + task : ipc_space_t; 507 + name : mach_port_name_t; 508 + #ifdef LIBSYSCALL_INTERFACE 509 + out context : mach_port_context_t 510 + #else 511 + out context : mach_vm_address_t 512 + #endif 513 + ); 514 + 515 + /* 516 + * Only valid for receive rights. 517 + * Sets the context pointer for the port. 518 + */ 519 + 520 + routine mach_port_set_context( 521 + task : ipc_space_t; 522 + name : mach_port_name_t; 523 + #ifdef LIBSYSCALL_INTERFACE 524 + context : mach_port_context_t 525 + #else 526 + context : mach_vm_address_t 527 + #endif 528 + ); 529 + 530 + /* 531 + * Return the type and address of the kernel object 532 + * that the given send/receive right represents. 533 + * This call is only valid on MACH_IPC_DEBUG kernels. 534 + * Otherwise, KERN_FAILURE is returned. 535 + */ 536 + routine mach_port_kobject( 537 + task : ipc_space_t; 538 + name : mach_port_name_t; 539 + out object_type : natural_t; 540 + out object_addr : mach_vm_address_t); 541 + 542 + 543 + /* 544 + * Constructs a right based on the options passed 545 + * in. Also allows guarding the port as one of the 546 + * options if the requested right is a receive 547 + * right. 548 + */ 549 + routine mach_port_construct( 550 + task : ipc_space_t; 551 + options : mach_port_options_ptr_t; 552 + #ifdef LIBSYSCALL_INTERFACE 553 + context : mach_port_context_t; 554 + #else 555 + context : uint64_t; 556 + #endif 557 + out name : mach_port_name_t); 558 + 559 + /* 560 + * Destroys a mach port using the guard provided 561 + * for guarded ports. Also reduces the user ref 562 + * count for send rights as specified by srdelta. 563 + */ 564 + routine mach_port_destruct( 565 + task : ipc_space_t; 566 + name : mach_port_name_t; 567 + srdelta : mach_port_delta_t; 568 + #ifdef LIBSYSCALL_INTERFACE 569 + guard : mach_port_context_t 570 + #else 571 + guard : uint64_t 572 + #endif 573 + ); 574 + 575 + /* 576 + * Guard an already existing port. Allows guarding 577 + * receive rights only. Uses the context field in the 578 + * port structure to store the guard. 579 + */ 580 + routine mach_port_guard( 581 + task : ipc_space_t; 582 + name : mach_port_name_t; 583 + #ifdef LIBSYSCALL_INTERFACE 584 + guard : mach_port_context_t; 585 + #else 586 + guard : uint64_t; 587 + #endif 588 + strict : boolean_t); 589 + 590 + /* 591 + * Unguard a port guarded previously. For unguarded ports 592 + * or incorrect guards passed in it raises an exception 593 + * indicating guarding misbehavior. 594 + */ 595 + routine mach_port_unguard( 596 + task : ipc_space_t; 597 + name : mach_port_name_t; 598 + #ifdef LIBSYSCALL_INTERFACE 599 + guard : mach_port_context_t 600 + #else 601 + guard : uint64_t 602 + #endif 603 + ); 604 + 605 + /* 606 + * Returns basic information about an IPC space. 607 + * This call is only valid on MACH_IPC_DEBUG kernels. 608 + * Otherwise, KERN_FAILURE is returned. 609 + */ 610 + routine mach_port_space_basic_info( 611 + task : ipc_space_t; 612 + out basic_info : ipc_info_space_basic_t); 613 + 614 + /* vim: set ft=c : */
+598
kernel/mach/mach_types.defs
··· 1 + /* 2 + * Copyright (c) 2000-2010 Apple Inc. All rights reserved. 3 + * 4 + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ 5 + * 6 + * This file contains Original Code and/or Modifications of Original Code 7 + * as defined in and that are subject to the Apple Public Source License 8 + * Version 2.0 (the 'License'). You may not use this file except in 9 + * compliance with the License. The rights granted to you under the License 10 + * may not be used to create, or enable the creation or redistribution of, 11 + * unlawful or unlicensed copies of an Apple operating system, or to 12 + * circumvent, violate, or enable the circumvention or violation of, any 13 + * terms of an Apple operating system software license agreement. 14 + * 15 + * Please obtain a copy of the License at 16 + * http://www.opensource.apple.com/apsl/ and read it before using this file. 17 + * 18 + * The Original Code and all software distributed under the License are 19 + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 20 + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 21 + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 22 + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 23 + * Please see the License for the specific language governing rights and 24 + * limitations under the License. 25 + * 26 + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ 27 + */ 28 + /* 29 + * @OSF_COPYRIGHT@ 30 + */ 31 + /* 32 + * Mach Operating System 33 + * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University 34 + * All Rights Reserved. 35 + * 36 + * Permission to use, copy, modify and distribute this software and its 37 + * documentation is hereby granted, provided that both the copyright 38 + * notice and this permission notice appear in all copies of the 39 + * software, derivative works or modified versions, and any portions 40 + * thereof, and that both notices appear in supporting documentation. 41 + * 42 + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 43 + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR 44 + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 45 + * 46 + * Carnegie Mellon requests users of this software to return to 47 + * 48 + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 49 + * School of Computer Science 50 + * Carnegie Mellon University 51 + * Pittsburgh PA 15213-3890 52 + * 53 + * any improvements or extensions that they make and grant Carnegie Mellon 54 + * the rights to redistribute these changes. 55 + */ 56 + /* 57 + * NOTICE: This file was modified by McAfee Research in 2004 to introduce 58 + * support for mandatory and extensible security protections. This notice 59 + * is included in support of clause 2.2 (b) of the Apple Public License, 60 + * Version 2.0. 61 + */ 62 + /* 63 + */ 64 + /* 65 + * Mach kernel interface type declarations 66 + */ 67 + 68 + #ifndef _MACH_MACH_TYPES_DEFS_ 69 + #define _MACH_MACH_TYPES_DEFS_ 70 + 71 + 72 + #include <mach/std_types.defs> 73 + 74 + type memory_object_offset_t = uint64_t; 75 + type memory_object_size_t = uint64_t; 76 + type memory_object_cluster_size_t = uint32_t; 77 + type memory_object_fault_info_t = array[16] of integer_t; 78 + 79 + #ifdef KERNEL_PRIVATE 80 + 81 + /* Universal Page Lists - restricted to (in-kernel) pagers for now */ 82 + type upl_size_t = uint32_t; 83 + type upl_offset_t = uint32_t; 84 + type upl_page_info_t = struct[2] of integer_t; 85 + type upl_page_info_array_t = array[*:256] of upl_page_info_t; 86 + 87 + type upl_t = mach_port_t 88 + intran: upl_t convert_port_to_upl(mach_port_t) 89 + outtran: mach_port_t convert_upl_to_port(upl_t) 90 + destructor: upl_deallocate(upl_t) 91 + ; 92 + 93 + #endif /* KERNEL_PRIVATE */ 94 + 95 + type mach_port_status_t = struct[10] of integer_t; /* obsolete */ 96 + type mach_port_info_ext_t = struct[17] of integer_t; 97 + 98 + /* mach_port_info_t: can hold either a 99 + * mach_port_status_t (9 ints) or a 100 + * mach_port_limits_t (1 int) or a 101 + * mach_port_info_ext_t (17 ints). If new flavors of 102 + * mach_port_{get,set}_attributes are added, the size of 103 + * this array may have to be increased. (See mach/port.h) 104 + */ 105 + type mach_port_flavor_t = int; 106 + type mach_port_info_t = array[*:17] of integer_t; 107 + 108 + /* 109 + * mach_msg_max_trailer_t: can hold 110 + * mach_msg_trailer_type_t (1 int) 111 + * mach_msg_trailer_size_t (1 int) 112 + * mach_port_seqno_t (1 int) 113 + * security_token_t (2 ints) 114 + * audit_token_t (8 ints) 115 + * mach_port_context_t (2 ints) 116 + * msgh_ad (1 int) 117 + * msg_labels_t (1 int) 118 + */ 119 + type mach_msg_trailer_type_t = int; 120 + type mach_msg_trailer_info_t = array[*:68] of char; 121 + 122 + type task_t = mach_port_t 123 + #if KERNEL_SERVER 124 + intran: task_t convert_port_to_task(mach_port_t) 125 + outtran: mach_port_t convert_task_to_port(task_t) 126 + destructor: task_deallocate(task_t) 127 + #endif /* KERNEL_SERVER */ 128 + ; 129 + 130 + type task_name_t = mach_port_t 131 + #if KERNEL_SERVER 132 + intran: task_name_t convert_port_to_task_name(mach_port_t) 133 + outtran: mach_port_t convert_task_name_to_port(task_name_t) 134 + destructor: task_name_deallocate(task_name_t) 135 + #endif /* KERNEL_SERVER */ 136 + ; 137 + 138 + type thread_t = mach_port_t 139 + #if KERNEL_SERVER 140 + intran: thread_t convert_port_to_thread(mach_port_t) 141 + outtran: mach_port_t convert_thread_to_port(thread_t) 142 + destructor: thread_deallocate(thread_t) 143 + #endif /* KERNEL_SERVER */ 144 + ; 145 + 146 + type thread_act_t = mach_port_t 147 + #if KERNEL_SERVER 148 + intran: thread_act_t convert_port_to_thread(mach_port_t) 149 + outtran: mach_port_t convert_thread_to_port(thread_act_t) 150 + destructor: thread_deallocate(thread_act_t) 151 + #endif /* KERNEL_SERVER */ 152 + ; 153 + 154 + type thread_act_consume_ref_t = mach_port_move_send_t 155 + cusertype: thread_act_t 156 + #if KERNEL_SERVER 157 + intran: thread_act_t convert_port_to_thread(mach_port_t) 158 + destructor: thread_deallocate(thread_act_t) 159 + #endif /* KERNEL_SERVER */ 160 + ; 161 + 162 + /* thread_state_t: This inline array can hold 163 + * a machine-dependent amount of data, defined in 164 + * mach/machine/???? (currently THREAD_STATE_MAX, 165 + * in mach/thread_state.h) 166 + */ 167 + #include <mach/machine/thread_state.h> 168 + type thread_state_flavor_t = int; 169 + type thread_state_t = array[*:THREAD_STATE_MAX] of natural_t; 170 + 171 + type task_array_t = ^array[] of task_t; 172 + type thread_array_t = ^array[] of thread_t; 173 + type thread_act_array_t = ^array[] of thread_act_t; 174 + type act_params_t = array[6] of int; 175 + 176 + type vm_map_t = mach_port_t 177 + #if KERNEL_SERVER 178 + intran: vm_map_t convert_port_to_map(mach_port_t) 179 + destructor: vm_map_deallocate(vm_map_t) 180 + #endif /* KERNEL_SERVER */ 181 + ; 182 + 183 + type vm_task_entry_t = mach_port_t 184 + cusertype: vm_map_t 185 + #if KERNEL_SERVER 186 + intran: vm_map_t convert_port_entry_to_map(mach_port_t) 187 + destructor: vm_map_deallocate(vm_map_t) 188 + #endif /* KERNEL_SERVER */ 189 + ; 190 + 191 + type ipc_space_t = mach_port_t 192 + #if KERNEL_SERVER 193 + intran: ipc_space_t convert_port_to_space(mach_port_t) 194 + destructor: space_deallocate(ipc_space_t) 195 + #endif /* KERNEL_SERVER */ 196 + ; 197 + 198 + type vm_prot_t = int; 199 + type vm_inherit_t = int; 200 + type vm_purgable_t = int; 201 + type xxx_vm_statistics_data_t = struct[13] of integer_t; 202 + type vm_behavior_t = int; 203 + type vm_statistics_data_t = struct[15] of integer_t; 204 + type vm_machine_attribute_t = int; 205 + type vm_machine_attribute_val_t = int; 206 + type vm_sync_t = int; 207 + 208 + /* thread_info_t: this inline array can hold any of: 209 + * thread_basic_info_t (10 ints) 210 + * policy_timeshare_info_t (5 ints) 211 + * policy_fifo_info_t (4 ints) 212 + * policy_rr_info_t (5 ints) 213 + * if other thread_info flavors are added, this 214 + * definition may need to be changed. (See 215 + * mach/thread_info.h and mach/policy.h) */ 216 + type thread_flavor_t = int; 217 + type thread_info_t = array[*:12] of integer_t; 218 + 219 + type thread_policy_flavor_t = natural_t; 220 + type thread_policy_t = array[*:16] of integer_t; 221 + 222 + /* task_info_t: this inline array can hold any of: 223 + * task_basic_info_32_t (8 ints) 224 + * task_basic_info_64_t (10 ints) 225 + * task_events_info_t (8 ints) 226 + * task_thread_times_info_t (4 ints) 227 + * policy_timeshare_info_t (5 ints) 228 + * policy_fifo_info_t (4 ints) 229 + * policy_rr_info_t (5 ints) 230 + * task security token (2 ints) 231 + * task audit token (8 ints) 232 + * dyld info (2 64-bit ints and 1 int) 233 + * task_extmod_info_t (8 64-bit ints) 234 + * task_basic_info_64_2_t 235 + * mach_task_basic_info_t (12 ints) 236 + * task_power_info_t (18 ints) 237 + * If other task_info flavors are added, this 238 + * definition may need to be changed. (See 239 + * mach/task_info.h and mach/policy.h) */ 240 + type task_flavor_t = int; 241 + type task_info_t = array[*:52] of integer_t; 242 + 243 + type task_purgable_info_t = struct[68] of integer_t; 244 + 245 + type task_policy_flavor_t = natural_t; 246 + type task_policy_t = array[*:16] of integer_t; 247 + 248 + type mem_entry_name_port_t = mach_port_t 249 + #if KERNEL_SERVER 250 + intran: mem_entry_name_port_t null_conversion(mach_port_t) 251 + outtran: mach_port_t null_conversion(mem_entry_name_port_t) 252 + #endif /* KERNEL_SERVER */ 253 + ; 254 + 255 + type mem_entry_name_port_move_send_t = mach_port_move_send_t 256 + cusertype: mem_entry_name_port_t 257 + #if KERNEL_SERVER 258 + intran: mem_entry_name_port_t null_conversion(mach_port_t) 259 + outtran: mach_port_t null_conversion(mem_entry_name_port_t) 260 + #endif /* KERNEL_SERVER */ 261 + ; 262 + 263 + type memory_object_default_t = mach_port_t 264 + #if KERNEL_PRIVATE 265 + intran: memory_object_default_t null_conversion(mach_port_t) 266 + outtran: mach_port_t null_conversion(memory_object_default_t) 267 + #endif /* KERNEL_PRIVATE */ 268 + ; 269 + 270 + type memory_object_t = mach_port_t 271 + #if KERNEL_PRIVATE 272 + intran: memory_object_t convert_port_to_memory_object(mach_port_t) 273 + outtran: mach_port_t convert_memory_object_to_port(memory_object_t) 274 + #endif /* KERNEL_PRIVATE */ 275 + ; 276 + 277 + 278 + type memory_object_control_t = mach_port_t 279 + #if KERNEL_PRIVATE 280 + intran: memory_object_control_t convert_port_to_mo_control(mach_port_t) 281 + outtran: mach_port_t convert_mo_control_to_port(memory_object_control_t) 282 + destructor: memory_object_control_deallocate(memory_object_control_t) 283 + #endif /* KERNEL_PRIVATE */ 284 + ; 285 + 286 + type memory_object_name_t = mach_port_t 287 + ctype: mach_port_t 288 + ; 289 + 290 + 291 + type memory_object_copy_strategy_t = int; 292 + type memory_object_return_t = int; 293 + 294 + type machine_info_data_t = struct[5] of integer_t; 295 + type machine_slot_data_t = struct[8] of integer_t; 296 + 297 + type host_t = mach_port_t 298 + #if KERNEL_SERVER 299 + intran: host_t convert_port_to_host(mach_port_t) 300 + outtran: mach_port_t convert_host_to_port(host_t) 301 + #endif /* KERNEL_SERVER */ 302 + ; 303 + 304 + type host_priv_t = mach_port_t 305 + #if KERNEL_SERVER 306 + intran: host_priv_t convert_port_to_host_priv(mach_port_t) 307 + #endif /* KERNEL_SERVER */ 308 + ; 309 + 310 + type host_security_t = mach_port_t 311 + #if KERNEL_SERVER 312 + intran: host_security_t convert_port_to_host_security(mach_port_t) 313 + #endif /* KERNEL_SERVER */ 314 + ; 315 + 316 + /* 317 + * host_info_t: variable-sized inline array that can contain: 318 + * 319 + * host_basic_info_old_t (5 ints) 320 + * host_basic_info_t (12 ints) 321 + * host_sched_info_t (2 ints) 322 + * kernel_resource_sizes_t (5 ints) 323 + * host_load_info_t (6 ints) 324 + * vm_statistics32_t (15 ints) 325 + * host_purgable_info_t (68 ints) 326 + * host_expired_task_info uses a task_power_info (18 ints) 327 + * 328 + * If other host_info flavors are added, this definition may 329 + * need to be changed. (See mach/{host_info,vm_statistics}.h) 330 + */ 331 + type host_flavor_t = int; 332 + type host_info_t = array[*:68] of integer_t; 333 + /* 334 + * host_info64_t: variable-sized inline array that can contain: 335 + * 336 + * vm_statistics_t (6 ints and 9 longs) 337 + * vm_extmod_statistics_t (6 64-bit ints) 338 + */ 339 + type host_info64_t = array[*:256] of integer_t; 340 + 341 + type processor_t = mach_port_t 342 + #if KERNEL_SERVER 343 + intran: processor_t convert_port_to_processor(mach_port_t) 344 + outtran: mach_port_t convert_processor_to_port(processor_t) 345 + #endif /* KERNEL_SERVER */ 346 + ; 347 + 348 + type processor_array_t = ^array[] of processor_t; 349 + 350 + /* processor_info_t: variable-sized inline array that can 351 + * contain: 352 + * processor_basic_info_t: (5 ints) 353 + * processor_cpu_load_info_t:(4 ints) 354 + * processor_machine_info_t :(12 ints) 355 + * If other processor_info flavors are added, this definition 356 + * may need to be changed. (See mach/processor_info.h) */ 357 + type processor_flavor_t = int; 358 + type processor_info_t = array[*:12] of integer_t; 359 + type processor_info_array_t = ^array[] of integer_t; 360 + 361 + type processor_set_t = mach_port_t 362 + #if KERNEL_SERVER 363 + intran: processor_set_t convert_port_to_pset(mach_port_t) 364 + outtran: mach_port_t convert_pset_to_port(processor_set_t) 365 + destructor: pset_deallocate(processor_set_t) 366 + #endif /* KERNEL_SERVER */ 367 + ; 368 + 369 + type processor_set_array_t = ^array[] of processor_set_t; 370 + 371 + type processor_set_name_t = mach_port_t 372 + #if KERNEL_SERVER 373 + intran: processor_set_name_t convert_port_to_pset_name(mach_port_t) 374 + outtran: mach_port_t convert_pset_name_to_port(processor_set_name_t) 375 + destructor: pset_deallocate(processor_set_name_t) 376 + #endif /* KERNEL_SERVER */ 377 + ; 378 + 379 + type processor_set_name_array_t = ^array[] of processor_set_name_t; 380 + 381 + /* processor_set_info_t: variable-size inline array 382 + * that can hold: 383 + * processor_set_basic_info (5 ints) 384 + * processor_set_load_info (4 ints) 385 + * policy_timeshare_base_t (1 int) 386 + * policy_fifo_base_t (1 int) 387 + * policy_rr_base_t (1 int) 388 + * policy_timeshare_base_t (1 int) 389 + * policy_fifo_base_t (1 int) 390 + * policy_rr_base_t (1 int) 391 + * policy_t (1 int) 392 + * If other flavors are added, this definition may 393 + * need to be changed. (see mach/processor.h) */ 394 + type processor_set_flavor_t = int; 395 + type processor_set_info_t = array[*:5] of integer_t; 396 + 397 + type bootstrap_t = mach_port_t; 398 + 399 + type kernel_version_t = c_string[*:512]; 400 + type kernel_boot_info_t = c_string[*:4096]; 401 + 402 + type time_value_t = struct[2] of integer_t; 403 + 404 + type mach_port_qos_t = struct[2] of integer_t; 405 + 406 + type mach_port_options_t = struct[3] of uint64_t; 407 + type mach_port_options_ptr_t = ^ mach_port_options_t; 408 + 409 + type emulation_vector_t = ^array[] of vm_offset_t; 410 + 411 + type inline_existence_map_t = array[*:512] of char; 412 + 413 + type policy_t = int; 414 + /* policy_info_t: variable-size inline array. Can hold: 415 + * policy_timeshare_info_t (5 ints) 416 + * policy_fifo_info_t (4 ints) 417 + * policy_rr_info_t (5 ints) */ 418 + type policy_base_t = array[*:5] of integer_t; 419 + type policy_info_t = array[*:2] of integer_t; 420 + type policy_limit_t = array[*:1] of integer_t; 421 + 422 + type ledger_t = mach_port_t 423 + #if KERNEL_SERVER 424 + intran: ledger_t convert_port_to_ledger(mach_port_t) 425 + outtran: mach_port_t convert_ledger_to_port(ledger_t) 426 + #endif /* KERNEL_SERVER */ 427 + ; 428 + 429 + type ledger_array_t = ^array[] of ledger_t; 430 + type ledger_item_t = integer_t; 431 + /* DEPRECATED */ 432 + 433 + type ledger_amount_t = int64_t; 434 + 435 + type security_token_t = struct[2] of uint32_t; 436 + type audit_token_t = struct[8] of uint32_t; 437 + 438 + type msg_labels_t = mach_port_t; 439 + 440 + /* memory_object_info_t: variable-size inline array: 441 + * memory_object_attr_info_t (5 ints) 442 + * XXX actually it's 6 ints temporarily (object_ready!) 443 + * memory_object_behave_info_t (4 ints) 444 + * memory_object_perf_info_t (2 ints) 445 + * old_memory_object_attr_info_t (3 ints) 446 + * If other flavors are added, this definition may 447 + * need to be changed. (see mach/memory_object.h) */ 448 + type memory_object_flavor_t = int; 449 + type memory_object_info_t = array[*:6] of int; 450 + 451 + /* vm_region_info_t: variable-size inline array that can hold: 452 + * vm_region_basic_info_t (8 ints) 453 + * If other flavors are added, this definition may 454 + * need to be changed. (see mach/vm_region.h) */ 455 + type vm_region_flavor_t = int; 456 + type vm_region_info_t = array[*:10] of int; 457 + type vm_region_recurse_info_t = array[*:19] of int; 458 + 459 + type vm_page_info_flavor_t = int; 460 + type vm_page_info_t = array[*:32] of int; 461 + 462 + type mach_vm_read_entry_t = array[512] of mach_vm_offset_t; 463 + type vm_read_entry_t = array[512] of vm_offset_t; 464 + #if VM32_SUPPORT 465 + type vm32_read_entry_t = array[512] of vm32_offset_t; 466 + #endif 467 + 468 + type exception_mask_t = int; 469 + type exception_behavior_t = int; 470 + 471 + type exception_handler_t = mach_port_t; 472 + 473 + type exception_handler_array_t = 474 + array[*:32] of exception_handler_t; 475 + 476 + type exception_behavior_array_t = 477 + array[*:32] of exception_behavior_t; 478 + 479 + type exception_flavor_array_t = 480 + array[*:32] of thread_state_flavor_t; 481 + 482 + type exception_mask_array_t = 483 + array[*:32] of exception_mask_t; 484 + 485 + type semaphore_t = mach_port_t 486 + #if KERNEL_SERVER 487 + intran: semaphore_t convert_port_to_semaphore(mach_port_t) 488 + outtran: mach_port_t convert_semaphore_to_port(semaphore_t) 489 + destructor: semaphore_dereference(semaphore_t) 490 + #endif /* KERNEL_SERVER */ 491 + ; 492 + 493 + type semaphore_consume_ref_t = mach_port_move_send_t 494 + cusertype: semaphore_t 495 + #if KERNEL_SERVER 496 + intran: semaphore_t convert_port_to_semaphore(mach_port_t) 497 + outtran: mach_port_t convert_semaphore_to_port(semaphore_t) 498 + destructor: semaphore_dereference(semaphore_t) 499 + #endif /* KERNEL_SERVER */ 500 + ; 501 + 502 + type lock_set_t = mach_port_t 503 + #if KERNEL_SERVER 504 + intran: lock_set_t convert_port_to_lock_set(mach_port_t) 505 + outtran: mach_port_t convert_lock_set_to_port(lock_set_t) 506 + destructor: lock_set_dereference(lock_set_t) 507 + #endif /* KERNEL_SERVER */ 508 + ; 509 + 510 + type task_suspension_token_t = mach_port_move_send_once_t 511 + #if KERNEL_SERVER 512 + intran: task_suspension_token_t convert_port_to_task_suspension_token(mach_port_t) 513 + outtran: mach_port_t convert_task_suspension_token_to_port(task_suspension_token_t) 514 + #endif /* KERNEL_SERVER */ 515 + ; 516 + 517 + 518 + /* public voucher types */ 519 + 520 + /* Mach voucher object */ 521 + type mach_voucher_t = mach_port_t; 522 + type mach_voucher_name_t = mach_port_name_t; 523 + 524 + type mach_voucher_attr_manager_t = mach_port_t; 525 + type mach_voucher_attr_control_t = mach_port_t; 526 + 527 + /* IPC voucher internal object */ 528 + type ipc_voucher_t = mach_port_t 529 + #if KERNEL_SERVER 530 + intran: ipc_voucher_t convert_port_to_voucher(mach_port_t) 531 + outtran: mach_port_t convert_voucher_to_port(ipc_voucher_t) 532 + destructor: ipc_voucher_release(ipc_voucher_t) 533 + #endif /* KERNEL_SERVER */ 534 + ; 535 + 536 + /* IPC voucher attribute control internal object */ 537 + type ipc_voucher_attr_control_t = mach_port_t 538 + #if KERNEL_SERVER 539 + intran: ipc_voucher_attr_control_t convert_port_to_voucher_attr_control(mach_port_t) 540 + outtran: mach_port_t convert_voucher_attr_control_to_port(ipc_voucher_attr_control_t) 541 + destructor: ipc_voucher_attr_control_release(ipc_voucher_attr_control_t) 542 + #endif /* KERNEL_SERVER */ 543 + ; 544 + 545 + type mach_voucher_attr_key_t = uint32_t; 546 + 547 + type mach_voucher_attr_command_t = uint32_t; 548 + type mach_voucher_attr_recipe_command_t = uint32_t; 549 + 550 + type mach_voucher_attr_content_size_t = uint32_t; 551 + type mach_voucher_attr_content_t = array[*:4096] of uint8_t; 552 + type mach_voucher_attr_content_array_t = array[*:5120] of uint8_t; 553 + 554 + type mach_voucher_attr_raw_recipe_size_t = uint32_t; 555 + type mach_voucher_attr_raw_recipe_t = array[*:4096] of uint8_t; 556 + type mach_voucher_attr_raw_recipe_array_t = array[*:5120] of uint8_t; 557 + 558 + type mach_voucher_selector_t = uint32_t; 559 + 560 + type mach_voucher_attr_value_handle_t = uint64_t; 561 + type mach_voucher_attr_value_handle_array_t = array[*:4] of mach_voucher_attr_value_handle_t; 562 + type mach_voucher_attr_value_reference_t = uint32_t; 563 + 564 + /* kernel module loader */ 565 + type kmod_t = int; 566 + type kmod_control_flavor_t = int; 567 + 568 + type kmod_args_t = ^array[] of MACH_MSG_TYPE_BYTE 569 + ctype: kmod_args_t; 570 + 571 + type io_master_t = mach_port_t; 572 + type UNDServerRef = mach_port_t; 573 + 574 + #if KERNEL_SERVER 575 + #ifdef MACH_KERNEL_PRIVATE 576 + simport <ipc/ipc_voucher.h>; /* for voucher conversions */ 577 + simport <kern/ipc_kobject.h>; /* for null conversion */ 578 + simport <kern/ipc_tt.h>; /* for task/thread conversion */ 579 + simport <kern/ipc_host.h>; /* for host/processor/pset conversions */ 580 + simport <kern/ipc_sync.h>; /* for lock_set and semaphore conversions */ 581 + simport <kern/ledger.h>; /* for ledger conversions */ 582 + simport <kern/processor.h>; /* for processor conversions */ 583 + simport <kern/sync_lock.h>; /* for lock-set conversions */ 584 + simport <kern/sync_sema.h>; /* for semaphore conversions */ 585 + simport <vm/memory_object.h>; /* for memory object type conversions */ 586 + simport <vm/vm_map.h>; /* for vm_map conversions */ 587 + #endif /* MACH_KERNEL_PRIVATE */ 588 + 589 + simport <kern/ipc_mig.h>; /* pick up kernel-specific MIG things */ 590 + 591 + #endif /* KERNEL_SERVER */ 592 + 593 + import <mach/mig.h>; 594 + import <mach/mach_types.h>; 595 + 596 + #endif /* _MACH_MACH_TYPES_DEFS_ */ 597 + 598 + /* vim: set ft=c : */
+528
kernel/mach/mach_vm.defs
··· 1 + /* 2 + * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. 3 + * 4 + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ 5 + * 6 + * This file contains Original Code and/or Modifications of Original Code 7 + * as defined in and that are subject to the Apple Public Source License 8 + * Version 2.0 (the 'License'). You may not use this file except in 9 + * compliance with the License. The rights granted to you under the License 10 + * may not be used to create, or enable the creation or redistribution of, 11 + * unlawful or unlicensed copies of an Apple operating system, or to 12 + * circumvent, violate, or enable the circumvention or violation of, any 13 + * terms of an Apple operating system software license agreement. 14 + * 15 + * Please obtain a copy of the License at 16 + * http://www.opensource.apple.com/apsl/ and read it before using this file. 17 + * 18 + * The Original Code and all software distributed under the License are 19 + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 20 + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 21 + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 22 + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 23 + * Please see the License for the specific language governing rights and 24 + * limitations under the License. 25 + * 26 + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ 27 + */ 28 + /* 29 + * @OSF_FREE_COPYRIGHT@ 30 + */ 31 + /* 32 + * Mach Operating System 33 + * Copyright (c) 1991,1990,1989 Carnegie Mellon University 34 + * All Rights Reserved. 35 + * 36 + * Permission to use, copy, modify and distribute this software and its 37 + * documentation is hereby granted, provided that both the copyright 38 + * notice and this permission notice appear in all copies of the 39 + * software, derivative works or modified versions, and any portions 40 + * thereof, and that both notices appear in supporting documentation. 41 + * 42 + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 43 + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR 44 + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 45 + * 46 + * Carnegie Mellon requests users of this software to return to 47 + * 48 + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 49 + * School of Computer Science 50 + * Carnegie Mellon University 51 + * Pittsburgh PA 15213-3890 52 + * 53 + * any improvements or extensions that they make and grant Carnegie Mellon 54 + * the rights to redistribute these changes. 55 + */ 56 + /* 57 + */ 58 + /* 59 + * File: mach/mach_vm.defs 60 + * 61 + * Exported kernel VM calls (for any task on the platform). 62 + */ 63 + 64 + subsystem 65 + #if KERNEL_SERVER 66 + KernelServer 67 + #endif /* KERNEL_SERVER */ 68 + #if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) 69 + mach_vm 70 + #else 71 + vm_map_lp64_local 72 + #endif 73 + 4800; 74 + 75 + #include <mach/std_types.defs> 76 + #include <mach/mach_types.defs> 77 + #include <mach_debug/mach_debug_types.defs> 78 + 79 + #if !KERNEL && !LIBSYSCALL_INTERFACE 80 + #define PREFIX(NAME) _kernelrpc_ ## NAME 81 + #else 82 + #define PREFIX(NAME) NAME 83 + #endif 84 + 85 + /* 86 + * Allocate zero-filled memory in the address space 87 + * of the target task, either at the specified address, 88 + * or wherever space can be found (controlled by flags), 89 + * of the specified size. The address at which the 90 + * allocation actually took place is returned. 91 + */ 92 + #if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) 93 + routine PREFIX(mach_vm_allocate) ( 94 + target : vm_task_entry_t; 95 + inout address : mach_vm_address_t; 96 + size : mach_vm_size_t; 97 + flags : int); 98 + 99 + #else 100 + 101 + #if !KERNEL && !LIBSYSCALL_INTERFACE 102 + skip; 103 + #else 104 + routine PREFIX(vm_allocate) ( 105 + target : vm_task_entry_t; 106 + inout address : mach_vm_address_t; 107 + size : mach_vm_size_t; 108 + flags : int); 109 + 110 + #endif 111 + 112 + #endif 113 + 114 + 115 + /* 116 + * Deallocate the specified range from the virtual 117 + * address space of the target virtual memory map. 118 + */ 119 + #if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) 120 + routine PREFIX(mach_vm_deallocate) ( 121 + target : vm_task_entry_t; 122 + address : mach_vm_address_t; 123 + size : mach_vm_size_t); 124 + 125 + #else 126 + 127 + #if !KERNEL && !LIBSYSCALL_INTERFACE 128 + skip; 129 + #else 130 + routine PREFIX(vm_deallocate) ( 131 + target : vm_task_entry_t; 132 + address : mach_vm_address_t; 133 + size : mach_vm_size_t); 134 + #endif 135 + 136 + #endif 137 + 138 + /* 139 + * Set the current or maximum protection attribute 140 + * for the specified range of the virtual address 141 + * space of the target virtual memory map. The current 142 + * protection limits the memory access rights of threads 143 + * within the map; the maximum protection limits the accesses 144 + * that may be given in the current protection. 145 + * Protections are specified as a set of {read, write, execute} 146 + * *permissions*. 147 + */ 148 + #if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) 149 + routine PREFIX(mach_vm_protect) ( 150 + target_task : vm_task_entry_t; 151 + address : mach_vm_address_t; 152 + size : mach_vm_size_t; 153 + set_maximum : boolean_t; 154 + new_protection : vm_prot_t); 155 + 156 + 157 + #else 158 + 159 + #if !KERNEL && !LIBSYSCALL_INTERFACE 160 + skip; 161 + #else 162 + 163 + routine PREFIX(vm_protect) ( 164 + target_task : vm_task_entry_t; 165 + address : mach_vm_address_t; 166 + size : mach_vm_size_t; 167 + set_maximum : boolean_t; 168 + new_protection : vm_prot_t); 169 + 170 + #endif 171 + 172 + #endif 173 + 174 + /* 175 + * Set the inheritance attribute for the specified range 176 + * of the virtual address space of the target address space. 177 + * The inheritance value is one of {none, copy, share}, and 178 + * specifies how the child address space should acquire 179 + * this memory at the time of a task_create call. 180 + */ 181 + #if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) 182 + routine mach_vm_inherit( 183 + #else 184 + routine vm_inherit( 185 + #endif 186 + target_task : vm_task_entry_t; 187 + address : mach_vm_address_t; 188 + size : mach_vm_size_t; 189 + new_inheritance : vm_inherit_t); 190 + 191 + /* 192 + * Returns the contents of the specified range of the 193 + * virtual address space of the target task. [The 194 + * range must be aligned on a virtual page boundary, 195 + * and must be a multiple of pages in extent. The 196 + * protection on the specified range must permit reading.] 197 + */ 198 + #if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) 199 + routine PREFIX(mach_vm_read) ( 200 + #else 201 + routine PREFIX(vm_read) ( 202 + #endif 203 + target_task : vm_map_t; 204 + address : mach_vm_address_t; 205 + size : mach_vm_size_t; 206 + out data : pointer_t); 207 + 208 + /* 209 + * List corrollary to vm_read, returns mapped contents of specified 210 + * ranges within target address space. 211 + */ 212 + #if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) 213 + routine mach_vm_read_list( 214 + #else 215 + routine vm_read_list( 216 + #endif 217 + target_task : vm_map_t; 218 + inout data_list : mach_vm_read_entry_t; 219 + count : natural_t); 220 + 221 + /* 222 + * Writes the contents of the specified range of the 223 + * virtual address space of the target task. [The 224 + * range must be aligned on a virtual page boundary, 225 + * and must be a multiple of pages in extent. The 226 + * protection on the specified range must permit writing.] 227 + */ 228 + #if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) 229 + routine mach_vm_write( 230 + #else 231 + routine vm_write( 232 + #endif 233 + target_task : vm_map_t; 234 + address : mach_vm_address_t; 235 + data : pointer_t); 236 + 237 + /* 238 + * Copy the contents of the source range of the virtual 239 + * address space of the target task to the destination 240 + * range in that same address space. [Both of the 241 + * ranges must be aligned on a virtual page boundary, 242 + * and must be multiples of pages in extent. The 243 + * protection on the source range must permit reading, 244 + * and the protection on the destination range must 245 + * permit writing.] 246 + */ 247 + #if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) 248 + routine mach_vm_copy( 249 + #else 250 + routine vm_copy( 251 + #endif 252 + target_task : vm_map_t; 253 + source_address : mach_vm_address_t; 254 + size : mach_vm_size_t; 255 + dest_address : mach_vm_address_t); 256 + 257 + /* 258 + * Returns the contents of the specified range of the 259 + * virtual address space of the target task. [There 260 + * are no alignment restrictions, and the results will 261 + * overwrite the area pointed to by data - which must 262 + * already exist. The protection on the specified range 263 + * must permit reading.] 264 + */ 265 + #if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) 266 + routine mach_vm_read_overwrite( 267 + #else 268 + routine vm_read_overwrite( 269 + #endif 270 + target_task : vm_map_t; 271 + address : mach_vm_address_t; 272 + size : mach_vm_size_t; 273 + data : mach_vm_address_t; 274 + out outsize : mach_vm_size_t); 275 + 276 + 277 + #if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) 278 + routine mach_vm_msync( 279 + #else 280 + routine vm_msync( 281 + #endif 282 + target_task : vm_map_t; 283 + address : mach_vm_address_t; 284 + size : mach_vm_size_t; 285 + sync_flags : vm_sync_t ); 286 + 287 + /* 288 + * Set the paging behavior attribute for the specified range 289 + * of the virtual address space of the target task. 290 + * The behavior value is one of {default, random, forward 291 + * sequential, reverse sequential} and indicates the expected 292 + * page reference pattern for the specified range. 293 + */ 294 + #if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) 295 + routine mach_vm_behavior_set( 296 + #else 297 + routine vm_behavior_set( 298 + #endif 299 + target_task : vm_map_t; 300 + address : mach_vm_address_t; 301 + size : mach_vm_size_t; 302 + new_behavior : vm_behavior_t); 303 + 304 + 305 + /* 306 + * Map a user-supplie memory object into the virtual address 307 + * space of the target task. If desired (anywhere is TRUE), 308 + * the kernel will find a suitable address range of the 309 + * specified size; else, the specific address will be allocated. 310 + * 311 + * The beginning address of the range will be aligned on a virtual 312 + * page boundary, be at or beyond the address specified, and 313 + * meet the mask requirements (bits turned on in the mask must not 314 + * be turned on in the result); the size of the range, in bytes, 315 + * will be rounded up to an integral number of virtual pages. 316 + * 317 + * The memory in the resulting range will be associated with the 318 + * specified memory object, with the beginning of the memory range 319 + * referring to the specified offset into the memory object. 320 + * 321 + * The mapping will take the current and maximum protections and 322 + * the inheritance attributes specified; see the vm_protect and 323 + * vm_inherit calls for a description of these attributes. 324 + * 325 + * If desired (copy is TRUE), the memory range will be filled 326 + * with a copy of the data from the memory object; this copy will 327 + * be private to this mapping in this target task. Otherwise, 328 + * the memory in this mapping will be shared with other mappings 329 + * of the same memory object at the same offset (in this task or 330 + * in other tasks). [The Mach kernel only enforces shared memory 331 + * consistency among mappings on one host with similar page alignments. 332 + * The user-defined memory manager for this object is responsible 333 + * for further consistency.] 334 + */ 335 + #if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) 336 + routine PREFIX(mach_vm_map) ( 337 + #else 338 + #if defined(__arm__) && !LIBSYSCALL_INTERFACE 339 + routine _vm_map_arm( 340 + #else 341 + routine PREFIX(vm_map) ( 342 + #endif 343 + #endif 344 + target_task : vm_task_entry_t; 345 + inout address : mach_vm_address_t; 346 + size : mach_vm_size_t; 347 + mask : mach_vm_offset_t; 348 + flags : int; 349 + object : mem_entry_name_port_t; 350 + offset : memory_object_offset_t; 351 + copy : boolean_t; 352 + cur_protection : vm_prot_t; 353 + max_protection : vm_prot_t; 354 + inheritance : vm_inherit_t); 355 + 356 + /* 357 + * Set/Get special properties of memory associated 358 + * to some virtual address range, such as cachability, 359 + * migrability, replicability. Machine-dependent. 360 + */ 361 + #if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) 362 + routine mach_vm_machine_attribute( 363 + #else 364 + routine vm_machine_attribute( 365 + #endif 366 + target_task : vm_map_t; 367 + address : mach_vm_address_t; 368 + size : mach_vm_size_t; 369 + attribute : vm_machine_attribute_t; 370 + inout value : vm_machine_attribute_val_t); 371 + 372 + /* 373 + * Map portion of a task's address space. 374 + */ 375 + #if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) 376 + routine PREFIX(mach_vm_remap) ( 377 + #else 378 + routine PREFIX(vm_remap) ( 379 + #endif 380 + target_task : vm_map_t; 381 + inout target_address : mach_vm_address_t; 382 + size : mach_vm_size_t; 383 + mask : mach_vm_offset_t; 384 + flags : int; 385 + src_task : vm_map_t; 386 + src_address : mach_vm_address_t; 387 + copy : boolean_t; 388 + out cur_protection : vm_prot_t; 389 + out max_protection : vm_prot_t; 390 + inheritance : vm_inherit_t); 391 + 392 + /* 393 + * Give the caller information on the given location in a virtual 394 + * address space. If a page is mapped return ref and dirty info. 395 + */ 396 + #if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) 397 + routine mach_vm_page_query( 398 + #else 399 + routine vm_map_page_query( 400 + #endif 401 + target_map :vm_map_t; 402 + offset :mach_vm_offset_t; 403 + out disposition :integer_t; 404 + out ref_count :integer_t); 405 + 406 + 407 + #if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) 408 + routine mach_vm_region_recurse( 409 + #else 410 + routine vm_region_recurse_64( 411 + #endif 412 + target_task : vm_map_t; 413 + inout address : mach_vm_address_t; 414 + out size : mach_vm_size_t; 415 + inout nesting_depth : natural_t; 416 + out info : vm_region_recurse_info_t,CountInOut); 417 + 418 + /* 419 + * Returns information about the contents of the virtual 420 + * address space of the target task at the specified 421 + * address. The returned protection, inheritance, sharing 422 + * and memory object values apply to the entire range described 423 + * by the address range returned; the memory object offset 424 + * corresponds to the beginning of the address range. 425 + * [If the specified address is not allocated, the next 426 + * highest address range is described. If no addresses beyond 427 + * the one specified are allocated, the call returns KERN_NO_SPACE.] 428 + */ 429 + #if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) 430 + routine mach_vm_region( 431 + #else 432 + routine vm_region_64( 433 + #endif 434 + target_task : vm_map_t; 435 + inout address : mach_vm_address_t; 436 + out size : mach_vm_size_t; 437 + flavor : vm_region_flavor_t; 438 + out info : vm_region_info_t, CountInOut; 439 + out object_name : memory_object_name_t = 440 + MACH_MSG_TYPE_MOVE_SEND 441 + ctype: mach_port_t); 442 + 443 + /* 444 + * Allow application level processes to create named entries which 445 + * correspond to mapped portions of their address space. These named 446 + * entries can then be manipulated, shared with other processes in 447 + * other address spaces and ultimately mapped in ohter address spaces 448 + * 449 + * THIS INTERFACE IS STILL EVOLVING. 450 + */ 451 + #if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) 452 + #if !defined(__LP64__) || KERNEL_SERVER || XNU_KERNEL_PRIVATE || LIBSYSCALL_INTERFACE 453 + routine _mach_make_memory_entry( 454 + #else 455 + routine mach_make_memory_entry( 456 + #endif 457 + #else 458 + routine mach_make_memory_entry_64( 459 + #endif 460 + target_task :vm_map_t; 461 + inout size :memory_object_size_t; 462 + offset :memory_object_offset_t; 463 + permission :vm_prot_t; 464 + out object_handle :mem_entry_name_port_move_send_t; 465 + parent_handle :mem_entry_name_port_t); 466 + 467 + /* 468 + * Control behavior and investigate state of a "purgable" object in 469 + * the virtual address space of the target task. A purgable object is 470 + * created via a call to mach_vm_allocate() with VM_FLAGS_PURGABLE 471 + * specified. See the routine implementation for a complete 472 + * definition of the routine. 473 + */ 474 + #if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) 475 + routine mach_vm_purgable_control( 476 + #else 477 + routine vm_purgable_control( 478 + #endif 479 + target_task : vm_map_t; 480 + address : mach_vm_address_t; 481 + control : vm_purgable_t; 482 + inout state : int); 483 + 484 + 485 + #if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) 486 + routine mach_vm_page_info( 487 + target_task : vm_map_t; 488 + address : mach_vm_address_t; 489 + flavor : vm_page_info_flavor_t; 490 + out info : vm_page_info_t, CountInOut); 491 + #else 492 + skip; 493 + #endif 494 + 495 + /****************************** Legacy section ***************************/ 496 + /* The following definitions are exist to provide compatibility with */ 497 + /* the legacy APIs. They are no different. We just need to produce */ 498 + /* the user-level stub interface for them. */ 499 + /****************************** Legacy section ***************************/ 500 + 501 + 502 + /* 503 + * These interfaces just aren't supported in the new (wide) model: 504 + * 505 + * mach_vm_region_info() - 506 + * vm_map_pages_info() - 507 + * no user-level replacement for these MACH_DEBUG interfaces 508 + * vm_map_get_upl() - 509 + * no user-level replacement at the moment 510 + * vm_region_info() - 511 + * use mach_vm_region_info() or vm_region_info_64() 512 + * vm_region_recurse() - 513 + * use mach_vm_region_recurse() or vm_region_recurse_64() 514 + */ 515 + 516 + /* 517 + * The following legacy interfaces are provides as macro wrappers to the new 518 + * interfaces. You should strive to use the new ones instead: 519 + * 520 + * vm_map() - 521 + * use mach_vm_map() or vm_map_64() 522 + * vm_region() - 523 + * use mach_vm_region() or vm_region_64() 524 + * mach_make_memory_entry() - 525 + * use mach_vm_make_memory_entry() or mach_make_memory_entry_64() 526 + */ 527 + 528 + /* vim: set ft=c : */
+69
kernel/mach/mach_voucher.defs
··· 1 + /* 2 + * Copyright (c) 2013 Apple Computer, Inc. All rights reserved. 3 + * 4 + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ 5 + * 6 + * This file contains Original Code and/or Modifications of Original Code 7 + * as defined in and that are subject to the Apple Public Source License 8 + * Version 2.0 (the 'License'). You may not use this file except in 9 + * compliance with the License. The rights granted to you under the License 10 + * may not be used to create, or enable the creation or redistribution of, 11 + * unlawful or unlicensed copies of an Apple operating system, or to 12 + * circumvent, violate, or enable the circumvention or violation of, any 13 + * terms of an Apple operating system software license agreement. 14 + * 15 + * Please obtain a copy of the License at 16 + * http://www.opensource.apple.com/apsl/ and read it before using this file. 17 + * 18 + * The Original Code and all software distributed under the License are 19 + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 20 + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 21 + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 22 + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 23 + * Please see the License for the specific language governing rights and 24 + * limitations under the License. 25 + * 26 + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ 27 + */ 28 + 29 + subsystem 30 + #if KERNEL_SERVER 31 + KernelServer 32 + #endif /* KERNEL_SERVER */ 33 + mach_voucher 5400; 34 + 35 + #include <mach/std_types.defs> 36 + #include <mach/mach_types.defs> 37 + 38 + /* extract just the content data for a <voucher, key> pair */ 39 + routine mach_voucher_extract_attr_content( 40 + voucher : ipc_voucher_t; 41 + key : mach_voucher_attr_key_t; 42 + out content : mach_voucher_attr_content_t, CountInOut); 43 + 44 + /* extract a recipe to reconstitue a <voucher, key> pair item in a future voucher */ 45 + routine mach_voucher_extract_attr_recipe( 46 + voucher : ipc_voucher_t; 47 + key : mach_voucher_attr_key_t; 48 + out recipe : mach_voucher_attr_raw_recipe_t, CountInOut); 49 + 50 + /* extract a recipe array to reconstitue all the key values in a future voucher */ 51 + routine mach_voucher_extract_all_attr_recipes( 52 + voucher : ipc_voucher_t; 53 + out recipes : mach_voucher_attr_raw_recipe_array_t, CountInOut); 54 + 55 + /* execute a command against a given voucher attribute */ 56 + routine mach_voucher_attr_command( 57 + voucher : ipc_voucher_t; 58 + key : mach_voucher_attr_key_t; 59 + command : mach_voucher_attr_command_t; 60 + in_content : mach_voucher_attr_content_t; 61 + out out_content : mach_voucher_attr_content_t, CountInOut); 62 + 63 + /* extract a recipe array to reconstitue all the key values in a future voucher */ 64 + routine mach_voucher_debug_info( 65 + task : ipc_space_t; 66 + voucher_name: mach_port_name_t; 67 + out recipes : mach_voucher_attr_raw_recipe_array_t, CountInOut); 68 + 69 + /* vim: set ft=c : */
+48
kernel/mach/mach_voucher_attr_control.defs
··· 1 + /* 2 + * Copyright (c) 2013 Apple Computer, Inc. All rights reserved. 3 + * 4 + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ 5 + * 6 + * This file contains Original Code and/or Modifications of Original Code 7 + * as defined in and that are subject to the Apple Public Source License 8 + * Version 2.0 (the 'License'). You may not use this file except in 9 + * compliance with the License. The rights granted to you under the License 10 + * may not be used to create, or enable the creation or redistribution of, 11 + * unlawful or unlicensed copies of an Apple operating system, or to 12 + * circumvent, violate, or enable the circumvention or violation of, any 13 + * terms of an Apple operating system software license agreement. 14 + * 15 + * Please obtain a copy of the License at 16 + * http://www.opensource.apple.com/apsl/ and read it before using this file. 17 + * 18 + * The Original Code and all software distributed under the License are 19 + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 20 + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 21 + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 22 + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 23 + * Please see the License for the specific language governing rights and 24 + * limitations under the License. 25 + * 26 + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ 27 + */ 28 + 29 + subsystem 30 + #if KERNEL_SERVER 31 + KernelServer 32 + #endif /* KERNEL_SERVER */ 33 + mach_voucher_attr_control 5600; 34 + 35 + #include <mach/std_types.defs> 36 + #include <mach/mach_types.defs> 37 + 38 + /* Extract the given voucher-control's value-handle from the supplied voucher */ 39 + routine mach_voucher_attr_control_get_values( 40 + control : ipc_voucher_attr_control_t; 41 + voucher : ipc_voucher_t; 42 + out value_handles : mach_voucher_attr_value_handle_array_t, CountInOut); 43 + 44 + /* Create a new voucher with the control's privilege (to directly assign value-handles) */ 45 + routine mach_voucher_attr_control_create_mach_voucher( 46 + control : ipc_voucher_attr_control_t; 47 + recipes : mach_voucher_attr_raw_recipe_array_t; 48 + out voucher : ipc_voucher_t);
+206
kernel/mach/memory_object.defs
··· 1 + /* 2 + * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. 3 + * 4 + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ 5 + * 6 + * This file contains Original Code and/or Modifications of Original Code 7 + * as defined in and that are subject to the Apple Public Source License 8 + * Version 2.0 (the 'License'). You may not use this file except in 9 + * compliance with the License. The rights granted to you under the License 10 + * may not be used to create, or enable the creation or redistribution of, 11 + * unlawful or unlicensed copies of an Apple operating system, or to 12 + * circumvent, violate, or enable the circumvention or violation of, any 13 + * terms of an Apple operating system software license agreement. 14 + * 15 + * Please obtain a copy of the License at 16 + * http://www.opensource.apple.com/apsl/ and read it before using this file. 17 + * 18 + * The Original Code and all software distributed under the License are 19 + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 20 + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 21 + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 22 + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 23 + * Please see the License for the specific language governing rights and 24 + * limitations under the License. 25 + * 26 + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ 27 + */ 28 + /* 29 + * @OSF_COPYRIGHT@ 30 + */ 31 + /* 32 + * Mach Operating System 33 + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University 34 + * All Rights Reserved. 35 + * 36 + * Permission to use, copy, modify and distribute this software and its 37 + * documentation is hereby granted, provided that both the copyright 38 + * notice and this permission notice appear in all copies of the 39 + * software, derivative works or modified versions, and any portions 40 + * thereof, and that both notices appear in supporting documentation. 41 + * 42 + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 43 + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR 44 + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 45 + * 46 + * Carnegie Mellon requests users of this software to return to 47 + * 48 + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 49 + * School of Computer Science 50 + * Carnegie Mellon University 51 + * Pittsburgh PA 15213-3890 52 + * 53 + * any improvements or extensions that they make and grant Carnegie Mellon 54 + * the rights to redistribute these changes. 55 + */ 56 + /* 57 + */ 58 + /* 59 + * File: mach/memory_object.defs 60 + * 61 + * Abstract: 62 + * Basic Mach external memory management interface declaration. 63 + */ 64 + 65 + subsystem 66 + #if KERNEL_USER 67 + KernelUser 68 + #endif /* KERNEL_USER */ 69 + #if KERNEL_SERVER 70 + KernelServer 71 + #endif /* KERNEL_SERVER */ 72 + memory_object 2200; 73 + 74 + #include <mach/std_types.defs> 75 + #include <mach/mach_types.defs> 76 + 77 + #if KERNEL_SERVER 78 + serverprefix dp_; 79 + #endif 80 + 81 + /* 82 + * Initialize the specified memory object, providing 83 + * a memory object control reference on which to make 84 + * cache control calls. 85 + * [To allow the mapping of this object to be used, the 86 + * memory manager must call memory_object_set_attributes, 87 + * specifying the "ready" parameter as TRUE. To reject 88 + * all mappings of this object, the memory manager may 89 + * use memory_object_destroy.] 90 + */ 91 + routine memory_object_init( 92 + memory_object : memory_object_t; 93 + memory_control : memory_object_control_t; 94 + memory_object_page_size : memory_object_cluster_size_t); 95 + 96 + 97 + /* 98 + * Indicates that the specified memory object is no longer 99 + * mapped (or cached -- see memory_object_set_attributes), 100 + * and that further mappings will cause another memory_object_init 101 + * call to be made. 102 + * 103 + * [The kernel will release its reference on the memory object 104 + * after this call returns. The memory object control associated 105 + * with the memory object is no longer usable - the pager should 106 + * drop the control reference granted to it by memory_object_init.] 107 + */ 108 + routine memory_object_terminate( 109 + memory_object : memory_object_t); 110 + 111 + /* 112 + * Request data from this memory object. At least 113 + * the specified data should be returned with at 114 + * least the specified access permitted. 115 + * 116 + * [Response should be upl commit over the specified range.] 117 + */ 118 + routine memory_object_data_request( 119 + memory_object : memory_object_t; 120 + offset : memory_object_offset_t; 121 + length : memory_object_cluster_size_t; 122 + desired_access : vm_prot_t; 123 + fault_info : memory_object_fault_info_t); 124 + 125 + /* 126 + * Return data to manager. This call is used in place of data_write 127 + * for objects initialized by object_ready instead of set_attributes. 128 + * This call indicates whether the returned data is dirty and whether 129 + * the kernel kept a copy. Precious data remains precious if the 130 + * kernel keeps a copy. The indication that the kernel kept a copy 131 + * is only a hint if the data is not precious; the cleaned copy may 132 + * be discarded without further notifying the manager. 133 + * 134 + * [response should be a upl_commit over the range specified] 135 + */ 136 + routine memory_object_data_return( 137 + memory_object : memory_object_t; 138 + offset : memory_object_offset_t; 139 + size : memory_object_cluster_size_t; 140 + out resid_offset : memory_object_offset_t; 141 + out io_error : int; 142 + dirty : boolean_t; 143 + kernel_copy : boolean_t; 144 + upl_flags : int); 145 + 146 + /* 147 + * Provide initial data contents for this region of 148 + * the memory object. If data has already been written 149 + * to the object, this value must be discarded; otherwise, 150 + * this call acts identically to memory_object_data_return. 151 + * 152 + * [response should be UPL commit over the specified range.] 153 + */ 154 + routine memory_object_data_initialize( 155 + memory_object : memory_object_t; 156 + offset : memory_object_offset_t; 157 + size : memory_object_cluster_size_t); 158 + 159 + /* 160 + * Request that the specified portion of this 161 + * memory object be unlocked to allow the specified 162 + * forms of access; the kernel already has the data. 163 + * 164 + * [Response should be memory_object_lock_request when 165 + * the operation is fully complete.] 166 + */ 167 + routine memory_object_data_unlock( 168 + memory_object : memory_object_t; 169 + offset : memory_object_offset_t; 170 + size : memory_object_size_t; 171 + desired_access : vm_prot_t); 172 + 173 + 174 + /* 175 + * Request that the specified portion of this 176 + * memory object be synchronized with its backing 177 + * store according to the supplied flags. 178 + * 179 + * [Response should be memory_object_synchronize_completed when 180 + * the operation is fully complete.] 181 + */ 182 + routine memory_object_synchronize( 183 + memory_object : memory_object_t; 184 + offset : memory_object_offset_t; 185 + size : memory_object_size_t; 186 + sync_flags : vm_sync_t ); 187 + 188 + /* 189 + * Notify the pager that the specified memory object 190 + * has no other (mapped) references besides the named 191 + * reference held by the pager itself. 192 + * 193 + * [Response should be a release of the named reference when 194 + * the pager deems that appropriate.] 195 + */ 196 + routine memory_object_map( 197 + memory_object : memory_object_t; 198 + prot : vm_prot_t); 199 + routine memory_object_last_unmap( 200 + memory_object : memory_object_t); 201 + 202 + routine memory_object_data_reclaim( 203 + memory_object : memory_object_t; 204 + reclaim_backing_store : boolean_t); 205 + 206 + /* vim: set ft=c : */
+195
kernel/mach/memory_object_control.defs
··· 1 + /* 2 + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. 3 + * 4 + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ 5 + * 6 + * This file contains Original Code and/or Modifications of Original Code 7 + * as defined in and that are subject to the Apple Public Source License 8 + * Version 2.0 (the 'License'). You may not use this file except in 9 + * compliance with the License. The rights granted to you under the License 10 + * may not be used to create, or enable the creation or redistribution of, 11 + * unlawful or unlicensed copies of an Apple operating system, or to 12 + * circumvent, violate, or enable the circumvention or violation of, any 13 + * terms of an Apple operating system software license agreement. 14 + * 15 + * Please obtain a copy of the License at 16 + * http://www.opensource.apple.com/apsl/ and read it before using this file. 17 + * 18 + * The Original Code and all software distributed under the License are 19 + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 20 + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 21 + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 22 + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 23 + * Please see the License for the specific language governing rights and 24 + * limitations under the License. 25 + * 26 + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ 27 + */ 28 + /* 29 + * @OSF_COPYRIGHT@ 30 + */ 31 + /* 32 + * Mach Operating System 33 + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University 34 + * All Rights Reserved. 35 + * 36 + * Permission to use, copy, modify and distribute this software and its 37 + * documentation is hereby granted, provided that both the copyright 38 + * notice and this permission notice appear in all copies of the 39 + * software, derivative works or modified versions, and any portions 40 + * thereof, and that both notices appear in supporting documentation. 41 + * 42 + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 43 + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR 44 + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 45 + * 46 + * Carnegie Mellon requests users of this software to return to 47 + * 48 + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 49 + * School of Computer Science 50 + * Carnegie Mellon University 51 + * Pittsburgh PA 15213-3890 52 + * 53 + * any improvements or extensions that they make and grant Carnegie Mellon 54 + * the rights to redistribute these changes. 55 + */ 56 + /* 57 + */ 58 + /* 59 + * File: mach/memory_object_control.defs 60 + * 61 + * Abstract: 62 + * Basic Mach external memory management interface declaration. 63 + */ 64 + 65 + subsystem 66 + #if KERNEL_USER 67 + KernelUser 68 + #endif /* KERNEL_USER */ 69 + #if KERNEL_SERVER 70 + KernelServer 71 + #endif /* KERNEL_SERVER */ 72 + memory_object_control 2000; 73 + 74 + #include <mach/std_types.defs> 75 + #include <mach/mach_types.defs> 76 + 77 + /* 78 + * Retrieves the attributes currently associated with 79 + * a memory object. 80 + */ 81 + routine memory_object_get_attributes( 82 + memory_control : memory_object_control_t; 83 + flavor : memory_object_flavor_t; 84 + out attributes : memory_object_info_t, CountInOut); 85 + 86 + 87 + routine memory_object_change_attributes( 88 + memory_control : memory_object_control_t; 89 + flavor : memory_object_flavor_t; 90 + attributes : memory_object_info_t 91 + ); 92 + 93 + routine memory_object_synchronize_completed ( 94 + memory_control : memory_object_control_t; 95 + offset : memory_object_offset_t; 96 + length : memory_object_size_t); 97 + 98 + /* 99 + * Control use of the data associated with the given 100 + * memory object. For each page in the given range, 101 + * perform the following operations, in order: 102 + * 1) restrict access to the page (disallow 103 + * forms specified by "prot"); 104 + * 2) write back modifications (if "should_return" 105 + * is RETURN_DIRTY and the page is dirty, or 106 + * "should_return" is RETURN_ALL and the page 107 + * is either dirty or precious); and, 108 + * 3) flush the cached copy (if "should_flush" 109 + * is asserted). 110 + * The set of pages is defined by a starting offset 111 + * ("offset") and size ("size"). Only pages with the 112 + * same page alignment as the starting offset are 113 + * considered. 114 + */ 115 + routine memory_object_lock_request( 116 + memory_control : memory_object_control_t; 117 + offset : memory_object_offset_t; 118 + size : memory_object_size_t; 119 + out resid_offset : memory_object_offset_t; 120 + out io_errno : integer_t; 121 + should_return : memory_object_return_t; 122 + flags : integer_t; 123 + lock_value : vm_prot_t 124 + ); 125 + 126 + 127 + /* 128 + */ 129 + routine memory_object_destroy( 130 + memory_control : memory_object_control_t; 131 + reason : kern_return_t); 132 + 133 + /* 134 + * The pager gets memory_object_data_request and memory_object_data_return 135 + * calls to inform it that data within the memory object needs to be 136 + * manipulated. Those requests simply identify the range in the memory 137 + * object that needs servicing, but not the data itself. The pager 138 + * turns around and requests one (or several) Universal Page Lists (UPLs) 139 + * from the VM cache object associated with the memory object via one 140 + * of the following calls. These UPLs are then committed (or aborted) 141 + * in whole (or in ranges) as the processing completes. 142 + */ 143 + 144 + routine memory_object_upl_request( 145 + memory_control : memory_object_control_t; 146 + in offset : memory_object_offset_t; 147 + in size : upl_size_t; 148 + out upl : upl_t; 149 + out page_list : upl_page_info_array_t, CountInOut; 150 + in cntrl_flags : integer_t); 151 + 152 + routine memory_object_super_upl_request( 153 + memory_control : memory_object_control_t; 154 + in offset : memory_object_offset_t; 155 + in size : upl_size_t; 156 + in super_size : upl_size_t; 157 + out upl : upl_t; 158 + out page_list : upl_page_info_array_t, CountInOut; 159 + in cntrl_flags : integer_t); 160 + 161 + 162 + routine memory_object_cluster_size( 163 + control : memory_object_control_t; 164 + out start : memory_object_offset_t; 165 + out length : vm_size_t; 166 + out io_streaming : uint32_t; 167 + in fault_info : memory_object_fault_info_t); 168 + 169 + /* 170 + * This functions allows a single page to be manipulated with less overhead 171 + * than creating a UPL. 172 + */ 173 + routine memory_object_page_op( 174 + memory_control : memory_object_control_t; 175 + in offset : memory_object_offset_t; 176 + in ops : integer_t; 177 + out phys_entry : uint32_t; 178 + out flags : integer_t); 179 + 180 + routine memory_object_recover_named( 181 + memory_control : memory_object_control_t; 182 + in wait_on_terminating : boolean_t); 183 + 184 + routine memory_object_release_name( 185 + memory_control : memory_object_control_t; 186 + flags : integer_t); 187 + 188 + routine memory_object_range_op( 189 + memory_control : memory_object_control_t; 190 + in offset_beg : memory_object_offset_t; 191 + in offset_end : memory_object_offset_t; 192 + in ops : integer_t; 193 + out range : integer_t); 194 + 195 + /* vim: set ft=c : */
+94
kernel/mach/memory_object_default.defs
··· 1 + /* 2 + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. 3 + * 4 + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ 5 + * 6 + * This file contains Original Code and/or Modifications of Original Code 7 + * as defined in and that are subject to the Apple Public Source License 8 + * Version 2.0 (the 'License'). You may not use this file except in 9 + * compliance with the License. The rights granted to you under the License 10 + * may not be used to create, or enable the creation or redistribution of, 11 + * unlawful or unlicensed copies of an Apple operating system, or to 12 + * circumvent, violate, or enable the circumvention or violation of, any 13 + * terms of an Apple operating system software license agreement. 14 + * 15 + * Please obtain a copy of the License at 16 + * http://www.opensource.apple.com/apsl/ and read it before using this file. 17 + * 18 + * The Original Code and all software distributed under the License are 19 + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 20 + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 21 + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 22 + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 23 + * Please see the License for the specific language governing rights and 24 + * limitations under the License. 25 + * 26 + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ 27 + */ 28 + /* 29 + * @OSF_COPYRIGHT@ 30 + */ 31 + /* 32 + * Mach Operating System 33 + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University 34 + * All Rights Reserved. 35 + * 36 + * Permission to use, copy, modify and distribute this software and its 37 + * documentation is hereby granted, provided that both the copyright 38 + * notice and this permission notice appear in all copies of the 39 + * software, derivative works or modified versions, and any portions 40 + * thereof, and that both notices appear in supporting documentation. 41 + * 42 + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 43 + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR 44 + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 45 + * 46 + * Carnegie Mellon requests users of this software to return to 47 + * 48 + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 49 + * School of Computer Science 50 + * Carnegie Mellon University 51 + * Pittsburgh PA 15213-3890 52 + * 53 + * any improvements or extensions that they make and grant Carnegie Mellon 54 + * the rights to redistribute these changes. 55 + */ 56 + /* 57 + */ 58 + /* 59 + * File: mach/memory_object_default.defs 60 + * 61 + * Abstract: 62 + * Mach external memory management interface declaration; subset 63 + * that is applicable to managers of kernel-created memory objects. 64 + */ 65 + 66 + subsystem 67 + #if KERNEL_USER 68 + KernelUser 69 + #endif /* KERNEL_USER */ 70 + #if KERNEL_SERVER 71 + KernelServer 72 + #endif /* KERNEL_SERVER */ 73 + memory_object_default 2250; 74 + 75 + #include <mach/std_types.defs> 76 + #include <mach/mach_types.defs> 77 + 78 + #if KERNEL_SERVER 79 + serverprefix default_pager_; 80 + #endif 81 + 82 + /* 83 + * Pass on responsibility for the new kernel-created memory 84 + * object. The port on which this request is that port 85 + * (possibly a memory object itself) registered as the "default 86 + * pager". Other arguments are as described for memory_object_init. 87 + * [No reply required.] 88 + */ 89 + routine memory_object_create( 90 + default_memory_manager : memory_object_default_t; 91 + new_memory_object_size : vm_size_t; 92 + out new_memory_object : memory_object_t); 93 + 94 + /* vim: set ft=c : */
+134
kernel/mach/notify.defs
··· 1 + /* 2 + * Copyright (c) 2000-2003 Apple Computer, Inc. All rights reserved. 3 + * 4 + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ 5 + * 6 + * This file contains Original Code and/or Modifications of Original Code 7 + * as defined in and that are subject to the Apple Public Source License 8 + * Version 2.0 (the 'License'). You may not use this file except in 9 + * compliance with the License. The rights granted to you under the License 10 + * may not be used to create, or enable the creation or redistribution of, 11 + * unlawful or unlicensed copies of an Apple operating system, or to 12 + * circumvent, violate, or enable the circumvention or violation of, any 13 + * terms of an Apple operating system software license agreement. 14 + * 15 + * Please obtain a copy of the License at 16 + * http://www.opensource.apple.com/apsl/ and read it before using this file. 17 + * 18 + * The Original Code and all software distributed under the License are 19 + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 20 + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 21 + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 22 + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 23 + * Please see the License for the specific language governing rights and 24 + * limitations under the License. 25 + * 26 + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ 27 + */ 28 + /* 29 + * @OSF_COPYRIGHT@ 30 + */ 31 + /* 32 + * Mach Operating System 33 + * Copyright (c) 1991,1990,1989 Carnegie Mellon University 34 + * All Rights Reserved. 35 + * 36 + * Permission to use, copy, modify and distribute this software and its 37 + * documentation is hereby granted, provided that both the copyright 38 + * notice and this permission notice appear in all copies of the 39 + * software, derivative works or modified versions, and any portions 40 + * thereof, and that both notices appear in supporting documentation. 41 + * 42 + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 43 + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR 44 + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 45 + * 46 + * Carnegie Mellon requests users of this software to return to 47 + * 48 + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 49 + * School of Computer Science 50 + * Carnegie Mellon University 51 + * Pittsburgh PA 15213-3890 52 + * 53 + * any improvements or extensions that they make and grant Carnegie Mellon 54 + * the rights to redistribute these changes. 55 + */ 56 + /* 57 + */ 58 + 59 + subsystem 60 + #if KERNEL_USER 61 + KernelUser 62 + #endif 63 + notify 64; 64 + 65 + #include <mach/std_types.defs> 66 + 67 + #if SEQNOS 68 + serverprefix do_seqnos_; 69 + serverdemux seqnos_notify_server; 70 + #else /* !SEQNOS */ 71 + serverprefix do_; 72 + serverdemux notify_server; 73 + #endif /* SEQNOS */ 74 + 75 + /* MACH_NOTIFY_FIRST: 0100 */ 76 + skip; 77 + 78 + /* MACH_NOTIFY_PORT_DELETED: 0101 */ 79 + simpleroutine mach_notify_port_deleted( 80 + notify : mach_port_move_send_once_t; 81 + #if SEQNOS 82 + msgseqno seqno : mach_port_seqno_t; 83 + #endif /* SEQNOS */ 84 + name : mach_port_name_t); 85 + 86 + #if (KERNEL_USER | MACH_NOTIFY_SEND_POSSIBLE_EXPECTED) 87 + /* MACH_NOTIFY_SEND_POSSIBLE: 0102 */ 88 + simpleroutine mach_notify_send_possible( 89 + notify : mach_port_move_send_once_t; 90 + #if SEQNOS 91 + msgseqno seqno : mach_port_seqno_t; 92 + #endif /* SEQNOS */ 93 + name : mach_port_name_t); 94 + #else 95 + skip; 96 + #endif 97 + 98 + skip; /* was NOTIFY_OWNERSHIP_RIGHTS: 0103 */ 99 + 100 + skip; /* was NOTIFY_RECEIVE_RIGHTS: 0104 */ 101 + 102 + /* MACH_NOTIFY_PORT_DESTROYED: 0105 */ 103 + simpleroutine mach_notify_port_destroyed( 104 + notify : mach_port_move_send_once_t; 105 + #if SEQNOS 106 + msgseqno seqno : mach_port_seqno_t; 107 + #endif /* SEQNOS */ 108 + rights : mach_port_move_receive_t); 109 + 110 + /* MACH_NOTIFY_NO_SENDERS: 0106 */ 111 + simpleroutine mach_notify_no_senders( 112 + notify : mach_port_move_send_once_t; 113 + #if SEQNOS 114 + msgseqno seqno : mach_port_seqno_t; 115 + #endif /* SEQNOS */ 116 + mscount : mach_port_mscount_t); 117 + 118 + /* MACH_NOTIFY_SEND_ONCE: 0107 */ 119 + simpleroutine mach_notify_send_once( 120 + notify : mach_port_move_send_once_t 121 + #if SEQNOS 122 + ; msgseqno seqno : mach_port_seqno_t 123 + #endif /* SEQNOS */ 124 + ); 125 + 126 + /* MACH_NOTIFY_DEAD_NAME: 0110 */ 127 + simpleroutine mach_notify_dead_name( 128 + notify : mach_port_move_send_once_t; 129 + #if SEQNOS 130 + msgseqno seqno : mach_port_seqno_t; 131 + #endif /* SEQNOS */ 132 + name : mach_port_name_t); 133 + 134 + /* vim: set ft=c : */
+128
kernel/mach/processor.defs
··· 1 + /* 2 + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. 3 + * 4 + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ 5 + * 6 + * This file contains Original Code and/or Modifications of Original Code 7 + * as defined in and that are subject to the Apple Public Source License 8 + * Version 2.0 (the 'License'). You may not use this file except in 9 + * compliance with the License. The rights granted to you under the License 10 + * may not be used to create, or enable the creation or redistribution of, 11 + * unlawful or unlicensed copies of an Apple operating system, or to 12 + * circumvent, violate, or enable the circumvention or violation of, any 13 + * terms of an Apple operating system software license agreement. 14 + * 15 + * Please obtain a copy of the License at 16 + * http://www.opensource.apple.com/apsl/ and read it before using this file. 17 + * 18 + * The Original Code and all software distributed under the License are 19 + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 20 + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 21 + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 22 + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 23 + * Please see the License for the specific language governing rights and 24 + * limitations under the License. 25 + * 26 + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ 27 + */ 28 + /* 29 + * @OSF_FREE_COPYRIGHT@ 30 + */ 31 + /* 32 + * Mach Operating System 33 + * Copyright (c) 1991,1990,1989 Carnegie Mellon University 34 + * All Rights Reserved. 35 + * 36 + * Permission to use, copy, modify and distribute this software and its 37 + * documentation is hereby granted, provided that both the copyright 38 + * notice and this permission notice appear in all copies of the 39 + * software, derivative works or modified versions, and any portions 40 + * thereof, and that both notices appear in supporting documentation. 41 + * 42 + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 43 + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR 44 + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 45 + * 46 + * Carnegie Mellon requests users of this software to return to 47 + * 48 + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 49 + * School of Computer Science 50 + * Carnegie Mellon University 51 + * Pittsburgh PA 15213-3890 52 + * 53 + * any improvements or extensions that they make and grant Carnegie Mellon 54 + * the rights to redistribute these changes. 55 + */ 56 + /* 57 + */ 58 + /* 59 + * File: mach/mach_port.defs 60 + * Author: Rich Draves 61 + * 62 + * Exported kernel calls. 63 + */ 64 + 65 + subsystem 66 + #if KERNEL_SERVER 67 + KernelServer 68 + #endif /* KERNEL_SERVER */ 69 + processor 3000; 70 + 71 + #include <mach/std_types.defs> 72 + #include <mach/mach_types.defs> 73 + 74 + /* 75 + * References to processor objects are returned by: 76 + * host_processors(host_priv_t,...); 77 + */ 78 + /* 79 + * Start processor. 80 + */ 81 + routine processor_start( 82 + processor : processor_t); 83 + 84 + /* 85 + * Exit processor -- may not be restartable. 86 + */ 87 + 88 + routine processor_exit( 89 + processor : processor_t); 90 + 91 + /* 92 + * Return information about this processor. 93 + */ 94 + routine processor_info( 95 + processor : processor_t; 96 + flavor : processor_flavor_t; 97 + out host : host_t; 98 + out processor_info_out: processor_info_t, CountInOut); 99 + 100 + 101 + /* 102 + * Do something machine-dependent to processor. 103 + */ 104 + routine processor_control( 105 + processor : processor_t; 106 + processor_cmd : processor_info_t); 107 + 108 + /* 109 + * JMM - Keep processor_set related stuff at the end because 110 + * they likely will be removed. 111 + */ 112 + 113 + /* 114 + * Assign processor to processor set. 115 + */ 116 + routine processor_assign( 117 + processor : processor_t; 118 + new_set : processor_set_t; 119 + wait : boolean_t); 120 + 121 + /* 122 + * Get current assignment for processor. 123 + */ 124 + routine processor_get_assignment( 125 + processor : processor_t; 126 + out assigned_set : processor_set_name_t); 127 + 128 + /* vim: set ft=c : */
+161
kernel/mach/processor_set.defs
··· 1 + /* 2 + * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. 3 + * 4 + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ 5 + * 6 + * This file contains Original Code and/or Modifications of Original Code 7 + * as defined in and that are subject to the Apple Public Source License 8 + * Version 2.0 (the 'License'). You may not use this file except in 9 + * compliance with the License. The rights granted to you under the License 10 + * may not be used to create, or enable the creation or redistribution of, 11 + * unlawful or unlicensed copies of an Apple operating system, or to 12 + * circumvent, violate, or enable the circumvention or violation of, any 13 + * terms of an Apple operating system software license agreement. 14 + * 15 + * Please obtain a copy of the License at 16 + * http://www.opensource.apple.com/apsl/ and read it before using this file. 17 + * 18 + * The Original Code and all software distributed under the License are 19 + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 20 + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 21 + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 22 + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 23 + * Please see the License for the specific language governing rights and 24 + * limitations under the License. 25 + * 26 + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ 27 + */ 28 + /* 29 + * @OSF_FREE_COPYRIGHT@ 30 + */ 31 + /* 32 + * Mach Operating System 33 + * Copyright (c) 1991,1990,1989 Carnegie Mellon University 34 + * All Rights Reserved. 35 + * 36 + * Permission to use, copy, modify and distribute this software and its 37 + * documentation is hereby granted, provided that both the copyright 38 + * notice and this permission notice appear in all copies of the 39 + * software, derivative works or modified versions, and any portions 40 + * thereof, and that both notices appear in supporting documentation. 41 + * 42 + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 43 + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR 44 + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 45 + * 46 + * Carnegie Mellon requests users of this software to return to 47 + * 48 + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 49 + * School of Computer Science 50 + * Carnegie Mellon University 51 + * Pittsburgh PA 15213-3890 52 + * 53 + * any improvements or extensions that they make and grant Carnegie Mellon 54 + * the rights to redistribute these changes. 55 + */ 56 + /* 57 + */ 58 + /* 59 + * File: mach/mach_port.defs 60 + * Author: Rich Draves 61 + * 62 + * Exported kernel calls. 63 + */ 64 + 65 + subsystem 66 + #if KERNEL_SERVER 67 + KernelServer 68 + #endif /* KERNEL_SERVER */ 69 + processor_set 4000; 70 + 71 + #include <mach/std_types.defs> 72 + #include <mach/mach_types.defs> 73 + 74 + /* 75 + * Return scheduling statistics for a processor set. 76 + */ 77 + routine processor_set_statistics( 78 + pset : processor_set_name_t; 79 + flavor : processor_set_flavor_t; 80 + out info_out : processor_set_info_t, CountInOut); 81 + 82 + 83 + /* 84 + * Destroy processor set. 85 + */ 86 + routine processor_set_destroy( 87 + set : processor_set_t); 88 + 89 + 90 + /* 91 + * Set max priority for processor_set. 92 + */ 93 + routine processor_set_max_priority( 94 + processor_set : processor_set_t; 95 + max_priority : int; 96 + change_threads : boolean_t); 97 + 98 + /* 99 + * Enable policy for processor set 100 + */ 101 + routine processor_set_policy_enable( 102 + processor_set : processor_set_t; 103 + policy : int); 104 + 105 + /* 106 + * Disable policy for processor set 107 + */ 108 + routine processor_set_policy_disable( 109 + processor_set : processor_set_t; 110 + policy : int; 111 + change_threads : boolean_t); 112 + 113 + /* 114 + * List all tasks in processor set. 115 + */ 116 + routine processor_set_tasks( 117 + processor_set : processor_set_t; 118 + out task_list : task_array_t); 119 + 120 + /* 121 + * List all threads in processor set. 122 + */ 123 + routine processor_set_threads( 124 + processor_set : processor_set_t; 125 + out thread_list : thread_act_array_t); 126 + 127 + /* 128 + * Controls the scheduling attributes governing the processor set. 129 + * Allows control of enabled policies, and per-policy base and limit 130 + * priorities. 131 + */ 132 + routine processor_set_policy_control( 133 + pset : processor_set_t; 134 + flavor : processor_set_flavor_t; 135 + policy_info : processor_set_info_t; 136 + change : boolean_t); 137 + 138 + 139 + /* 140 + * Debug Info 141 + * This call is only valid on MACH_DEBUG kernels. 142 + * Otherwise, KERN_FAILURE is returned. 143 + */ 144 + routine processor_set_stack_usage( 145 + pset : processor_set_t; 146 + out ltotal : unsigned; 147 + out space : vm_size_t; 148 + out resident : vm_size_t; 149 + out maxusage : vm_size_t; 150 + out maxstack : vm_offset_t); 151 + 152 + /* 153 + * Get information about processor set. 154 + */ 155 + routine processor_set_info( 156 + set_name : processor_set_name_t; 157 + flavor : int; 158 + out host : host_t; 159 + out info_out : processor_set_info_t, CountInOut); 160 + 161 + /* vim: set ft=c : */
+135
kernel/mach/prof.defs
··· 1 + /* 2 + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. 3 + * 4 + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ 5 + * 6 + * This file contains Original Code and/or Modifications of Original Code 7 + * as defined in and that are subject to the Apple Public Source License 8 + * Version 2.0 (the 'License'). You may not use this file except in 9 + * compliance with the License. The rights granted to you under the License 10 + * may not be used to create, or enable the creation or redistribution of, 11 + * unlawful or unlicensed copies of an Apple operating system, or to 12 + * circumvent, violate, or enable the circumvention or violation of, any 13 + * terms of an Apple operating system software license agreement. 14 + * 15 + * Please obtain a copy of the License at 16 + * http://www.opensource.apple.com/apsl/ and read it before using this file. 17 + * 18 + * The Original Code and all software distributed under the License are 19 + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 20 + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 21 + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 22 + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 23 + * Please see the License for the specific language governing rights and 24 + * limitations under the License. 25 + * 26 + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ 27 + */ 28 + /* 29 + * @OSF_COPYRIGHT@ 30 + */ 31 + /* 32 + * HISTORY 33 + * 34 + * Revision 1.1.1.1 1998/09/22 21:05:30 wsanchez 35 + * Import of Mac OS X kernel (~semeria) 36 + * 37 + * Revision 1.1.1.1 1998/03/07 02:25:46 wsanchez 38 + * Import of OSF Mach kernel (~mburg) 39 + * 40 + * Revision 1.2.12.3 1996/01/09 19:22:20 devrcs 41 + * Change notices: msgoption options from int to mach_msg_options_t. 42 + * [1995/12/01 19:49:49 jfraser] 43 + * 44 + * Merged '64-bit safe' changes from DEC alpha port. 45 + * [1995/11/21 18:09:30 jfraser] 46 + * 47 + * Revision 1.2.12.2 1995/01/06 19:51:41 devrcs 48 + * mk6 CR668 - 1.3b26 merge 49 + * * Revision 1.2.2.4 1994/03/24 21:23:54 hidden 50 + * added send_notices to support DCI profile/event tracing 51 + * * End1.3merge 52 + * [1994/11/02 18:32:19 dwm] 53 + * 54 + * Revision 1.2.12.1 1994/09/23 02:41:58 ezf 55 + * change marker to not FREE 56 + * [1994/09/22 21:42:31 ezf] 57 + * 58 + * Revision 1.2.2.2 1993/06/09 02:43:11 gm 59 + * Added to OSF/1 R1.3 from NMK15.0. 60 + * [1993/06/02 21:18:01 jeffc] 61 + * 62 + * Revision 1.2 1993/04/19 16:38:55 devrcs 63 + * [0014] Change subsystem number as current shared with exc.defs reply messages. 64 + * [1992/12/23 13:11:20 david] 65 + * 66 + * Revision 1.1 1992/09/30 02:23:01 robert 67 + * Initial revision 68 + * 69 + * $EndLog$ 70 + */ 71 + /* CMU_HIST */ 72 + /* 73 + * Revision 2.1.2.1 92/09/15 17:25:42 jeffreyh 74 + * Created 75 + * [92/07/17 bernadat] 76 + * 77 + */ 78 + /* CMU_ENDHIST */ 79 + /* 80 + * Mach Operating System 81 + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University 82 + * All Rights Reserved. 83 + * 84 + * Permission to use, copy, modify and distribute this software and its 85 + * documentation is hereby granted, provided that both the copyright 86 + * notice and this permission notice appear in all copies of the 87 + * software, derivative works or modified versions, and any portions 88 + * thereof, and that both notices appear in supporting documentation. 89 + * 90 + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 91 + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR 92 + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 93 + * 94 + * Carnegie Mellon requests users of this software to return to 95 + * 96 + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 97 + * School of Computer Science 98 + * Carnegie Mellon University 99 + * Pittsburgh PA 15213-3890 100 + * 101 + * any improvements or extensions that they make and grant Carnegie Mellon 102 + * the rights to redistribute these changes. 103 + */ 104 + /* 105 + */ 106 + /* 107 + * Abstract: 108 + * MiG definitions file for Mach Profiling interface. 109 + * receive_samples(); 110 + */ 111 + 112 + subsystem 113 + #if KERNEL_USER 114 + KernelUser 115 + #endif KERNEL_USER 116 + prof 2450; /* exc.defs from 2400 - 2449 */ 117 + 118 + #include <mach/std_types.defs> 119 + #include <mach/mach_types.defs> 120 + 121 + ServerPrefix receive_; 122 + UserPrefix send_; 123 + 124 + type sample_array_t = array[*:1024] of unsigned; 125 + 126 + simpleroutine samples( 127 + reply_port : mach_port_t; 128 + samples : sample_array_t); 129 + 130 + simpleroutine notices( 131 + reply_port : mach_port_t; 132 + samples : sample_array_t; 133 + msgoption options : mach_msg_options_t); 134 + 135 + /* vim: set ft=c : */
+83
kernel/mach/semaphore.defs
··· 1 + /* 2 + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. 3 + * 4 + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ 5 + * 6 + * This file contains Original Code and/or Modifications of Original Code 7 + * as defined in and that are subject to the Apple Public Source License 8 + * Version 2.0 (the 'License'). You may not use this file except in 9 + * compliance with the License. The rights granted to you under the License 10 + * may not be used to create, or enable the creation or redistribution of, 11 + * unlawful or unlicensed copies of an Apple operating system, or to 12 + * circumvent, violate, or enable the circumvention or violation of, any 13 + * terms of an Apple operating system software license agreement. 14 + * 15 + * Please obtain a copy of the License at 16 + * http://www.opensource.apple.com/apsl/ and read it before using this file. 17 + * 18 + * The Original Code and all software distributed under the License are 19 + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 20 + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 21 + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 22 + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 23 + * Please see the License for the specific language governing rights and 24 + * limitations under the License. 25 + * 26 + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ 27 + */ 28 + /* 29 + * @OSF_COPYRIGHT@ 30 + * 31 + */ 32 + /* 33 + * File: mach/semaphore.defs 34 + * Author: Joseph CaraDonna 35 + * 36 + * Exported kernel calls 37 + * 38 + */ 39 + 40 + subsystem 41 + #if KERNEL_SERVER 42 + KernelServer 43 + #endif /* KERNEL_SERVER */ 44 + semaphore 617200; 45 + 46 + #include <mach/std_types.defs> 47 + #include <mach/mach_types.defs> 48 + #include <mach/clock_types.defs> 49 + 50 + /* 51 + * a semaphore_t is created and destroyed through the task object. 52 + * semaphore_create(task_t,&semaphore_t,...); 53 + * semaphore_destroy(task_t,semaphore_t); 54 + */ 55 + 56 + routine semaphore_signal( 57 + semaphore : semaphore_t); 58 + 59 + routine semaphore_signal_all( 60 + semaphore : semaphore_t); 61 + 62 + routine semaphore_wait( 63 + semaphore : semaphore_t); 64 + 65 + 66 + routine semaphore_signal_thread( 67 + semaphore : semaphore_t; 68 + thread : thread_act_t); 69 + 70 + routine semaphore_timedwait( 71 + semaphore : semaphore_t; 72 + wait_time : mach_timespec_t); 73 + 74 + routine semaphore_wait_signal( 75 + wait_semaphore : semaphore_t; 76 + signal_semaphore: semaphore_t); 77 + 78 + routine semaphore_timedwait_signal( 79 + wait_semaphore : semaphore_t; 80 + signal_semaphore: semaphore_t; 81 + wait_time : mach_timespec_t); 82 + 83 + /* vim: set ft=c : */
+150
kernel/mach/std_types.defs
··· 1 + /* 2 + * Copyright (c) 2002,2000 Apple Computer, Inc. All rights reserved. 3 + * 4 + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ 5 + * 6 + * This file contains Original Code and/or Modifications of Original Code 7 + * as defined in and that are subject to the Apple Public Source License 8 + * Version 2.0 (the 'License'). You may not use this file except in 9 + * compliance with the License. The rights granted to you under the License 10 + * may not be used to create, or enable the creation or redistribution of, 11 + * unlawful or unlicensed copies of an Apple operating system, or to 12 + * circumvent, violate, or enable the circumvention or violation of, any 13 + * terms of an Apple operating system software license agreement. 14 + * 15 + * Please obtain a copy of the License at 16 + * http://www.opensource.apple.com/apsl/ and read it before using this file. 17 + * 18 + * The Original Code and all software distributed under the License are 19 + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 20 + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 21 + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 22 + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 23 + * Please see the License for the specific language governing rights and 24 + * limitations under the License. 25 + * 26 + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ 27 + */ 28 + /* 29 + * @OSF_COPYRIGHT@ 30 + */ 31 + /* 32 + * Mach Operating System 33 + * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University 34 + * All Rights Reserved. 35 + * 36 + * Permission to use, copy, modify and distribute this software and its 37 + * documentation is hereby granted, provided that both the copyright 38 + * notice and this permission notice appear in all copies of the 39 + * software, derivative works or modified versions, and any portions 40 + * thereof, and that both notices appear in supporting documentation. 41 + * 42 + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 43 + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR 44 + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 45 + * 46 + * Carnegie Mellon requests users of this software to return to 47 + * 48 + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 49 + * School of Computer Science 50 + * Carnegie Mellon University 51 + * Pittsburgh PA 15213-3890 52 + * 53 + * any improvements or extensions that they make and grant Carnegie Mellon 54 + * the rights to redistribute these changes. 55 + */ 56 + /* 57 + */ 58 + /* 59 + * Mach kernel standard interface type declarations 60 + */ 61 + 62 + #ifndef _MACH_STD_TYPES_DEFS_ 63 + #define _MACH_STD_TYPES_DEFS_ 64 + 65 + /* from ISO/IEC 988:1999 spec */ 66 + /* 7.18.1.1 Exact-width integer types */ 67 + 68 + type int8_t = MACH_MSG_TYPE_INTEGER_8; 69 + type uint8_t = MACH_MSG_TYPE_INTEGER_8; 70 + type int16_t = MACH_MSG_TYPE_INTEGER_16; 71 + type uint16_t = MACH_MSG_TYPE_INTEGER_16; 72 + type int32_t = MACH_MSG_TYPE_INTEGER_32; 73 + type uint32_t = MACH_MSG_TYPE_INTEGER_32; 74 + type int64_t = MACH_MSG_TYPE_INTEGER_64; 75 + type uint64_t = MACH_MSG_TYPE_INTEGER_64; 76 + 77 + /* 78 + * Legacy fixed-length Mach types which should 79 + * be replaced with the Standard types from above. 80 + */ 81 + type int32 = int32_t; 82 + type unsigned32 = uint32_t; 83 + type int64 = int64_t; 84 + type unsigned64 = uint64_t; 85 + 86 + /* 87 + * Other fixed length Mach types. 88 + */ 89 + type char = MACH_MSG_TYPE_CHAR; 90 + type boolean_t = MACH_MSG_TYPE_BOOLEAN; 91 + 92 + #include <mach/machine/machine_types.defs> 93 + 94 + type kern_return_t = int; 95 + 96 + type pointer_t = ^array[] of MACH_MSG_TYPE_BYTE 97 + ctype: vm_offset_t; 98 + 99 + 100 + type mach_port_t = MACH_MSG_TYPE_COPY_SEND; 101 + type mach_port_array_t = array[] of mach_port_t; 102 + 103 + type mach_port_name_t = MACH_MSG_TYPE_PORT_NAME; 104 + type mach_port_name_array_t = array[] of mach_port_name_t; 105 + 106 + type mach_port_right_t = natural_t; 107 + 108 + type mach_port_type_t = natural_t; 109 + type mach_port_type_array_t = array[] of mach_port_type_t; 110 + 111 + type mach_port_urefs_t = natural_t; 112 + type mach_port_delta_t = integer_t; 113 + type mach_port_seqno_t = natural_t; 114 + type mach_port_mscount_t = unsigned; 115 + type mach_port_msgcount_t = unsigned; 116 + type mach_port_rights_t = unsigned; 117 + type mach_msg_id_t = integer_t; 118 + type mach_msg_size_t = natural_t; 119 + type mach_msg_type_name_t = unsigned; 120 + type mach_msg_options_t = integer_t; 121 + 122 + type mach_port_move_receive_t = MACH_MSG_TYPE_MOVE_RECEIVE 123 + ctype: mach_port_t; 124 + type mach_port_copy_send_t = MACH_MSG_TYPE_COPY_SEND 125 + ctype: mach_port_t; 126 + type mach_port_make_send_t = MACH_MSG_TYPE_MAKE_SEND 127 + ctype: mach_port_t; 128 + type mach_port_move_send_t = MACH_MSG_TYPE_MOVE_SEND 129 + ctype: mach_port_t; 130 + type mach_port_make_send_once_t = MACH_MSG_TYPE_MAKE_SEND_ONCE 131 + ctype: mach_port_t; 132 + type mach_port_move_send_once_t = MACH_MSG_TYPE_MOVE_SEND_ONCE 133 + ctype: mach_port_t; 134 + 135 + type mach_port_receive_t = MACH_MSG_TYPE_PORT_RECEIVE 136 + ctype: mach_port_t; 137 + type mach_port_send_t = MACH_MSG_TYPE_PORT_SEND 138 + ctype: mach_port_t; 139 + type mach_port_send_once_t = MACH_MSG_TYPE_PORT_SEND_ONCE 140 + ctype: mach_port_t; 141 + 142 + type mach_port_poly_t = polymorphic 143 + ctype: mach_port_t; 144 + 145 + import <mach/std_types.h>; 146 + import <mach/mig.h>; 147 + 148 + #endif /* _MACH_STD_TYPES_DEFS_ */ 149 + 150 + /* vim: set ft=c : */
+145
kernel/mach/sync.defs
··· 1 + /* 2 + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. 3 + * 4 + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ 5 + * 6 + * This file contains Original Code and/or Modifications of Original Code 7 + * as defined in and that are subject to the Apple Public Source License 8 + * Version 2.0 (the 'License'). You may not use this file except in 9 + * compliance with the License. The rights granted to you under the License 10 + * may not be used to create, or enable the creation or redistribution of, 11 + * unlawful or unlicensed copies of an Apple operating system, or to 12 + * circumvent, violate, or enable the circumvention or violation of, any 13 + * terms of an Apple operating system software license agreement. 14 + * 15 + * Please obtain a copy of the License at 16 + * http://www.opensource.apple.com/apsl/ and read it before using this file. 17 + * 18 + * The Original Code and all software distributed under the License are 19 + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 20 + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 21 + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 22 + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 23 + * Please see the License for the specific language governing rights and 24 + * limitations under the License. 25 + * 26 + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ 27 + */ 28 + /* 29 + * @OSF_COPYRIGHT@ 30 + * 31 + */ 32 + /* 33 + * File: mach/sync.defs 34 + * Author: Joseph CaraDonna 35 + * 36 + * Exported kernel calls 37 + * 38 + */ 39 + 40 + subsystem 41 + #if KERNEL_SERVER 42 + KernelServer 43 + #endif /* KERNEL_SERVER */ 44 + sync 617000; 45 + 46 + #include <mach/std_types.defs> 47 + #include <mach/mach_types.defs> 48 + #include <mach/clock_types.defs> 49 + 50 + #if KERNEL_SERVER 51 + import <kern/sync_lock.h>; 52 + import <kern/sync_sema.h>; 53 + import <kern/ipc_sync.h>; 54 + #endif /* KERNEL_SERVER */ 55 + 56 + 57 + type semaphore_t = mach_port_t 58 + ctype: mach_port_t 59 + #if KERNEL_SERVER 60 + intran: semaphore_t convert_port_to_semaphore(mach_port_t) 61 + outtran: mach_port_t convert_semaphore_to_port(semaphore_t) 62 + destructor: semaphore_dereference(semaphore_t) 63 + #endif /* KERNEL_SERVER */ 64 + ; 65 + 66 + type semaphore_consume_ref_t = mach_port_move_send_t 67 + ctype: mach_port_t 68 + #if KERNEL_SERVER 69 + intran: semaphore_t convert_port_to_semaphore(mach_port_t) 70 + destructor: semaphore_dereference(semaphore_t) 71 + #endif /* KERNEL_SERVER */ 72 + ; 73 + 74 + type lock_set_t = mach_port_t 75 + ctype: mach_port_t 76 + #if KERNEL_SERVER 77 + intran: lock_set_t convert_port_to_lock_set(mach_port_t) 78 + outtran: mach_port_t convert_lock_set_to_port(lock_set_t) 79 + destructor: lock_set_dereference(lock_set_t) 80 + #endif /* KERNEL_SERVER */ 81 + ; 82 + 83 + 84 + routine semaphore_create( 85 + task : task_t; 86 + out semaphore : semaphore_t; 87 + policy : int; 88 + value : int); 89 + 90 + routine semaphore_destroy( 91 + task : task_t; 92 + semaphore : semaphore_consume_ref_t); 93 + 94 + routine semaphore_signal( 95 + semaphore : semaphore_t); 96 + 97 + routine semaphore_signal_all( 98 + semaphore : semaphore_t); 99 + 100 + routine semaphore_wait( 101 + semaphore : semaphore_t); 102 + 103 + routine lock_set_create( 104 + task : task_t; 105 + out new_lock_set : lock_set_t; 106 + n_ulocks : int; 107 + policy : int); 108 + 109 + routine lock_set_destroy( 110 + task : task_t; 111 + lock_set : lock_set_t); 112 + 113 + routine lock_acquire( 114 + lock_set : lock_set_t; 115 + lock_id : int); 116 + 117 + routine lock_release( 118 + lock_set : lock_set_t; 119 + lock_id : int); 120 + 121 + routine lock_try( 122 + lock_set : lock_set_t; 123 + lock_id : int); 124 + 125 + routine lock_make_stable( 126 + lock_set : lock_set_t; 127 + lock_id : int); 128 + 129 + routine lock_handoff( 130 + lock_set : lock_set_t; 131 + lock_id : int); 132 + 133 + routine lock_handoff_accept( 134 + lock_set : lock_set_t; 135 + lock_id : int); 136 + 137 + routine semaphore_signal_thread( 138 + semaphore : semaphore_t; 139 + thread : thread_act_t); 140 + 141 + routine semaphore_timedwait( 142 + semaphore : semaphore_t; 143 + wait_time : mach_timespec_t); 144 + 145 + /* vim: set ft=c : */
+454
kernel/mach/task.defs
··· 1 + /* 2 + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. 3 + * 4 + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ 5 + * 6 + * This file contains Original Code and/or Modifications of Original Code 7 + * as defined in and that are subject to the Apple Public Source License 8 + * Version 2.0 (the 'License'). You may not use this file except in 9 + * compliance with the License. The rights granted to you under the License 10 + * may not be used to create, or enable the creation or redistribution of, 11 + * unlawful or unlicensed copies of an Apple operating system, or to 12 + * circumvent, violate, or enable the circumvention or violation of, any 13 + * terms of an Apple operating system software license agreement. 14 + * 15 + * Please obtain a copy of the License at 16 + * http://www.opensource.apple.com/apsl/ and read it before using this file. 17 + * 18 + * The Original Code and all software distributed under the License are 19 + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 20 + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 21 + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 22 + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 23 + * Please see the License for the specific language governing rights and 24 + * limitations under the License. 25 + * 26 + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ 27 + */ 28 + /* 29 + * @OSF_FREE_COPYRIGHT@ 30 + */ 31 + /* 32 + * Mach Operating System 33 + * Copyright (c) 1991,1990,1989 Carnegie Mellon University 34 + * All Rights Reserved. 35 + * 36 + * Permission to use, copy, modify and distribute this software and its 37 + * documentation is hereby granted, provided that both the copyright 38 + * notice and this permission notice appear in all copies of the 39 + * software, derivative works or modified versions, and any portions 40 + * thereof, and that both notices appear in supporting documentation. 41 + * 42 + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 43 + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR 44 + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 45 + * 46 + * Carnegie Mellon requests users of this software to return to 47 + * 48 + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 49 + * School of Computer Science 50 + * Carnegie Mellon University 51 + * Pittsburgh PA 15213-3890 52 + * 53 + * any improvements or extensions that they make and grant Carnegie Mellon 54 + * the rights to redistribute these changes. 55 + */ 56 + /* 57 + */ 58 + /* 59 + * File: mach/mach_port.defs 60 + * Author: Rich Draves 61 + * 62 + * Exported kernel calls. 63 + */ 64 + 65 + subsystem 66 + #if KERNEL_SERVER 67 + KernelServer 68 + #endif /* KERNEL_SERVER */ 69 + task 3400; 70 + 71 + #include <mach/std_types.defs> 72 + #include <mach/mach_types.defs> 73 + #include <mach_debug/mach_debug_types.defs> 74 + 75 + /* 76 + * Create a new task with an empty set of IPC rights, 77 + * and having an address space constructed from the 78 + * target task (or empty, if inherit_memory is FALSE). 79 + */ 80 + routine task_create( 81 + target_task : task_t; 82 + ledgers : ledger_array_t; 83 + inherit_memory : boolean_t; 84 + out child_task : task_t); 85 + 86 + /* 87 + * Destroy the target task, causing all of its threads 88 + * to be destroyed, all of its IPC rights to be deallocated, 89 + * and all of its address space to be deallocated. 90 + */ 91 + routine task_terminate( 92 + target_task : task_t); 93 + 94 + /* 95 + * Returns the set of threads belonging to the target task. 96 + */ 97 + routine task_threads( 98 + target_task : task_t; 99 + out act_list : thread_act_array_t); 100 + 101 + /* 102 + * Stash a handful of ports for the target task; child 103 + * tasks inherit this stash at task_create time. 104 + */ 105 + routine mach_ports_register( 106 + target_task : task_t; 107 + init_port_set : mach_port_array_t = 108 + ^array[] of mach_port_t); 109 + 110 + /* 111 + * Retrieve the stashed ports for the target task. 112 + */ 113 + routine mach_ports_lookup( 114 + target_task : task_t; 115 + out init_port_set : mach_port_array_t = 116 + ^array[] of mach_port_t); 117 + 118 + /* 119 + * Returns information about the target task. 120 + */ 121 + routine task_info( 122 + target_task : task_name_t; 123 + flavor : task_flavor_t; 124 + out task_info_out : task_info_t, CountInOut); 125 + 126 + /* 127 + * Set task information. 128 + */ 129 + routine task_set_info( 130 + target_task : task_t; 131 + flavor : task_flavor_t; 132 + task_info_in : task_info_t); 133 + 134 + /* 135 + * Increment the suspend count for the target task. 136 + * No threads within a task may run when the suspend 137 + * count for that task is non-zero. 138 + */ 139 + routine task_suspend( 140 + target_task : task_t); 141 + 142 + 143 + /* 144 + * Decrement the suspend count for the target task, 145 + * if the count is currently non-zero. If the resulting 146 + * suspend count is zero, then threads within the task 147 + * that also have non-zero suspend counts may execute. 148 + */ 149 + routine task_resume( 150 + target_task : task_t); 151 + 152 + /* 153 + * Returns the current value of the selected special port 154 + * associated with the target task. 155 + */ 156 + routine task_get_special_port( 157 + task : task_t; 158 + which_port : int; 159 + out special_port : mach_port_t); 160 + 161 + /* 162 + * Set one of the special ports associated with the 163 + * target task. 164 + */ 165 + routine task_set_special_port( 166 + task : task_t; 167 + which_port : int; 168 + special_port : mach_port_t); 169 + 170 + /* 171 + * Create a new thread within the target task, returning 172 + * the port representing the first thr_act in that new thread. The 173 + * initial execution state of the thread is undefined. 174 + */ 175 + routine 176 + #ifdef KERNEL_SERVER 177 + thread_create_from_user( 178 + #else 179 + thread_create( 180 + #endif 181 + parent_task : task_t; 182 + out child_act : thread_act_t); 183 + 184 + /* 185 + * Create a new thread within the target task, returning 186 + * the port representing that new thread. The new thread 187 + * is not suspended; its initial execution state is given 188 + * by flavor and new_state. Returns the port representing 189 + * the new thread. 190 + */ 191 + routine 192 + #ifdef KERNEL_SERVER 193 + thread_create_running_from_user( 194 + #else 195 + thread_create_running( 196 + #endif 197 + parent_task : task_t; 198 + flavor : thread_state_flavor_t; 199 + new_state : thread_state_t; 200 + out child_act : thread_act_t); 201 + 202 + /* 203 + * Set an exception handler for a task on one or more exception types. 204 + * These handlers are invoked for all threads in the task if there are 205 + * no thread-specific exception handlers or those handlers returned an 206 + * error. 207 + */ 208 + routine task_set_exception_ports( 209 + task : task_t; 210 + exception_mask : exception_mask_t; 211 + new_port : mach_port_t; 212 + behavior : exception_behavior_t; 213 + new_flavor : thread_state_flavor_t); 214 + 215 + 216 + /* 217 + * Lookup some of the old exception handlers for a task 218 + */ 219 + routine task_get_exception_ports( 220 + task : task_t; 221 + exception_mask : exception_mask_t; 222 + out masks : exception_mask_array_t; 223 + out old_handlers : exception_handler_array_t, SameCount; 224 + out old_behaviors : exception_behavior_array_t, SameCount; 225 + out old_flavors : exception_flavor_array_t, SameCount); 226 + 227 + 228 + /* 229 + * Set an exception handler for a thread on one or more exception types. 230 + * At the same time, return the previously defined exception handlers for 231 + * those types. 232 + */ 233 + routine task_swap_exception_ports( 234 + task : task_t; 235 + exception_mask : exception_mask_t; 236 + new_port : mach_port_t; 237 + behavior : exception_behavior_t; 238 + new_flavor : thread_state_flavor_t; 239 + out masks : exception_mask_array_t; 240 + out old_handlerss : exception_handler_array_t, SameCount; 241 + out old_behaviors : exception_behavior_array_t, SameCount; 242 + out old_flavors : exception_flavor_array_t, SameCount); 243 + 244 + /* 245 + * OBSOLETE interface. 246 + */ 247 + routine lock_set_create( 248 + task : task_t; 249 + out new_lock_set : lock_set_t; 250 + n_ulocks : int; 251 + policy : int); 252 + 253 + /* 254 + * OBSOLETE interface. 255 + */ 256 + routine lock_set_destroy( 257 + task : task_t; 258 + lock_set : lock_set_t); 259 + 260 + /* 261 + * Create and destroy semaphore synchronizers on a 262 + * per-task basis (i.e. the task owns them). 263 + */ 264 + 265 + routine semaphore_create( 266 + task : task_t; 267 + out semaphore : semaphore_t; 268 + policy : int; 269 + value : int); 270 + 271 + routine semaphore_destroy( 272 + task : task_t; 273 + semaphore : semaphore_consume_ref_t); 274 + 275 + /* 276 + * Set/get policy information for a task. 277 + * (Approved Mac OS X microkernel interface) 278 + */ 279 + 280 + routine task_policy_set( 281 + task : task_t; 282 + flavor : task_policy_flavor_t; 283 + policy_info : task_policy_t); 284 + 285 + routine task_policy_get( 286 + task : task_t; 287 + flavor : task_policy_flavor_t; 288 + out policy_info : task_policy_t, CountInOut; 289 + inout get_default : boolean_t); 290 + 291 + /* 292 + * Removed from the kernel. 293 + */ 294 + #if KERNEL_SERVER 295 + skip; 296 + #else 297 + routine task_sample( 298 + task : task_t; 299 + reply : mach_port_make_send_t); 300 + #endif 301 + 302 + /* 303 + * JMM - Everything from here down is likely to go away soon 304 + */ 305 + /* 306 + * OBSOLETE interface. 307 + */ 308 + routine task_policy( 309 + task : task_t; 310 + policy : policy_t; 311 + base : policy_base_t; 312 + set_limit : boolean_t; 313 + change : boolean_t); 314 + 315 + 316 + /* 317 + * Establish a user-level handler for the specified 318 + * system call. 319 + */ 320 + routine task_set_emulation( 321 + target_port : task_t; 322 + routine_entry_pt: vm_address_t; 323 + routine_number : int); 324 + 325 + /* 326 + * Get user-level handler entry points for all 327 + * emulated system calls. 328 + */ 329 + routine task_get_emulation_vector( 330 + task : task_t; 331 + out vector_start : int; 332 + out emulation_vector: emulation_vector_t); 333 + 334 + /* 335 + * Establish user-level handlers for the specified 336 + * system calls. Non-emulated system calls are specified 337 + * with emulation_vector[i] == EML_ROUTINE_NULL. 338 + */ 339 + routine task_set_emulation_vector( 340 + task : task_t; 341 + vector_start : int; 342 + emulation_vector: emulation_vector_t); 343 + 344 + 345 + /* 346 + * Establish restart pc for interrupted atomic sequences. 347 + */ 348 + routine task_set_ras_pc( 349 + target_task : task_t; 350 + basepc : vm_address_t; 351 + boundspc : vm_address_t); 352 + 353 + 354 + /* 355 + * Return zone info as seen/used by this task. 356 + */ 357 + routine task_zone_info( 358 + target_task : task_t; 359 + out names : mach_zone_name_array_t, 360 + Dealloc; 361 + out info : task_zone_info_array_t, 362 + Dealloc); 363 + 364 + 365 + /* 366 + * JMM - Want to eliminate processor_set so keep them at the end. 367 + */ 368 + 369 + /* 370 + * Assign task to processor set. 371 + */ 372 + routine task_assign( 373 + task : task_t; 374 + new_set : processor_set_t; 375 + assign_threads : boolean_t); 376 + 377 + /* 378 + * Assign task to default set. 379 + */ 380 + routine task_assign_default( 381 + task : task_t; 382 + assign_threads : boolean_t); 383 + 384 + /* 385 + * Get current assignment for task. 386 + */ 387 + routine task_get_assignment( 388 + task : task_t; 389 + out assigned_set : processor_set_name_t); 390 + 391 + /* 392 + * OBSOLETE interface. 393 + */ 394 + routine task_set_policy( 395 + task : task_t; 396 + pset : processor_set_t; 397 + policy : policy_t; 398 + base : policy_base_t; 399 + limit : policy_limit_t; 400 + change : boolean_t); 401 + 402 + /* 403 + * Read the selected state which is to be installed on new 404 + * threads in the task as they are created. 405 + */ 406 + routine task_get_state( 407 + task : task_t; 408 + flavor : thread_state_flavor_t; 409 + out old_state : thread_state_t, CountInOut); 410 + 411 + /* 412 + * Set the selected state information to be installed on 413 + * all subsequently created threads in the task. 414 + */ 415 + routine task_set_state( 416 + task : task_t; 417 + flavor : thread_state_flavor_t; 418 + new_state : thread_state_t); 419 + 420 + /* 421 + * Change the task's physical footprint limit (in MB). 422 + */ 423 + routine task_set_phys_footprint_limit( 424 + task : task_t; 425 + new_limit : int; 426 + out old_limit : int); 427 + 428 + routine task_suspend2( 429 + target_task : task_t; 430 + out suspend_token : task_suspension_token_t); 431 + 432 + routine task_resume2( 433 + suspend_token : task_suspension_token_t); 434 + 435 + routine task_purgable_info( 436 + task : task_t; 437 + out stats : task_purgable_info_t); 438 + 439 + routine task_get_mach_voucher( 440 + task : task_t; 441 + which : mach_voucher_selector_t; 442 + out voucher : ipc_voucher_t); 443 + 444 + routine task_set_mach_voucher( 445 + task : task_t; 446 + voucher : ipc_voucher_t); 447 + 448 + routine task_swap_mach_voucher( 449 + task : task_t; 450 + new_voucher : ipc_voucher_t; 451 + inout old_voucher : ipc_voucher_t); 452 + 453 + /* vim: set ft=c : */ 454 +
+59
kernel/mach/task_access.defs
··· 1 + /* 2 + * Copyright (c) 2006 Apple Computer, Inc. All rights reserved. 3 + * 4 + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ 5 + * 6 + * This file contains Original Code and/or Modifications of Original Code 7 + * as defined in and that are subject to the Apple Public Source License 8 + * Version 2.0 (the 'License'). You may not use this file except in 9 + * compliance with the License. The rights granted to you under the License 10 + * may not be used to create, or enable the creation or redistribution of, 11 + * unlawful or unlicensed copies of an Apple operating system, or to 12 + * circumvent, violate, or enable the circumvention or violation of, any 13 + * terms of an Apple operating system software license agreement. 14 + * 15 + * Please obtain a copy of the License at 16 + * http://www.opensource.apple.com/apsl/ and read it before using this file. 17 + * 18 + * The Original Code and all software distributed under the License are 19 + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 20 + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 21 + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 22 + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 23 + * Please see the License for the specific language governing rights and 24 + * limitations under the License. 25 + * 26 + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ 27 + */ 28 + /* 29 + * @OSF_COPYRIGHT@ 30 + */ 31 + 32 + subsystem 33 + #if KERNEL_USER 34 + KernelUser 35 + #endif /* KERN_USER */ 36 + task_access 27000; 37 + 38 + #include <mach/std_types.defs> 39 + #include <mach/mach_types.defs> 40 + 41 + /* 42 + * Verify task_for_pid access for the given pid 43 + * Access granted by return value (success/failure) 44 + */ 45 + routine check_task_access( 46 + task_access_port : mach_port_t; 47 + calling_pid : int32_t; 48 + calling_gid : uint32_t; 49 + target_pid : int32_t; 50 + ServerAuditToken caller_cred : audit_token_t); 51 + 52 + /* 53 + * Search for a code signature for unsigned executables 54 + */ 55 + routine find_code_signature( 56 + task_access_port : mach_port_t; 57 + new_pid : int32_t); 58 + 59 + /* vim: set ft=c : */
+20
kernel/mach/telemetry_notification.defs
··· 1 + /* 2 + * Copyright (c) 2012, Apple Inc. All rights reserved. 3 + */ 4 + 5 + /* 6 + * Interface definition for the telemetry facility. 7 + */ 8 + 9 + subsystem 10 + #if KERNEL_USER 11 + KernelUser 12 + #endif /* KERNEL_USER */ 13 + telemetry_notification 5100; 14 + 15 + #include <mach/std_types.defs> 16 + #include <mach/mach_types.defs> 17 + 18 + simpleroutine telemetry_notification( 19 + RequestPort telemetry_port : mach_port_t; 20 + in flags : uint32_t);
+353
kernel/mach/thread_act.defs
··· 1 + /* 2 + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. 3 + * 4 + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ 5 + * 6 + * This file contains Original Code and/or Modifications of Original Code 7 + * as defined in and that are subject to the Apple Public Source License 8 + * Version 2.0 (the 'License'). You may not use this file except in 9 + * compliance with the License. The rights granted to you under the License 10 + * may not be used to create, or enable the creation or redistribution of, 11 + * unlawful or unlicensed copies of an Apple operating system, or to 12 + * circumvent, violate, or enable the circumvention or violation of, any 13 + * terms of an Apple operating system software license agreement. 14 + * 15 + * Please obtain a copy of the License at 16 + * http://www.opensource.apple.com/apsl/ and read it before using this file. 17 + * 18 + * The Original Code and all software distributed under the License are 19 + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 20 + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 21 + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 22 + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 23 + * Please see the License for the specific language governing rights and 24 + * limitations under the License. 25 + * 26 + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ 27 + */ 28 + /* 29 + * @OSF_FREE_COPYRIGHT@ 30 + */ 31 + /* 32 + * Mach Operating System 33 + * Copyright (c) 1991,1990,1989 Carnegie Mellon University 34 + * All Rights Reserved. 35 + * 36 + * Permission to use, copy, modify and distribute this software and its 37 + * documentation is hereby granted, provided that both the copyright 38 + * notice and this permission notice appear in all copies of the 39 + * software, derivative works or modified versions, and any portions 40 + * thereof, and that both notices appear in supporting documentation. 41 + * 42 + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 43 + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR 44 + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 45 + * 46 + * Carnegie Mellon requests users of this software to return to 47 + * 48 + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 49 + * School of Computer Science 50 + * Carnegie Mellon University 51 + * Pittsburgh PA 15213-3890 52 + * 53 + * any improvements or extensions that they make and grant Carnegie Mellon 54 + * the rights to redistribute these changes. 55 + */ 56 + /* 57 + */ 58 + /* 59 + * File: mach/mach_port.defs 60 + * Author: Rich Draves 61 + * 62 + * Exported kernel calls. 63 + */ 64 + 65 + subsystem 66 + #if KERNEL_SERVER 67 + KernelServer 68 + #endif /* KERNEL_SERVER */ 69 + thread_act 3600; 70 + 71 + #include <mach/std_types.defs> 72 + #include <mach/mach_types.defs> 73 + 74 + #if !KERNEL && !LIBSYSCALL_INTERFACE 75 + #define PREFIX(NAME) _kernelrpc_ ## NAME 76 + #else 77 + #define PREFIX(NAME) NAME 78 + #endif 79 + 80 + /* 81 + * Destroy the target thread. 82 + * 83 + * JMM - For legacy reasons this consumes a reference to the 84 + * target thread. This will have to change in the future because 85 + * we want the interfaces to be able to be defined in more standard 86 + * IDLs and transports, and most of them do not support the notion 87 + * of reference ownership transfers (just sharing). 88 + */ 89 + routine thread_terminate( 90 + target_act : thread_act_consume_ref_t); 91 + 92 + 93 + /* 94 + * Return the selected state information for the target 95 + * thr_act. If the thr_act is currently executing, the results 96 + * may be stale. [Flavor THREAD_STATE_FLAVOR_LIST provides a 97 + * list of valid flavors for the target thread.] 98 + */ 99 + routine act_get_state( 100 + target_act : thread_act_t; 101 + flavor : int; 102 + out old_state : thread_state_t, CountInOut); 103 + 104 + /* 105 + * Set the selected state information for the target thread. 106 + * If the thread is currently executing, the state change 107 + * may be ill-defined. 108 + */ 109 + routine 110 + #ifdef KERNEL_SERVER 111 + act_set_state_from_user( 112 + #else 113 + act_set_state( 114 + #endif 115 + target_act : thread_act_t; 116 + flavor : int; 117 + new_state : thread_state_t); 118 + 119 + /* 120 + * Backward compatible old-style thread routines. 121 + * These have different semantics than the new activation versions. 122 + * 123 + * Return the selected state information for the target 124 + * thread. If the thread is currently executing, the results 125 + * may be stale. [Flavor THREAD_STATE_FLAVOR_LIST provides a 126 + * list of valid flavors for the target thr_act.] 127 + */ 128 + routine thread_get_state( 129 + target_act : thread_act_t; 130 + flavor : thread_state_flavor_t; 131 + out old_state : thread_state_t, CountInOut); 132 + 133 + /* 134 + * Set the selected state information for the target thread. 135 + * If the thread is currently executing, the state change 136 + * may be ill-defined. 137 + */ 138 + routine 139 + #ifdef KERNEL_SERVER 140 + thread_set_state_from_user( 141 + #else 142 + thread_set_state( 143 + #endif 144 + target_act : thread_act_t; 145 + flavor : thread_state_flavor_t; 146 + new_state : thread_state_t); 147 + 148 + /* 149 + * Increment the suspend count for the target thread. 150 + * Once this call has completed, the thread will not 151 + * execute any further user or meta- instructions. 152 + * Once suspended, a thread may not execute again until 153 + * its suspend count is zero, and the suspend count 154 + * for its task is also zero. 155 + */ 156 + routine thread_suspend( 157 + target_act : thread_act_t); 158 + 159 + /* 160 + * Decrement the suspend count for the target thread, 161 + * if that count is not already zero. 162 + */ 163 + routine thread_resume( 164 + target_act : thread_act_t); 165 + 166 + /* 167 + * Cause any user or meta- instructions currently being 168 + * executed by the target thread to be aborted. [Meta- 169 + * instructions consist of the basic traps for IPC 170 + * (e.g., msg_send, msg_receive) and self-identification 171 + * (e.g., task_self, thread_self, thread_reply). Calls 172 + * described by MiG interfaces are not meta-instructions 173 + * themselves.] 174 + */ 175 + routine thread_abort( 176 + target_act : thread_act_t); 177 + 178 + /* 179 + * Cause any user or meta- instructions currently being 180 + * executed by the target thread to be aborted so that 181 + * they are transparently restartable. This call fails 182 + * if the abort would result in a non-restartable condition. 183 + * Retry is the caller's responsibility. [Meta- 184 + * instructions consist of the basic traps for IPC 185 + * (e.g., msg_send, msg_receive) and self-identification 186 + * (e.g., task_self, thread_self, thread_reply). Calls 187 + * described by MiG interfaces are not meta-instructions 188 + * themselves.] 189 + */ 190 + routine thread_abort_safely( 191 + target_act : thread_act_t); 192 + 193 + 194 + routine thread_depress_abort( 195 + thread : thread_act_t); 196 + 197 + 198 + /* 199 + * Returns the current value of the selected special port 200 + * associated with the target thread. 201 + */ 202 + routine thread_get_special_port( 203 + thr_act : thread_act_t; 204 + which_port : int; 205 + out special_port : mach_port_t); 206 + 207 + /* 208 + * Set one of the special ports associated with the 209 + * target thread. 210 + */ 211 + routine thread_set_special_port( 212 + thr_act : thread_act_t; 213 + which_port : int; 214 + special_port : mach_port_t); 215 + 216 + /* 217 + * Returns information about the target thread. 218 + */ 219 + routine thread_info( 220 + target_act : thread_act_t; 221 + flavor : thread_flavor_t; 222 + out thread_info_out : thread_info_t, CountInOut); 223 + 224 + /* 225 + * Set an exception handler for a thread on one or more exception types 226 + */ 227 + routine thread_set_exception_ports( 228 + thread : thread_act_t; 229 + exception_mask : exception_mask_t; 230 + new_port : mach_port_t; 231 + behavior : exception_behavior_t; 232 + new_flavor : thread_state_flavor_t); 233 + 234 + /* 235 + * Lookup some of the old exception handlers for a thread 236 + */ 237 + routine thread_get_exception_ports( 238 + thread : thread_act_t; 239 + exception_mask : exception_mask_t; 240 + out masks : exception_mask_array_t; 241 + out old_handlers : exception_handler_array_t, SameCount; 242 + out old_behaviors : exception_behavior_array_t, SameCount; 243 + out old_flavors : exception_flavor_array_t, SameCount); 244 + 245 + /* 246 + * Set an exception handler for a thread on one or more exception types. 247 + * At the same time, return the previously defined exception handlers for 248 + * those types. 249 + */ 250 + routine thread_swap_exception_ports( 251 + thread : thread_act_t; 252 + exception_mask : exception_mask_t; 253 + new_port : mach_port_t; 254 + behavior : exception_behavior_t; 255 + new_flavor : thread_state_flavor_t; 256 + out masks : exception_mask_array_t; 257 + out old_handlers : exception_handler_array_t, SameCount; 258 + out old_behaviors : exception_behavior_array_t, SameCount; 259 + out old_flavors : exception_flavor_array_t, SameCount); 260 + 261 + /* 262 + * OBSOLETE interface. 263 + */ 264 + routine PREFIX(thread_policy)( 265 + thr_act : thread_act_t; 266 + policy : policy_t; 267 + base : policy_base_t; 268 + set_limit : boolean_t); 269 + 270 + /* 271 + * Set/get policy information for a thread. 272 + * (Approved Mac OS X microkernel interface) 273 + */ 274 + 275 + routine PREFIX(thread_policy_set)( 276 + thread : thread_act_t; 277 + flavor : thread_policy_flavor_t; 278 + policy_info : thread_policy_t); 279 + 280 + routine thread_policy_get( 281 + thread : thread_act_t; 282 + flavor : thread_policy_flavor_t; 283 + out policy_info : thread_policy_t, CountInOut; 284 + inout get_default : boolean_t); 285 + 286 + /* 287 + * Removed from the kernel. 288 + */ 289 + #if KERNEL_SERVER 290 + skip; 291 + #else 292 + routine thread_sample( 293 + thread : thread_act_t; 294 + reply : mach_port_make_send_t); 295 + #endif 296 + 297 + /* 298 + * ETAP has been removed from the kernel. 299 + */ 300 + #if KERNEL_SERVER 301 + skip; 302 + #else 303 + routine etap_trace_thread( 304 + target_act : thread_act_t; 305 + trace_status : boolean_t); 306 + #endif 307 + 308 + /* 309 + * Assign thread to processor set. 310 + */ 311 + routine thread_assign( 312 + thread : thread_act_t; 313 + new_set : processor_set_t); 314 + 315 + /* 316 + * Assign thread to default set. 317 + */ 318 + routine thread_assign_default( 319 + thread : thread_act_t); 320 + 321 + /* 322 + * Get current assignment for thread. 323 + */ 324 + routine thread_get_assignment( 325 + thread : thread_act_t; 326 + out assigned_set : processor_set_name_t); 327 + 328 + 329 + /* 330 + * OBSOLETE interface. 331 + */ 332 + routine PREFIX(thread_set_policy)( 333 + thr_act : thread_act_t; 334 + pset : processor_set_t; 335 + policy : policy_t; 336 + base : policy_base_t; 337 + limit : policy_limit_t); 338 + 339 + routine thread_get_mach_voucher( 340 + thr_act : thread_act_t; 341 + which : mach_voucher_selector_t; 342 + out voucher : ipc_voucher_t); 343 + 344 + routine thread_set_mach_voucher( 345 + thr_act : thread_act_t; 346 + voucher : ipc_voucher_t); 347 + 348 + routine thread_swap_mach_voucher( 349 + thr_act : thread_act_t; 350 + new_voucher : ipc_voucher_t; 351 + inout old_voucher : ipc_voucher_t); 352 + 353 + /* vim: set ft=c : */
+100
kernel/mach/upl.defs
··· 1 + /* 2 + * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. 3 + * 4 + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ 5 + * 6 + * This file contains Original Code and/or Modifications of Original Code 7 + * as defined in and that are subject to the Apple Public Source License 8 + * Version 2.0 (the 'License'). You may not use this file except in 9 + * compliance with the License. The rights granted to you under the License 10 + * may not be used to create, or enable the creation or redistribution of, 11 + * unlawful or unlicensed copies of an Apple operating system, or to 12 + * circumvent, violate, or enable the circumvention or violation of, any 13 + * terms of an Apple operating system software license agreement. 14 + * 15 + * Please obtain a copy of the License at 16 + * http://www.opensource.apple.com/apsl/ and read it before using this file. 17 + * 18 + * The Original Code and all software distributed under the License are 19 + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 20 + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 21 + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 22 + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 23 + * Please see the License for the specific language governing rights and 24 + * limitations under the License. 25 + * 26 + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ 27 + */ 28 + /* 29 + * @OSF_COPYRIGHT@ 30 + */ 31 + /* 32 + * Mach Operating System 33 + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University 34 + * All Rights Reserved. 35 + * 36 + * Permission to use, copy, modify and distribute this software and its 37 + * documentation is hereby granted, provided that both the copyright 38 + * notice and this permission notice appear in all copies of the 39 + * software, derivative works or modified versions, and any portions 40 + * thereof, and that both notices appear in supporting documentation. 41 + * 42 + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 43 + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR 44 + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 45 + * 46 + * Carnegie Mellon requests users of this software to return to 47 + * 48 + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 49 + * School of Computer Science 50 + * Carnegie Mellon University 51 + * Pittsburgh PA 15213-3890 52 + * 53 + * any improvements or extensions that they make and grant Carnegie Mellon 54 + * the rights to redistribute these changes. 55 + */ 56 + /* 57 + */ 58 + /* 59 + * File: mach/upl.defs 60 + * 61 + * Abstract: 62 + * Basic Mach external memory management interface declaration. 63 + */ 64 + 65 + subsystem 66 + #if KERNEL_USER 67 + KernelUser 68 + #endif /* KERNEL_USER */ 69 + #if KERNEL_SERVER 70 + KernelServer 71 + #endif /* KERNEL_SERVER */ 72 + upl 2050; 73 + 74 + #include <mach/std_types.defs> 75 + #include <mach/mach_types.defs> 76 + 77 + routine upl_abort( 78 + upl_object : upl_t; 79 + in abort_cond : integer_t); 80 + 81 + routine upl_abort_range( 82 + upl_object : upl_t; 83 + offset : upl_offset_t; 84 + size : upl_size_t; 85 + in abort_cond : integer_t; 86 + out empty : boolean_t); 87 + 88 + routine upl_commit( 89 + upl_object : upl_t; 90 + in page_list : upl_page_info_array_t); 91 + 92 + routine upl_commit_range( 93 + upl_object : upl_t; 94 + offset : upl_offset_t; 95 + size : upl_size_t; 96 + in cntrl_flags : integer_t; 97 + in page_list : upl_page_info_array_t; 98 + out empty : boolean_t); 99 + 100 + /* vim: set ft=c : */
+284
kernel/mach/vm32_map.defs
··· 1 + /* 2 + * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. 3 + * 4 + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ 5 + * 6 + * This file contains Original Code and/or Modifications of Original Code 7 + * as defined in and that are subject to the Apple Public Source License 8 + * Version 2.0 (the 'License'). You may not use this file except in 9 + * compliance with the License. The rights granted to you under the License 10 + * may not be used to create, or enable the creation or redistribution of, 11 + * unlawful or unlicensed copies of an Apple operating system, or to 12 + * circumvent, violate, or enable the circumvention or violation of, any 13 + * terms of an Apple operating system software license agreement. 14 + * 15 + * Please obtain a copy of the License at 16 + * http://www.opensource.apple.com/apsl/ and read it before using this file. 17 + * 18 + * The Original Code and all software distributed under the License are 19 + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 20 + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 21 + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 22 + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 23 + * Please see the License for the specific language governing rights and 24 + * limitations under the License. 25 + * 26 + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ 27 + */ 28 + /* 29 + * @OSF_FREE_COPYRIGHT@ 30 + */ 31 + /* 32 + * Mach Operating System 33 + * Copyright (c) 1991,1990,1989 Carnegie Mellon University 34 + * All Rights Reserved. 35 + * 36 + * Permission to use, copy, modify and distribute this software and its 37 + * documentation is hereby granted, provided that both the copyright 38 + * notice and this permission notice appear in all copies of the 39 + * software, derivative works or modified versions, and any portions 40 + * thereof, and that both notices appear in supporting documentation. 41 + * 42 + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 43 + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR 44 + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 45 + * 46 + * Carnegie Mellon requests users of this software to return to 47 + * 48 + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 49 + * School of Computer Science 50 + * Carnegie Mellon University 51 + * Pittsburgh PA 15213-3890 52 + * 53 + * any improvements or extensions that they make and grant Carnegie Mellon 54 + * the rights to redistribute these changes. 55 + */ 56 + /* 57 + */ 58 + /* 59 + * File: mach/vm_map.defs 60 + * 61 + * Exported kernel VM calls for 32-bit client tasks. 62 + */ 63 + 64 + subsystem 65 + #if KERNEL_SERVER 66 + KernelServer 67 + #endif /* KERNEL_SERVER */ 68 + map 3800; 69 + 70 + serverprefix vm32_; 71 + 72 + #include <mach/std_types.defs> 73 + #include <mach/mach_types.defs> 74 + #include <mach_debug/mach_debug_types.defs> 75 + 76 + #if VM32_SUPPORT 77 + 78 + /* See vm_map.defs for more information */ 79 + 80 + routine region( 81 + target_task : vm_map_t; 82 + inout address : vm32_address_t; 83 + out size : vm32_size_t; 84 + flavor : vm_region_flavor_t; 85 + out info : vm_region_info_t, CountInOut; 86 + out object_name : memory_object_name_t = 87 + MACH_MSG_TYPE_MOVE_SEND 88 + ctype: mach_port_t); 89 + 90 + routine allocate( 91 + target_task : vm_task_entry_t; 92 + inout address : vm32_address_t; 93 + size : vm32_size_t; 94 + flags : int); 95 + 96 + routine deallocate( 97 + target_task : vm_task_entry_t; 98 + address : vm32_address_t; 99 + size : vm32_size_t); 100 + 101 + routine protect( 102 + target_task : vm_task_entry_t; 103 + address : vm32_address_t; 104 + size : vm32_size_t; 105 + set_maximum : boolean_t; 106 + new_protection : vm_prot_t); 107 + 108 + routine inherit( 109 + target_task : vm_task_entry_t; 110 + address : vm32_address_t; 111 + size : vm32_size_t; 112 + new_inheritance : vm_inherit_t); 113 + 114 + routine read( 115 + target_task : vm_map_t; 116 + address : vm32_address_t; 117 + size : vm32_size_t; 118 + out data : pointer_t); 119 + 120 + routine read_list( 121 + target_task : vm_map_t; 122 + inout data_list : vm32_read_entry_t; 123 + count : natural_t); 124 + 125 + routine write( 126 + target_task : vm_map_t; 127 + address : vm32_address_t; 128 + data : pointer_t); 129 + 130 + routine copy( 131 + target_task : vm_map_t; 132 + source_address : vm32_address_t; 133 + size : vm32_size_t; 134 + dest_address : vm32_address_t); 135 + 136 + routine read_overwrite( 137 + target_task : vm_map_t; 138 + address : vm32_address_t; 139 + size : vm32_size_t; 140 + data : vm32_address_t; 141 + out outsize : vm32_size_t); 142 + 143 + 144 + routine msync( 145 + target_task : vm_map_t; 146 + address : vm32_address_t; 147 + size : vm32_size_t; 148 + sync_flags : vm_sync_t ); 149 + 150 + routine behavior_set( 151 + target_task : vm_map_t; 152 + address : vm32_address_t; 153 + size : vm32_size_t; 154 + new_behavior : vm_behavior_t); 155 + 156 + routine map( 157 + target_task : vm_task_entry_t; 158 + inout address : vm32_address_t; 159 + size : vm32_size_t; 160 + mask : vm32_address_t; 161 + flags : int; 162 + object : mem_entry_name_port_t; 163 + offset : vm32_offset_t; 164 + copy : boolean_t; 165 + cur_protection : vm_prot_t; 166 + max_protection : vm_prot_t; 167 + inheritance : vm_inherit_t); 168 + 169 + routine machine_attribute( 170 + target_task : vm_map_t; 171 + address : vm32_address_t; 172 + size : vm32_size_t; 173 + attribute : vm_machine_attribute_t; 174 + inout value : vm_machine_attribute_val_t); 175 + 176 + routine remap( 177 + target_task : vm_map_t; 178 + inout target_address : vm32_address_t; 179 + size : vm32_size_t; 180 + mask : vm32_address_t; 181 + anywhere : boolean_t; 182 + src_task : vm_map_t; 183 + src_address : vm32_address_t; 184 + copy : boolean_t; 185 + out cur_protection : vm_prot_t; 186 + out max_protection : vm_prot_t; 187 + inheritance : vm_inherit_t); 188 + 189 + routine _task_wire( 190 + target_task : vm_map_t; 191 + must_wire : boolean_t); 192 + 193 + routine make_memory_entry( 194 + target_task :vm_map_t; 195 + inout size :vm32_size_t; 196 + offset :vm32_offset_t; 197 + permission :vm_prot_t; 198 + out object_handle :mem_entry_name_port_move_send_t; 199 + parent_entry :mem_entry_name_port_t); 200 + 201 + routine map_page_query( 202 + target_map :vm_map_t; 203 + offset :vm32_offset_t; 204 + out disposition :integer_t; 205 + out ref_count :integer_t); 206 + 207 + routine region_info( 208 + task : vm_map_t; 209 + address : vm32_address_t; 210 + out region : vm_info_region_t; 211 + out objects : vm_info_object_array_t); 212 + 213 + routine mapped_pages_info( 214 + task : vm_map_t; 215 + out pages : page_address_array_t); 216 + 217 + skip; /* was vm_region_object_create */ 218 + 219 + routine region_recurse( 220 + target_task : vm_map_t; 221 + inout address : vm32_address_t; 222 + out size : vm32_size_t; 223 + inout nesting_depth : natural_t; 224 + out info : vm_region_recurse_info_t,CountInOut); 225 + 226 + routine region_recurse_64( 227 + target_task : vm_map_t; 228 + inout address : vm32_address_t; 229 + out size : vm32_size_t; 230 + inout nesting_depth : natural_t; 231 + out info : vm_region_recurse_info_t,CountInOut); 232 + 233 + routine region_info_64( 234 + task : vm_map_t; 235 + address : vm32_address_t; 236 + out region : vm_info_region_64_t; 237 + out objects : vm_info_object_array_t); 238 + 239 + routine region_64( 240 + target_task : vm_map_t; 241 + inout address : vm32_address_t; 242 + out size : vm32_size_t; 243 + flavor : vm_region_flavor_t; 244 + out info : vm_region_info_t, CountInOut; 245 + out object_name : memory_object_name_t = 246 + MACH_MSG_TYPE_MOVE_SEND 247 + ctype: mach_port_t); 248 + 249 + routine make_memory_entry_64( 250 + target_task :vm_map_t; 251 + inout size :memory_object_size_t; 252 + offset :memory_object_offset_t; 253 + permission :vm_prot_t; 254 + out object_handle :mach_port_move_send_t; 255 + parent_entry :mem_entry_name_port_t); 256 + 257 + 258 + 259 + routine map_64( 260 + target_task : vm_task_entry_t; 261 + inout address : vm32_address_t; 262 + size : vm32_size_t; 263 + mask : vm32_address_t; 264 + flags : int; 265 + object : mem_entry_name_port_t; 266 + offset : memory_object_offset_t; 267 + copy : boolean_t; 268 + cur_protection : vm_prot_t; 269 + max_protection : vm_prot_t; 270 + inheritance : vm_inherit_t); 271 + 272 + skip; /* was vm_map_get_upl */ 273 + skip; /* was vm_upl_map */ 274 + skip; /* was vm_upl_unmap */ 275 + 276 + routine purgable_control( 277 + target_task : vm_map_t; 278 + address : vm32_address_t; 279 + control : vm_purgable_t; 280 + inout state : int); 281 + 282 + #endif /* VM32_SUPPORT */ 283 + 284 + /* vim: set ft=c : */
+498
kernel/mach/vm_map.defs
··· 1 + /* 2 + * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. 3 + * 4 + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ 5 + * 6 + * This file contains Original Code and/or Modifications of Original Code 7 + * as defined in and that are subject to the Apple Public Source License 8 + * Version 2.0 (the 'License'). You may not use this file except in 9 + * compliance with the License. The rights granted to you under the License 10 + * may not be used to create, or enable the creation or redistribution of, 11 + * unlawful or unlicensed copies of an Apple operating system, or to 12 + * circumvent, violate, or enable the circumvention or violation of, any 13 + * terms of an Apple operating system software license agreement. 14 + * 15 + * Please obtain a copy of the License at 16 + * http://www.opensource.apple.com/apsl/ and read it before using this file. 17 + * 18 + * The Original Code and all software distributed under the License are 19 + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 20 + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 21 + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 22 + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 23 + * Please see the License for the specific language governing rights and 24 + * limitations under the License. 25 + * 26 + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ 27 + */ 28 + /* 29 + * @OSF_FREE_COPYRIGHT@ 30 + */ 31 + /* 32 + * Mach Operating System 33 + * Copyright (c) 1991,1990,1989 Carnegie Mellon University 34 + * All Rights Reserved. 35 + * 36 + * Permission to use, copy, modify and distribute this software and its 37 + * documentation is hereby granted, provided that both the copyright 38 + * notice and this permission notice appear in all copies of the 39 + * software, derivative works or modified versions, and any portions 40 + * thereof, and that both notices appear in supporting documentation. 41 + * 42 + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 43 + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR 44 + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 45 + * 46 + * Carnegie Mellon requests users of this software to return to 47 + * 48 + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 49 + * School of Computer Science 50 + * Carnegie Mellon University 51 + * Pittsburgh PA 15213-3890 52 + * 53 + * any improvements or extensions that they make and grant Carnegie Mellon 54 + * the rights to redistribute these changes. 55 + */ 56 + /* 57 + */ 58 + /* 59 + * File: mach/vm_map.defs 60 + * 61 + * Exported (native-sized) kernel VM calls. 62 + */ 63 + 64 + subsystem 65 + #if KERNEL_SERVER 66 + KernelServer 67 + #endif /* KERNEL_SERVER */ 68 + vm_map 3800; 69 + 70 + #include <mach/std_types.defs> 71 + #include <mach/mach_types.defs> 72 + #include <mach_debug/mach_debug_types.defs> 73 + 74 + #if !KERNEL && !LIBSYSCALL_INTERFACE 75 + #define PREFIX(NAME) _kernelrpc_ ## NAME 76 + #else 77 + #define PREFIX(NAME) NAME 78 + #endif 79 + 80 + /* 81 + * Returns information about the contents of the virtual 82 + * address space of the target task at the specified 83 + * address. The returned protection, inheritance, sharing 84 + * and memory object values apply to the entire range described 85 + * by the address range returned; the memory object offset 86 + * corresponds to the beginning of the address range. 87 + * [If the specified address is not allocated, the next 88 + * highest address range is described. If no addresses beyond 89 + * the one specified are allocated, the call returns KERN_NO_SPACE.] 90 + */ 91 + routine vm_region( 92 + target_task : vm_map_t; 93 + inout address : vm_address_t; 94 + out size : vm_size_t; 95 + flavor : vm_region_flavor_t; 96 + out info : vm_region_info_t, CountInOut; 97 + out object_name : memory_object_name_t = 98 + MACH_MSG_TYPE_MOVE_SEND 99 + ctype: mach_port_t); 100 + 101 + /* 102 + * Allocate zero-filled memory in the address space 103 + * of the target task, either at the specified address, 104 + * or wherever space can be found (if anywhere is TRUE), 105 + * of the specified size. The address at which the 106 + * allocation actually took place is returned. 107 + */ 108 + 109 + #if !KERNEL && !LIBSYSCALL_INTERFACE 110 + skip; 111 + #else 112 + routine PREFIX(vm_allocate)( 113 + target_task : vm_task_entry_t; 114 + inout address : vm_address_t; 115 + size : vm_size_t; 116 + flags : int); 117 + 118 + #endif 119 + 120 + /* 121 + * Deallocate the specified range from the virtual 122 + * address space of the target task. 123 + */ 124 + 125 + #if !KERNEL && !LIBSYSCALL_INTERFACE 126 + skip; 127 + #else 128 + routine PREFIX(vm_deallocate)( 129 + target_task : vm_task_entry_t; 130 + address : vm_address_t; 131 + size : vm_size_t); 132 + 133 + #endif 134 + 135 + /* 136 + * Set the current or maximum protection attribute 137 + * for the specified range of the virtual address 138 + * space of the target task. The current protection 139 + * limits the memory access rights of threads within 140 + * the task; the maximum protection limits the accesses 141 + * that may be given in the current protection. 142 + * Protections are specified as a set of {read, write, execute} 143 + * *permissions*. 144 + */ 145 + 146 + #if !KERNEL && !LIBSYSCALL_INTERFACE 147 + skip; 148 + #else 149 + routine PREFIX(vm_protect)( 150 + target_task : vm_task_entry_t; 151 + address : vm_address_t; 152 + size : vm_size_t; 153 + set_maximum : boolean_t; 154 + new_protection : vm_prot_t); 155 + #endif 156 + 157 + /* 158 + * Set the inheritance attribute for the specified range 159 + * of the virtual address space of the target task. 160 + * The inheritance value is one of {none, copy, share}, and 161 + * specifies how the child address space should acquire 162 + * this memory at the time of a task_create call. 163 + */ 164 + routine vm_inherit( 165 + target_task : vm_task_entry_t; 166 + address : vm_address_t; 167 + size : vm_size_t; 168 + new_inheritance : vm_inherit_t); 169 + 170 + /* 171 + * Returns the contents of the specified range of the 172 + * virtual address space of the target task. [The 173 + * range must be aligned on a virtual page boundary, 174 + * and must be a multiple of pages in extent. The 175 + * protection on the specified range must permit reading.] 176 + */ 177 + routine PREFIX(vm_read) ( 178 + target_task : vm_map_t; 179 + address : vm_address_t; 180 + size : vm_size_t; 181 + out data : pointer_t); 182 + 183 + /* 184 + * List corrollary to vm_read, returns mapped contents of specified 185 + * ranges within target address space. 186 + */ 187 + routine vm_read_list( 188 + target_task : vm_map_t; 189 + inout data_list : vm_read_entry_t; 190 + count : natural_t); 191 + 192 + /* 193 + * Writes the contents of the specified range of the 194 + * virtual address space of the target task. [The 195 + * range must be aligned on a virtual page boundary, 196 + * and must be a multiple of pages in extent. The 197 + * protection on the specified range must permit writing.] 198 + */ 199 + routine vm_write( 200 + target_task : vm_map_t; 201 + address : vm_address_t; 202 + data : pointer_t); 203 + 204 + /* 205 + * Copy the contents of the source range of the virtual 206 + * address space of the target task to the destination 207 + * range in that same address space. [Both of the 208 + * ranges must be aligned on a virtual page boundary, 209 + * and must be multiples of pages in extent. The 210 + * protection on the source range must permit reading, 211 + * and the protection on the destination range must 212 + * permit writing.] 213 + */ 214 + routine vm_copy( 215 + target_task : vm_map_t; 216 + source_address : vm_address_t; 217 + size : vm_size_t; 218 + dest_address : vm_address_t); 219 + 220 + /* 221 + * Returns the contents of the specified range of the 222 + * virtual address space of the target task. [There 223 + * are no alignment restrictions, and the results will 224 + * overwrite the area pointed to by data - which must 225 + * already exist. The protection on the specified range 226 + * must permit reading.] 227 + */ 228 + routine vm_read_overwrite( 229 + target_task : vm_map_t; 230 + address : vm_address_t; 231 + size : vm_size_t; 232 + data : vm_address_t; 233 + out outsize : vm_size_t); 234 + 235 + 236 + routine vm_msync( 237 + target_task : vm_map_t; 238 + address : vm_address_t; 239 + size : vm_size_t; 240 + sync_flags : vm_sync_t ); 241 + 242 + /* 243 + * Set the paging behavior attribute for the specified range 244 + * of the virtual address space of the target task. 245 + * The behavior value is one of {default, random, forward 246 + * sequential, reverse sequential} and indicates the expected 247 + * page reference pattern for the specified range. 248 + */ 249 + routine vm_behavior_set( 250 + target_task : vm_map_t; 251 + address : vm_address_t; 252 + size : vm_size_t; 253 + new_behavior : vm_behavior_t); 254 + 255 + 256 + /* 257 + * Map a user-defined memory object into the virtual address 258 + * space of the target task. If desired (anywhere is TRUE), 259 + * the kernel will find a suitable address range of the 260 + * specified size; else, the specific address will be allocated. 261 + * 262 + * The beginning address of the range will be aligned on a virtual 263 + * page boundary, be at or beyond the address specified, and 264 + * meet the mask requirements (bits turned on in the mask must not 265 + * be turned on in the result); the size of the range, in bytes, 266 + * will be rounded up to an integral number of virtual pages. 267 + * 268 + * The memory in the resulting range will be associated with the 269 + * specified memory object, with the beginning of the memory range 270 + * referring to the specified offset into the memory object. 271 + * 272 + * The mapping will take the current and maximum protections and 273 + * the inheritance attributes specified; see the vm_protect and 274 + * vm_inherit calls for a description of these attributes. 275 + * 276 + * If desired (copy is TRUE), the memory range will be filled 277 + * with a copy of the data from the memory object; this copy will 278 + * be private to this mapping in this target task. Otherwise, 279 + * the memory in this mapping will be shared with other mappings 280 + * of the same memory object at the same offset (in this task or 281 + * in other tasks). [The Mach kernel only enforces shared memory 282 + * consistency among mappings on one host with similar page alignments. 283 + * The user-defined memory manager for this object is responsible 284 + * for further consistency.] 285 + */ 286 + routine PREFIX(vm_map) ( 287 + target_task : vm_task_entry_t; 288 + inout address : vm_address_t; 289 + size : vm_size_t; 290 + mask : vm_address_t; 291 + flags : int; 292 + object : mem_entry_name_port_t; 293 + offset : vm_offset_t; 294 + copy : boolean_t; 295 + cur_protection : vm_prot_t; 296 + max_protection : vm_prot_t; 297 + inheritance : vm_inherit_t); 298 + 299 + /* 300 + * Set/Get special properties of memory associated 301 + * to some virtual address range, such as cachability, 302 + * migrability, replicability. Machine-dependent. 303 + */ 304 + routine vm_machine_attribute( 305 + target_task : vm_map_t; 306 + address : vm_address_t; 307 + size : vm_size_t; 308 + attribute : vm_machine_attribute_t; 309 + inout value : vm_machine_attribute_val_t); 310 + 311 + /* 312 + * Map portion of a task's address space. 313 + */ 314 + routine PREFIX(vm_remap) ( 315 + target_task : vm_map_t; 316 + inout target_address : vm_address_t; 317 + size : vm_size_t; 318 + mask : vm_address_t; 319 + flags : int; 320 + src_task : vm_map_t; 321 + src_address : vm_address_t; 322 + copy : boolean_t; 323 + out cur_protection : vm_prot_t; 324 + out max_protection : vm_prot_t; 325 + inheritance : vm_inherit_t); 326 + 327 + /* 328 + * Require that all future virtual memory allocation 329 + * allocates wired memory. Setting must_wire to FALSE 330 + * disables the wired future feature. 331 + */ 332 + routine task_wire( 333 + target_task : vm_map_t; 334 + must_wire : boolean_t); 335 + 336 + 337 + /* 338 + * Allow application level processes to create named entries which 339 + * correspond to mapped portions of their address space. These named 340 + * entries can then be manipulated, shared with other processes in 341 + * other address spaces and ultimately mapped in ohter address spaces 342 + */ 343 + 344 + routine mach_make_memory_entry( 345 + target_task :vm_map_t; 346 + inout size :vm_size_t; 347 + offset :vm_offset_t; 348 + permission :vm_prot_t; 349 + out object_handle :mem_entry_name_port_move_send_t; 350 + parent_entry :mem_entry_name_port_t); 351 + 352 + /* 353 + * Give the caller information on the given location in a virtual 354 + * address space. If a page is mapped return ref and dirty info. 355 + */ 356 + routine vm_map_page_query( 357 + target_map :vm_map_t; 358 + offset :vm_offset_t; 359 + out disposition :integer_t; 360 + out ref_count :integer_t); 361 + 362 + /* 363 + * Returns information about a region of memory. 364 + * Includes info about the chain of objects rooted at that region. 365 + * Only available in MACH_VM_DEBUG compiled kernels, 366 + * otherwise returns KERN_FAILURE. 367 + */ 368 + routine mach_vm_region_info( 369 + task : vm_map_t; 370 + address : vm_address_t; 371 + out region : vm_info_region_t; 372 + out objects : vm_info_object_array_t); 373 + 374 + routine vm_mapped_pages_info( 375 + task : vm_map_t; 376 + out pages : page_address_array_t); 377 + 378 + #if 0 379 + /* 380 + * Allow application level processes to create named entries which 381 + * are backed by sub-maps which describe regions of address space. 382 + * These regions of space can have objects mapped into them and 383 + * in turn, can be mapped into target address spaces 384 + */ 385 + 386 + routine vm_region_object_create( 387 + target_task :vm_map_t; 388 + in size :vm_size_t; 389 + out region_object :mach_port_move_send_t); 390 + #else 391 + skip; /* was vm_region_object_create */ 392 + #endif 393 + 394 + /* 395 + * A recursive form of vm_region which probes submaps withint the 396 + * address space. 397 + */ 398 + routine vm_region_recurse( 399 + target_task : vm_map_t; 400 + inout address : vm_address_t; 401 + out size : vm_size_t; 402 + inout nesting_depth : natural_t; 403 + out info : vm_region_recurse_info_t,CountInOut); 404 + 405 + 406 + /* 407 + * The routines below are temporary, meant for transitional use 408 + * as their counterparts are moved from 32 to 64 bit data path 409 + */ 410 + 411 + 412 + routine vm_region_recurse_64( 413 + target_task : vm_map_t; 414 + inout address : vm_address_t; 415 + out size : vm_size_t; 416 + inout nesting_depth : natural_t; 417 + out info : vm_region_recurse_info_t,CountInOut); 418 + 419 + routine mach_vm_region_info_64( 420 + task : vm_map_t; 421 + address : vm_address_t; 422 + out region : vm_info_region_64_t; 423 + out objects : vm_info_object_array_t); 424 + 425 + routine vm_region_64( 426 + target_task : vm_map_t; 427 + inout address : vm_address_t; 428 + out size : vm_size_t; 429 + flavor : vm_region_flavor_t; 430 + out info : vm_region_info_t, CountInOut; 431 + out object_name : memory_object_name_t = 432 + MACH_MSG_TYPE_MOVE_SEND 433 + ctype: mach_port_t); 434 + 435 + routine mach_make_memory_entry_64( 436 + target_task :vm_map_t; 437 + inout size :memory_object_size_t; 438 + offset :memory_object_offset_t; 439 + permission :vm_prot_t; 440 + out object_handle :mach_port_move_send_t; 441 + parent_entry :mem_entry_name_port_t); 442 + 443 + 444 + 445 + routine vm_map_64( 446 + target_task : vm_task_entry_t; 447 + inout address : vm_address_t; 448 + size : vm_size_t; 449 + mask : vm_address_t; 450 + flags : int; 451 + object : mem_entry_name_port_t; 452 + offset : memory_object_offset_t; 453 + copy : boolean_t; 454 + cur_protection : vm_prot_t; 455 + max_protection : vm_prot_t; 456 + inheritance : vm_inherit_t); 457 + 458 + #if 0 459 + /* 460 + * The UPL interfaces are not ready for user-level export. 461 + */ 462 + routine vm_map_get_upl( 463 + target_task : vm_map_t; 464 + address : vm_map_offset_t; 465 + inout size : vm_size_t; 466 + out upl : upl_t; 467 + out page_info : upl_page_info_array_t, CountInOut; 468 + inout flags : integer_t; 469 + force_data_sync : integer_t); 470 + 471 + routine vm_upl_map( 472 + target_task : vm_map_t; 473 + upl : upl_t; 474 + inout address : vm_address_t); 475 + 476 + routine vm_upl_unmap( 477 + target_task : vm_map_t; 478 + upl : upl_t); 479 + #else 480 + skip; /* was vm_map_get_upl */ 481 + skip; /* was vm_upl_map */ 482 + skip; /* was vm_upl_unmap */ 483 + #endif 484 + 485 + /* 486 + * Control behavior and investigate state of a "purgable" object in 487 + * the virtual address space of the target task. A purgable object is 488 + * created via a call to vm_allocate() with VM_FLAGS_PURGABLE 489 + * specified. See the routine implementation for a complete 490 + * definition of the routine. 491 + */ 492 + routine vm_purgable_control( 493 + target_task : vm_map_t; 494 + address : vm_address_t; 495 + control : vm_purgable_t; 496 + inout state : int); 497 + 498 + /* vim: set ft=c : */