1/*
2 * Copyright (c) 2000-2007 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 *	Header file for basic, machine-dependent data types.  arm+i386 version.
34 */
35
36#ifndef _MACH_MACHINE_MACHNINE_TYPES_DEFS
37#define _MACH_MACHINE_MACHNINE_TYPES_DEFS
38
39type short = int16_t;
40type int = int32_t;
41type unsigned = uint32_t;
42
43type float = MACH_MSG_TYPE_REAL_32;
44type double = MACH_MSG_TYPE_REAL_64;
45
46
47/* from ISO/IEC 988:1999 spec */
48/* 7.18.1.4 Integer types capable of hgolding object pointers */
49/*
50 * The [u]intptr_t types for the native
51 * integer type, e.g. 32 or 64 or.. whatever
52 * register size the machine has.  They are
53 * used for entities that might be either
54 * [unsigned] integers or pointers, and for
55 * type-casting between the two.
56 *
57 * For instance, the IPC system represents
58 * a port in user space as an integer and
59 * in kernel space as a pointer.
60 */
61#if defined(__LP64__)
62type uintptr_t = uint64_t;
63type intptr_t = int64_t;
64#else
65type uintptr_t = uint32_t;
66type intptr_t = int32_t;
67#endif
68
69/*
70 * These are the legacy Mach types that are
71 * the [rough] equivalents of the standards above.
72 * They were defined in terms of int, not
73 * long int, so they remain separate.
74 */
75#if defined(__LP64__)
76type register_t = int64_t;
77#else
78type register_t = int32_t;
79#endif
80type integer_t = int32_t;
81type natural_t = uint32_t;
82
83/*
84 * These are the VM types that scale with the address
85 * space size of a given process.
86 */
87
88#if defined(__LP64__)
89type vm_address_t = uint64_t;
90type vm_offset_t = uint64_t;
91type vm_size_t = uint64_t;
92#else
93type vm_address_t = natural_t;
94type vm_offset_t = natural_t;
95type vm_size_t = natural_t;
96#endif
97
98/* This is a bit of a hack for arm.  We implement the backend with a wide type, but present a native-sized type to callers */
99type mach_port_context_t = uint64_t;
100
101/*
102 * The mach_vm_xxx_t types are sized to hold the
103 * maximum pointer, offset, etc... supported on the
104 * platform.
105 */
106type mach_vm_address_t = uint64_t;
107type mach_vm_offset_t = uint64_t;
108type mach_vm_size_t = uint64_t;
109
110#if	MACH_IPC_COMPAT
111/*
112 * For the old IPC interface
113 */
114#define	MSG_TYPE_PORT_NAME	natural_t
115
116#endif	/* MACH_IPC_COMPAT */
117
118/*
119 * These are types used internal to Mach to implement the
120 * legacy 32-bit VM APIs published by the kernel.
121 */
122#define	VM32_SUPPORT	1
123
124type vm32_address_t = uint32_t;
125type vm32_offset_t = uint32_t;
126type vm32_size_t = uint32_t;
127
128#endif /* _MACH_MACHINE_MACHNINE_TYPES_DEFS */
129
130/* vim: set ft=c : */
131