xref: /haiku/headers/private/system/vm_defs.h (revision 4b918abdb02a26a770d898594eaaccc6f1726e9b)
1 /*
2  * Copyright 2002-2008, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  *
5  * Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
6  * Distributed under the terms of the NewOS License.
7  */
8 #ifndef _SYSTEM_VM_DEFS_H
9 #define _SYSTEM_VM_DEFS_H
10 
11 #include <OS.h>
12 
13 
14 #define B_USER_PROTECTION \
15 	(B_READ_AREA | B_WRITE_AREA | B_EXECUTE_AREA | B_STACK_AREA)
16 #define B_KERNEL_PROTECTION \
17 	(B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | B_KERNEL_EXECUTE_AREA \
18 	| B_KERNEL_STACK_AREA)
19 
20 // TODO: These aren't really a protection flags, but since the "protection"
21 //	field is the only flag field, we currently use it for this.
22 //	A cleaner approach would be appreciated - maybe just an official generic
23 //	flags region in the protection field.
24 #define B_OVERCOMMITTING_AREA	(1 << 12)
25 #define B_SHARED_AREA			(1 << 13)
26 
27 #define B_USER_AREA_FLAGS		\
28 	(B_USER_PROTECTION | B_OVERCOMMITTING_AREA | B_CLONEABLE_AREA)
29 #define B_KERNEL_AREA_FLAGS \
30 	(B_KERNEL_PROTECTION | B_SHARED_AREA)
31 
32 // mapping argument for several internal VM functions
33 enum {
34 	REGION_NO_PRIVATE_MAP = 0,
35 	REGION_PRIVATE_MAP
36 };
37 
38 enum {
39 	// TODO: these are here only temporarily - it's a private
40 	// addition to the BeOS create_area() lock flags
41 	B_ALREADY_WIRED	= 7,
42 };
43 
44 #define MEMORY_TYPE_SHIFT		28
45 
46 
47 #endif	/* _SYSTEM_VM_DEFS_H */
48