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