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 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#define B_KERNEL_AREA			(1 << 14)
27	// Usable from userland according to its protection flags, but the area
28	// itself is not deletable, resizable, etc from userland.
29
30#define B_USER_AREA_FLAGS		\
31	(B_USER_PROTECTION | B_OVERCOMMITTING_AREA | B_CLONEABLE_AREA)
32#define B_KERNEL_AREA_FLAGS \
33	(B_KERNEL_PROTECTION | B_SHARED_AREA)
34
35// mapping argument for several internal VM functions
36enum {
37	REGION_NO_PRIVATE_MAP = 0,
38	REGION_PRIVATE_MAP
39};
40
41enum {
42	// TODO: these are here only temporarily - it's a private
43	// addition to the BeOS create_area() lock flags
44	B_ALREADY_WIRED	= 7,
45};
46
47#define MEMORY_TYPE_SHIFT		28
48
49
50#endif	/* _SYSTEM_VM_DEFS_H */
51