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