]>
git.saurik.com Git - apple/xnu.git/blob - osfmk/mach/vm_prot.h
f8e5bbd70979ec21ad783de573ee03b606101665
2 * Copyright (c) 2000-2002 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,1987 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.
61 * File: mach/vm_prot.h
62 * Author: Avadis Tevanian, Jr., Michael Wayne Young
64 * Virtual memory protection definitions.
68 #ifndef _MACH_VM_PROT_H_
69 #define _MACH_VM_PROT_H_
74 * vm_prot_t VM protection values.
77 typedef int vm_prot_t
;
80 * Protection values, defined as bits within the vm_prot_t type
83 #define VM_PROT_NONE ((vm_prot_t) 0x00)
85 #define VM_PROT_READ ((vm_prot_t) 0x01) /* read permission */
86 #define VM_PROT_WRITE ((vm_prot_t) 0x02) /* write permission */
87 #define VM_PROT_EXECUTE ((vm_prot_t) 0x04) /* execute permission */
90 * The default protection for newly-created virtual memory
93 #define VM_PROT_DEFAULT (VM_PROT_READ|VM_PROT_WRITE)
96 * The maximum privileges possible, for parameter checking.
99 #define VM_PROT_ALL (VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE)
102 * An invalid protection value.
103 * Used only by memory_object_lock_request to indicate no change
104 * to page locks. Using -1 here is a bad idea because it
105 * looks like VM_PROT_ALL and then some.
108 #define VM_PROT_NO_CHANGE ((vm_prot_t) 0x08)
111 * When a caller finds that he cannot obtain write permission on a
112 * mapped entry, the following flag can be used. The entry will
113 * be made "needs copy" effectively copying the object (using COW),
114 * and write permission will be added to the maximum protections
115 * for the associated entry.
118 #define VM_PROT_COPY ((vm_prot_t) 0x10)
122 * Another invalid protection value.
123 * Used only by memory_object_data_request upon an object
124 * which has specified a copy_call copy strategy. It is used
125 * when the kernel wants a page belonging to a copy of the
126 * object, and is only asking the object as a result of
127 * following a shadow chain. This solves the race between pages
128 * being pushed up by the memory manager and the kernel
129 * walking down the shadow chain.
132 #define VM_PROT_WANTS_COPY ((vm_prot_t) 0x10)
134 #endif /* _MACH_VM_PROT_H_ */