]> git.saurik.com Git - apple/xnu.git/blob - osfmk/mach/vm_types.h
xnu-344.49.tar.gz
[apple/xnu.git] / osfmk / mach / vm_types.h
1 /*
2 * Copyright (c) 2002,2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
7 *
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
13 * file.
14 *
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.
22 *
23 * @APPLE_LICENSE_HEADER_END@
24 */
25 /*
26 * @OSF_COPYRIGHT@
27 *
28 */
29 #ifndef MACH_VM_TYPES_H_
30 #define MACH_VM_TYPES_H_
31
32 #include <stdint.h>
33 #include <sys/appleapiopts.h>
34
35 #include <mach/port.h>
36 #include <mach/machine/vm_types.h>
37
38 typedef vm_offset_t pointer_t;
39 typedef vm_offset_t vm_address_t;
40 typedef uint64_t vm_object_offset_t;
41
42 #ifdef KERNEL_PRIVATE
43
44 #if !defined(__APPLE_API_PRIVATE) || !defined(MACH_KERNEL_PRIVATE)
45
46 /*
47 * Use specifically typed null structures for these in
48 * other parts of the kernel to enable compiler warnings
49 * about type mismatches, etc... Otherwise, these would
50 * be void*.
51 */
52 struct vm_map ;
53 struct vm_object ;
54
55 #endif /* !__APPLE_API_PRIVATE || !MACH_KERNEL_PRIVATE */
56
57 typedef struct vm_map *vm_map_t;
58 typedef struct vm_object *vm_object_t;
59 #define VM_OBJECT_NULL ((vm_object_t) 0)
60
61 #else /* KERNEL_PRIVATE */
62
63 typedef mach_port_t vm_map_t;
64
65 #endif /* KERNEL_PRIVATE */
66
67 #define VM_MAP_NULL ((vm_map_t) 0)
68
69
70 #ifdef __APPLE_API_EVOLVING
71
72 #ifdef KERNEL_PRIVATE
73
74 #ifndef MACH_KERNEL_PRIVATE
75 struct upl ;
76 struct vm_map_copy ;
77 struct vm_named_entry ;
78 #endif /* !MACH_KERNEL_PRIVATE */
79
80 typedef struct upl *upl_t;
81 typedef struct vm_map_copy *vm_map_copy_t;
82 typedef struct vm_named_entry *vm_named_entry_t;
83
84 #define VM_MAP_COPY_NULL ((vm_map_copy_t) 0)
85
86 #else /* !KERNEL_PRIVATE */
87
88 typedef mach_port_t upl_t;
89 typedef mach_port_t vm_named_entry_t;
90
91 #endif /* !KERNEL_PRIVATE */
92
93 #define UPL_NULL ((upl_t) 0)
94 #define VM_NAMED_ENTRY_NULL ((vm_named_entry_t) 0)
95
96 #endif /* __APPLE_API_EVOLVING */
97
98 #endif /* MACH_VM_TYPES_H_ */
99
100