Source to mach/mach_types.defs
/*
* Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* "Portions Copyright (c) 1999 Apple Computer, Inc. All Rights
* Reserved. This file contains Original Code and/or Modifications of
* Original Code as defined in and that are subject to the Apple Public
* Source License Version 1.0 (the 'License'). You may not use this file
* except in compliance with the License. Please obtain a copy of the
* License at http://www.apple.com/publicsource and read it before using
* this file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
* License for the specific language governing rights and limitations
* under the License."
*
* @APPLE_LICENSE_HEADER_END@
*/
/*
* Copyright (c) 1995, 1994, 1993, 1992, 1991, 1990
* Open Software Foundation, Inc.
*
* Permission to use, copy, modify, and distribute this software and
* its documentation for any purpose and without fee is hereby granted,
* provided that the above copyright notice appears in all copies and
* that both the copyright notice and this permission notice appear in
* supporting documentation, and that the name of ("OSF") or Open Software
* Foundation not be used in advertising or publicity pertaining to
* distribution of the software without specific, written prior permission.
*
* OSF DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL OSF BE LIABLE FOR ANY
* SPECIAL, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
* ACTION OF CONTRACT, NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE
*/
/*
* OSF Research Institute MK6.1 (unencumbered) 1/31/1995
*/
/*
* Mach Operating System
* Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University
* All Rights Reserved.
*
* Permission to use, copy, modify and distribute this software and its
* documentation is hereby granted, provided that both the copyright
* notice and this permission notice appear in all copies of the
* software, derivative works or modified versions, and any portions
* thereof, and that both notices appear in supporting documentation.
*
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
* ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*
* Carnegie Mellon requests users of this software to return to
*
* Software Distribution Coordinator or [email protected]
* School of Computer Science
* Carnegie Mellon University
* Pittsburgh PA 15213-3890
*
* any improvements or extensions that they make and grant Carnegie Mellon
* the rights to redistribute these changes.
*/
/*
* Mach kernel interface type declarations
*/
#ifndef _MACH_MACH_TYPES_DEFS_
#define _MACH_MACH_TYPES_DEFS_
/*
* For KernelServer and KernelUser interfaces, Mig will
* automagically use ipc_port_t instead of mach_port_t
* on the kernel side of the interface. For example,
* convert_task_to_port really returns ipc_port_t.
* Doing this in Mig saves many explicit conditional
* cusertype/cservertype declarations.
*
* Mig doesn't translate the components of an array.
* For example, Mig won't use the thread_t translations
* to translate a thread_array_t argument.
*/
#include <mach/std_types.defs>
#ifdef MACH_IPC_FLAVOR
type mach_port_status_t = struct[9] of natural_t;
/*
* mach_port_info_t: can hold either a
* mach_port_status_t (9 ints) or a
* mach_port_limits_t (1 int). if new flavors of
* mach_port_{get,set}_attributes are addeed, the size of
* this array may have to be increased. (See mach/port.h)
*/
type mach_port_flavor_t = integer_t;
type mach_port_info_t = array[*:9] of natural_t;
type task_t = mach_port_t
ctype: mach_port_t
#if KERNEL_SERVER
intran: task_t convert_port_to_task(mach_port_t)
outtran: mach_port_t convert_task_to_port(task_t)
destructor: task_deallocate(task_t)
#endif /* KERNEL_SERVER */
;
type thread_t = mach_port_t
ctype: mach_port_t
#if KERNEL_SERVER
intran: thread_t convert_port_to_thread(mach_port_t)
outtran: mach_port_t convert_thread_to_port(thread_t)
destructor: thread_deallocate(thread_t)
#endif /* KERNEL_SERVER */
;
type thread_state_flavor_t = integer_t;
type thread_state_t = array[*:1024] of natural_t;
type task_array_t = ^array[] of task_t;
type thread_array_t = ^array[] of thread_t;
type task_port_array_t = ^array[] of task_t;
type thread_port_array_t = ^array[] of thread_t;
type vm_task_t = mach_port_t
ctype: mach_port_t
#if KERNEL_SERVER
intran: vm_map_t convert_port_to_map(mach_port_t)
destructor: vm_map_deallocate(vm_map_t)
#endif /* KERNEL_SERVER */
;
type ipc_space_t = mach_port_t
ctype: mach_port_t
#if KERNEL_SERVER
intran: ipc_space_t convert_port_to_space(mach_port_t)
destructor: space_deallocate(ipc_space_t)
#endif /* KERNEL_SERVER */
;
type vm_address_t = natural_t;
type vm_offset_t = natural_t;
type vm_size_t = natural_t;
type vm_prot_t = integer_t;
type vm_inherit_t = integer_t;
type vm_behavior_t = integer_t;
type vm_statistics_data_t = struct[13] of integer_t;
type vm_machine_attribute_t = integer_t;
type vm_machine_attribute_val_t = integer_t;
type vm_sync_t = integer_t;
/* thread_info_t: this inline array can hold any of:
* thread_basic_info_t (10 ints)
* policy_timeshare_info_t (5 ints)
* policy_fifo_info_t (4 ints)
* policy_rr_info_t (5 ints)
* if other thread_info flavors are added, this
* definition may need to be changed. (See
* mach/thread_info.h and mach/policy.h) */
type thread_flavor_t = integer_t;
type thread_info_t = array[*:1024] of natural_t;
/* task_info_t: this inline array can hold any of:
* task_basic_info_t (8 ints)
* task_events_info_t (7 ints)
* task_thread_times_info_t (4 ints)
* policy_timeshare_info_t (5 ints)
* policy_fifo_info_t (4 ints)
* policy_rr_info_t (5 ints)
* If other task_info flavors are added, this
* definition may need to be changed. (See
* mach/task_info.h and mach/policy.h) */
type task_flavor_t = integer_t;
type task_info_t = array[*:1024] of natural_t;
type memory_object_t = mach_port_t
ctype: mach_port_t
#if KERNEL_SERVER
intran: ipc_port_t null_conversion(mach_port_t)
#endif /* KERNEL_SERVER */
;
type memory_object_control_t = mach_port_t
ctype: mach_port_t
#if KERNEL_SERVER
intran: vm_object_t vm_object_lookup(mach_port_t)
#endif /* KERNEL_SERVER */
;
type memory_object_name_t = mach_port_t
ctype: mach_port_t
#if KERNEL_SERVER
intran: vm_object_t vm_object_lookup_name(mach_port_t)
destructor: vm_object_deallocate(vm_object_t)
#endif /* KERNEL_SERVER */
;
type memory_object_copy_strategy_t = integer_t;
type memory_object_return_t = integer_t;
type machine_info_data_t = struct[5] of integer_t;
type machine_slot_data_t = struct[8] of integer_t;
type host_t = mach_port_t
ctype: mach_port_t
#if KERNEL_SERVER
intran: host_t convert_port_to_host(mach_port_t)
outtran: mach_port_t convert_host_to_port(host_t)
#endif /* KERNEL_SERVER */
;
type host_priv_t = mach_port_t
ctype: mach_port_t
#if KERNEL_SERVER
intran: host_t convert_port_to_host_priv(mach_port_t)
#endif /* KERNEL_SERVER */
;
/* host_info_t: variable-sized inline array that can contain:
* host_basic_info_t (5 ints)
* host_sched_info_t (2 ints)
* kernel_resource_sizes_t (5 ints)
* host_load_info_t (6 ints)
* vm_statistics_t (12 ints)
* If other host_info flavors are added, this definition may
* need to be changed. (See mach/{host_info,vm_statistics}.h)*/
type host_flavor_t = integer_t;
type host_info_t = array[*:12] of natural_t;
type processor_t = mach_port_t
ctype: mach_port_t
#if KERNEL_SERVER
intran: processor_t convert_port_to_processor(mach_port_t)
outtran: mach_port_t convert_processor_to_port(processor_t)
#endif /* KERNEL_SERVER */
;
type processor_array_t = ^array[] of processor_t;
type processor_port_array_t = ^array[] of processor_t;
/* processor_info_t: variable-sized inline array that can
* contain:
* processor_basic_info_t: (5 ints)
* If other processor_info flavors are added, this definition
* may need to be changed. (See mach/processor_info.h) */
type processor_flavor_t = integer_t;
type processor_info_t = array[*:1024] of natural_t;
type processor_slot_t = array[*:1024] of natural_t;
type processor_set_t = mach_port_t
ctype: mach_port_t
#if KERNEL_SERVER
intran: processor_set_t convert_port_to_pset(mach_port_t)
outtran: mach_port_t convert_pset_to_port(processor_set_t)
destructor: pset_deallocate(processor_set_t)
#endif /* KERNEL_SERVER */
;
type processor_set_array_t = ^array[] of processor_set_t;
type processor_set_port_array_t = ^array[] of processor_set_t;
type processor_set_name_t = mach_port_t
ctype: mach_port_t
#if KERNEL_SERVER
intran: processor_set_t convert_port_to_pset_name(mach_port_t)
outtran: mach_port_t convert_pset_name_to_port(processor_set_t)
destructor: pset_deallocate(processor_set_t)
#endif /* KERNEL_SERVER */
;
type processor_set_name_array_t = ^array[] of processor_set_name_t;
type processor_set_name_port_array_t = ^array[] of processor_set_name_t;
/* processor_set_info_t: variable-size inline array
* that can hold:
* processor_set_basic_info (2 ints)
* processor_set_load_info (4 ints)
* policy_timeshare_base_t (1 int)
* policy_fifo_base_t (1 int)
* policy_rr_base_t (2 int)
* policy_timeshare_limit_t (1 int)
* policy_fifo_limit_t (1 int)
* policy_rr_limit_t (1 int)
* policy_t (1 int)
* If other flavors are added, this definition may
* need to be changed. (see mach/processor.h) */
type processor_set_flavor_t = integer_t;
type processor_set_info_t = array[*:5] of natural_t;
#if MACH_IPC_FLAVOR == UNTYPED
type kernel_version_t = c_string[*:512];
#elif MACH_IPC_FLAVOR == TYPED
type kernel_version_t = (MACH_MSG_TYPE_STRING, 512*8);
#endif /* MACH_IPC_FLAVOR */
type time_value_t = struct[2] of integer_t;
/* specific types for task & thread
* policy manipulation:
* policy_base_t (2 ints)
* policy_limit_t (1 int) */
type policy_t = integer_t;
type policy_base_t = array[*:2] of integer_t;
type policy_limit_t = array[*:1] of integer_t;
type security_id_t = MACH_MSG_TYPE_INTEGER_64;
#if KERNEL_SERVER
simport <kern/ipc_kobject.h>; /* for null conversion */
simport <kern/ipc_tt.h>; /* for task/thread conversion */
simport <kern/ipc_host.h>; /* for host/processor/pset conversions */
simport <kern/task.h>; /* for task_t */
simport <kern/thread.h>; /* for thread_t */
simport <kern/host.h>; /* for host_t */
simport <kern/processor.h>; /* for processor_t, processor_set_t */
simport <vm/vm_object.h>; /* for vm_object_t */
simport <vm/vm_map.h>; /* for vm_map_t */
simport <ipc/ipc_space.h>; /* for ipc_space_t */
#endif /* KERNEL_SERVER */
#else /* MACH_IPC_FLAVOR */
#if KERNEL_SERVER
simport <kern/type_conversion.h>;
#endif /* KERNEL_SERVER */
type task_t = port_t
#if KERNEL_SERVER
intran: task_t convert_port_to_task(port_t)
outtran: port_t convert_task_to_port(task_t)
destructor: task_deallocate(task_t)
#endif /* KERNEL_SERVER */
;
type thread_t = port_t
#if KERNEL_SERVER
intran: thread_t convert_port_to_thread(port_t)
outtran: port_t convert_thread_to_port(thread_t)
destructor: thread_deallocate(thread_t)
#endif /* KERNEL_SERVER */
;
type thread_state_t = array[*:1024] of int;
/*
* Mig doesn't handle translations of the components of an array,
* so use port_t instead of thread_t.
*/
type task_array_t = ^array[] of port_t;
type thread_array_t = ^array[] of port_t;
type vm_task_t = port_t
#if KERNEL_SERVER
intran: vm_map_t convert_port_to_map(port_t)
destructor: vm_map_deallocate(vm_map_t)
#endif /* KERNEL_SERVER */
;
type vm_address_t = int;
type vm_offset_t = int;
type vm_size_t = int;
type vm_prot_t = int;
type vm_inherit_t = int;
type vm_statistics_data_t = struct[13] of int;
type vm_machine_attribute_t = int;
type vm_machine_attribute_val_t = int;
type thread_info_t = array[*:1024] of int;
type task_info_t = array[*:1024] of int;
type memory_object_t = port_t;
type memory_object_control_t = port_t
#if KERNEL_SERVER
intran: vm_object_t vm_object_lookup(port_t)
outtran: port_t NEVER_HAPPENS(vm_object_t)
#endif /* KERNEL_SERVER */
;
type memory_object_name_t = port_t;
type memory_object_copy_strategy_t = int;
type internal_memory_pointer_t =
^array [] of MSG_TYPE_BYTE
ctype: pointer_t;
type machine_info_data_t = struct[5] of int;
type machine_slot_data_t = struct[8] of int;
type host_t = port_t
#if KERNEL_SERVER
intran: host_t convert_port_to_host(port_t)
outtran: port_t convert_host_to_port(host_t)
#endif /* KERNEL_SERVER */
;
type host_priv_t = port_t
#if KERNEL_SERVER
intran: host_t convert_port_to_host_priv(port_t)
#endif /* KERNEL_SERVER */
;
type host_info_t = array[*:1024] of int;
type processor_t = port_t
#if KERNEL_SERVER
intran: processor_t convert_port_to_processor(port_t)
outtran: port_t convert_processor_to_port(processor_t)
#endif /* KERNEL_SERVER */
;
type processor_array_t = ^array[] of port_t;
type processor_info_t = array[*:1024] of int;
type processor_set_t = port_t
#if KERNEL_SERVER
intran: processor_set_t convert_port_to_pset(port_t)
outtran: port_t convert_pset_to_port(processor_set_t)
destructor: pset_deallocate(processor_set_t)
#endif /* KERNEL_SERVER */
;
type processor_set_name_t = port_t
#if KERNEL_SERVER
intran: processor_set_t convert_port_to_pset_name(port_t)
outtran: port_t convert_pset_name_to_port(processor_set_t)
destructor: pset_deallocate(processor_set_t)
#endif /* KERNEL_SERVER */
;
type processor_set_name_array_t = ^array[] of port_t;
type processor_set_info_t = array[*:1024] of int;
type kernel_version_t = (MSG_TYPE_STRING, 512*8);
type time_value_t = struct[2] of int;
#endif /* MACH_IPC_FLAVOR */
import <mach/mach_types.h>;
#endif _MACH_MACH_TYPES_DEFS_