2 * Copyright (c) 2002,2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
23 * @APPLE_LICENSE_HEADER_END@
29 #ifndef MACH_VM_TYPES_H_
30 #define MACH_VM_TYPES_H_
33 #include <sys/appleapiopts.h>
35 #include <mach/port.h>
36 #include <mach/machine/vm_types.h>
38 typedef vm_offset_t pointer_t
;
39 typedef vm_offset_t vm_address_t
;
40 typedef uint64_t vm_object_offset_t
;
43 * We use addr64_t for 64-bit addresses that are used on both
44 * 32 and 64-bit machines. On PPC, they are passed and returned as
45 * two adjacent 32-bit GPRs. We use addr64_t in places where
46 * common code must be useable both on 32 and 64-bit machines.
48 typedef uint64_t addr64_t
; /* Basic effective address */
51 * We use reg64_t for addresses that are 32 bits on a 32-bit
52 * machine, and 64 bits on a 64-bit machine, but are always
53 * passed and returned in a single GPR on PPC. This type
54 * cannot be used in generic 32-bit c, since on a 64-bit
55 * machine the upper half of the register will be ignored
56 * by the c compiler in 32-bit mode. In c, we can only use the
57 * type in prototypes of functions that are written in and called
58 * from assembly language. This type is basically a comment.
60 typedef uint32_t reg64_t
;
63 * To minimize the use of 64-bit fields, we keep some physical
64 * addresses (that are page aligned) as 32-bit page numbers.
65 * This limits the physical address space to 16TB of RAM.
67 typedef uint32_t ppnum_t
; /* Physical page number */
72 #if !defined(__APPLE_API_PRIVATE) || !defined(MACH_KERNEL_PRIVATE)
75 * Use specifically typed null structures for these in
76 * other parts of the kernel to enable compiler warnings
77 * about type mismatches, etc... Otherwise, these would
83 #endif /* !__APPLE_API_PRIVATE || !MACH_KERNEL_PRIVATE */
85 typedef struct vm_map
*vm_map_t
;
86 typedef struct vm_object
*vm_object_t
;
87 #define VM_OBJECT_NULL ((vm_object_t) 0)
89 #else /* KERNEL_PRIVATE */
91 typedef mach_port_t vm_map_t
;
93 #endif /* KERNEL_PRIVATE */
95 #define VM_MAP_NULL ((vm_map_t) 0)
98 #ifdef __APPLE_API_EVOLVING
100 #ifdef KERNEL_PRIVATE
102 #ifndef MACH_KERNEL_PRIVATE
105 struct vm_named_entry
;
106 #endif /* !MACH_KERNEL_PRIVATE */
108 typedef struct upl
*upl_t
;
109 typedef struct vm_map_copy
*vm_map_copy_t
;
110 typedef struct vm_named_entry
*vm_named_entry_t
;
112 #define VM_MAP_COPY_NULL ((vm_map_copy_t) 0)
114 #else /* !KERNEL_PRIVATE */
116 typedef mach_port_t upl_t
;
117 typedef mach_port_t vm_named_entry_t
;
119 #endif /* !KERNEL_PRIVATE */
121 #define UPL_NULL ((upl_t) 0)
122 #define VM_NAMED_ENTRY_NULL ((vm_named_entry_t) 0)
124 #endif /* __APPLE_API_EVOLVING */
126 #endif /* MACH_VM_TYPES_H_ */