2 * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
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
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.
21 * @APPLE_LICENSE_HEADER_END@
27 * Mach Operating System
28 * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University
29 * All Rights Reserved.
31 * Permission to use, copy, modify and distribute this software and its
32 * documentation is hereby granted, provided that both the copyright
33 * notice and this permission notice appear in all copies of the
34 * software, derivative works or modified versions, and any portions
35 * thereof, and that both notices appear in supporting documentation.
37 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
38 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
39 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
41 * Carnegie Mellon requests users of this software to return to
43 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
44 * School of Computer Science
45 * Carnegie Mellon University
46 * Pittsburgh PA 15213-3890
48 * any improvements or extensions that they make and grant Carnegie Mellon
49 * the rights to redistribute these changes.
56 * Author: Avadis Tevanian, Jr.
59 * Header file for VM data types. I386 version.
62 #ifndef _MACH_I386_VM_TYPES_H_
63 #define _MACH_I386_VM_TYPES_H_
67 #include <i386/_types.h>
71 * natural_t and integer_t are Mach's legacy types for machine-
72 * independent integer types (unsigned, and signed, respectively).
73 * Their original purpose was to define other types in a machine/
74 * compiler independent way.
76 * They also had an implicit "same size as pointer" characteristic
77 * to them (i.e. Mach's traditional types are very ILP32 or ILP64
78 * centric). We will likely support x86 ABIs that do not follow
79 * either ofthese models (specifically LP64). Therefore, we had to
80 * make a choice between making these types scale with pointers or stay
81 * tied to integers. Because their use is predominantly tied to
82 * to the size of an integer, we are keeping that association and
83 * breaking free from pointer size guarantees.
85 * New use of these types is discouraged.
87 typedef __darwin_natural_t natural_t
;
88 typedef int integer_t
;
91 * A vm_offset_t is a type-neutral pointer,
92 * e.g. an offset into a virtual memory space.
94 typedef natural_t vm_offset_t
;
97 * A vm_size_t is the proper type for e.g.
98 * expressing the difference between two
99 * vm_offset_t entities.
101 typedef natural_t vm_size_t
;
104 * This new type is independent of a particular vm map's
105 * implementation size - and represents appropriate types
106 * for all possible maps. This is used for interfaces
107 * where the size of the map is not known - or we don't
108 * want to have to distinguish.
110 typedef uint32_t mach_vm_address_t
;
111 typedef uint32_t mach_vm_offset_t
;
112 typedef uint32_t mach_vm_size_t
;
114 /* LP64todo - convert these over for good */
116 typedef uint64_t vm_map_offset_t
;
117 typedef uint64_t vm_map_address_t
;
118 typedef uint64_t vm_map_size_t
;
119 #define VM_MAP_MIN_ADDRESS MACH_VM_MIN_ADDRESS
120 #define VM_MAP_MAX_ADDRESS MACH_VM_MAX_ADDRESS
122 typedef uint32_t vm_map_offset_t
;
123 typedef uint32_t vm_map_address_t
;
124 typedef uint32_t vm_map_size_t
;
125 #define VM_MAP_MIN_ADDRESS VM_MIN_ADDRESS
126 #define VM_MAP_MAX_ADDRESS VM_MAX_ADDRESS
129 #ifdef MACH_KERNEL_PRIVATE
134 * These are types used internal to Mach to implement the
135 * legacy 32-bit VM APIs published by the kernel.
137 typedef uint32_t vm32_address_t
;
138 typedef uint32_t vm32_offset_t
;
139 typedef uint32_t vm32_size_t
;
141 #endif /* VM32_SUPPORT */
143 #endif /* MACH_KERNEL_PRIVATE */
145 #endif /* ASSEMBLER */
148 * If composing messages by hand (please do not)
150 #define MACH_MSG_TYPE_INTEGER_T MACH_MSG_TYPE_INTEGER_32
152 #endif /* _MACH_I386_VM_TYPES_H_ */