2 * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_OSREFERENCE_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. The rights granted to you under the
10 * License may not be used to create, or enable the creation or
11 * redistribution of, unlawful or unlicensed copies of an Apple operating
12 * system, or to circumvent, violate, or enable the circumvention or
13 * violation of, any terms of an Apple operating system software license
16 * Please obtain a copy of the License at
17 * http://www.opensource.apple.com/apsl/ and read it before using this
20 * The Original Code and all software distributed under the License are
21 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
22 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
23 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
25 * Please see the License for the specific language governing rights and
26 * limitations under the License.
28 * @APPLE_LICENSE_OSREFERENCE_HEADER_END@
34 * Mach Operating System
35 * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University
36 * All Rights Reserved.
38 * Permission to use, copy, modify and distribute this software and its
39 * documentation is hereby granted, provided that both the copyright
40 * notice and this permission notice appear in all copies of the
41 * software, derivative works or modified versions, and any portions
42 * thereof, and that both notices appear in supporting documentation.
44 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
45 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
46 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
48 * Carnegie Mellon requests users of this software to return to
50 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
51 * School of Computer Science
52 * Carnegie Mellon University
53 * Pittsburgh PA 15213-3890
55 * any improvements or extensions that they make and grant Carnegie Mellon
56 * the rights to redistribute these changes.
63 * Author: Avadis Tevanian, Jr.
66 * Header file for VM data types. I386 version.
69 #ifndef _MACH_I386_VM_TYPES_H_
70 #define _MACH_I386_VM_TYPES_H_
74 #include <i386/_types.h>
78 * natural_t and integer_t are Mach's legacy types for machine-
79 * independent integer types (unsigned, and signed, respectively).
80 * Their original purpose was to define other types in a machine/
81 * compiler independent way.
83 * They also had an implicit "same size as pointer" characteristic
84 * to them (i.e. Mach's traditional types are very ILP32 or ILP64
85 * centric). We will likely support x86 ABIs that do not follow
86 * either ofthese models (specifically LP64). Therefore, we had to
87 * make a choice between making these types scale with pointers or stay
88 * tied to integers. Because their use is predominantly tied to
89 * to the size of an integer, we are keeping that association and
90 * breaking free from pointer size guarantees.
92 * New use of these types is discouraged.
94 typedef __darwin_natural_t natural_t
;
95 typedef int integer_t
;
98 * A vm_offset_t is a type-neutral pointer,
99 * e.g. an offset into a virtual memory space.
101 typedef natural_t vm_offset_t
;
104 * A vm_size_t is the proper type for e.g.
105 * expressing the difference between two
106 * vm_offset_t entities.
108 typedef natural_t vm_size_t
;
111 * This new type is independent of a particular vm map's
112 * implementation size - and represents appropriate types
113 * for all possible maps. This is used for interfaces
114 * where the size of the map is not known - or we don't
115 * want to have to distinguish.
117 typedef uint32_t mach_vm_address_t
;
118 typedef uint32_t mach_vm_offset_t
;
119 typedef uint32_t mach_vm_size_t
;
121 /* LP64todo - convert these over for good */
123 typedef uint64_t vm_map_offset_t
;
124 typedef uint64_t vm_map_address_t
;
125 typedef uint64_t vm_map_size_t
;
126 #define VM_MAP_MIN_ADDRESS MACH_VM_MIN_ADDRESS
127 #define VM_MAP_MAX_ADDRESS MACH_VM_MAX_ADDRESS
129 typedef uint32_t vm_map_offset_t
;
130 typedef uint32_t vm_map_address_t
;
131 typedef uint32_t vm_map_size_t
;
132 #define VM_MAP_MIN_ADDRESS VM_MIN_ADDRESS
133 #define VM_MAP_MAX_ADDRESS VM_MAX_ADDRESS
136 #ifdef MACH_KERNEL_PRIVATE
141 * These are types used internal to Mach to implement the
142 * legacy 32-bit VM APIs published by the kernel.
144 typedef uint32_t vm32_address_t
;
145 typedef uint32_t vm32_offset_t
;
146 typedef uint32_t vm32_size_t
;
148 #endif /* VM32_SUPPORT */
150 #endif /* MACH_KERNEL_PRIVATE */
152 #endif /* ASSEMBLER */
155 * If composing messages by hand (please do not)
157 #define MACH_MSG_TYPE_INTEGER_T MACH_MSG_TYPE_INTEGER_32
159 #endif /* _MACH_I386_VM_TYPES_H_ */