]> git.saurik.com Git - apple/xnu.git/blob - osfmk/mach/ppc/machine_types.defs
fbddc524fe157acc693648a4365f21f787773b68
[apple/xnu.git] / osfmk / mach / ppc / machine_types.defs
1 /*
2 * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_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. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23 /*
24 * @OSF_COPYRIGHT@
25 */
26
27 /*
28 * Header file for basic, machine-dependent data types.
29 */
30
31 #ifndef _PPC_VM_TYPES_DEFS_
32 #define _PPC_VM_TYPES_DEFS_
33
34 type short = int16_t;
35 type int = int32_t;
36 type unsigned = uint32_t;
37
38 type float = MACH_MSG_TYPE_REAL_32;
39 type double = MACH_MSG_TYPE_REAL_64;
40
41 /* from ISO/IEC 988:1999 spec */
42 /* 7.18.1.4 Integer types capable of holding object pointers */
43 /*
44 * The [u]intptr_t types for the native
45 * integer type, e.g. 32 or 64 or.. whatever
46 * register size the machine has. They are
47 * used for entities that might be either
48 * [unsigned] integers or pointers, and for
49 * type-casting between the two.
50 *
51 * For instance, the IPC system represents
52 * a port in user space as an integer and
53 * in kernel space as a pointer.
54 */
55 #if defined(__ppc64__)
56 type uintptr_t = uint64_t;
57 type intptr_t = int64_t;
58 #else
59 type uintptr_t = uint32_t;
60 type intptr_t = int32_t;
61 #endif
62
63 /*
64 * These are the legacy Mach types that are
65 * the [rough] equivalents of the standards above.
66 * They were defined in terms of int, not
67 * long int, so they remain separate.
68 */
69 #if defined(__ppc64__)
70 type register_t = int64_t;
71 #else
72 type register_t = int32_t;
73 #endif
74 type integer_t = int32_t;
75 type natural_t = uint32_t;
76
77 /*
78 * These are the VM types that scale with the address
79 * space size of a given process.
80 */
81
82 #if defined(__ppc64__)
83 type vm_address_t = uint64_t;
84 type vm_offset_t = uint64_t;
85 type vm_size_t = uint64_t;
86 #else
87 type vm_address_t = natural_t;
88 type vm_offset_t = natural_t;
89 type vm_size_t = natural_t;
90 #endif
91
92 /*
93 * The mach_vm_xxx_t types are sized to hold the
94 * maximum pointer, offset, etc... supported on the
95 * platform.
96 */
97 type mach_vm_address_t = uint64_t;
98 type mach_vm_offset_t = uint64_t;
99 type mach_vm_size_t = uint64_t;
100
101 #if MACH_IPC_COMPAT
102 /*
103 * For the old IPC interface
104 */
105 #define MSG_TYPE_PORT_NAME uint32_t
106
107 #endif /* MACH_IPC_COMPAT */
108
109 #endif /* _PPC_VM_TYPES_DEFS_ */