2008-05-14 07:55:16 +04:00
|
|
|
/*
|
|
|
|
* Copyright 2002-2008, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*
|
|
|
|
* Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
|
|
|
|
* Distributed under the terms of the NewOS License.
|
|
|
|
*/
|
|
|
|
#ifndef _SYSTEM_VM_DEFS_H
|
|
|
|
#define _SYSTEM_VM_DEFS_H
|
|
|
|
|
|
|
|
#include <OS.h>
|
|
|
|
|
|
|
|
|
|
|
|
#define B_USER_PROTECTION \
|
|
|
|
(B_READ_AREA | B_WRITE_AREA | B_EXECUTE_AREA | B_STACK_AREA)
|
|
|
|
#define B_KERNEL_PROTECTION \
|
|
|
|
(B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | B_KERNEL_EXECUTE_AREA \
|
|
|
|
| B_KERNEL_STACK_AREA)
|
|
|
|
|
|
|
|
// TODO: These aren't really a protection flags, but since the "protection"
|
|
|
|
// field is the only flag field, we currently use it for this.
|
|
|
|
// A cleaner approach would be appreciated - maybe just an official generic
|
|
|
|
// flags region in the protection field.
|
2019-08-10 22:51:41 +03:00
|
|
|
#define B_OVERCOMMITTING_AREA (1 << 12)
|
|
|
|
#define B_SHARED_AREA (1 << 13)
|
2020-05-24 23:14:09 +03:00
|
|
|
#define B_KERNEL_AREA (1 << 14)
|
|
|
|
// Usable from userland according to its protection flags, but the area
|
|
|
|
// itself is not deletable, resizable, etc from userland.
|
2008-05-14 07:55:16 +04:00
|
|
|
|
2019-08-10 22:51:41 +03:00
|
|
|
#define B_USER_AREA_FLAGS \
|
|
|
|
(B_USER_PROTECTION | B_OVERCOMMITTING_AREA | B_CLONEABLE_AREA)
|
2008-05-14 07:55:16 +04:00
|
|
|
#define B_KERNEL_AREA_FLAGS \
|
2019-08-10 22:51:41 +03:00
|
|
|
(B_KERNEL_PROTECTION | B_SHARED_AREA)
|
2008-05-14 07:55:16 +04:00
|
|
|
|
|
|
|
// mapping argument for several internal VM functions
|
|
|
|
enum {
|
|
|
|
REGION_NO_PRIVATE_MAP = 0,
|
|
|
|
REGION_PRIVATE_MAP
|
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
2010-06-23 17:29:25 +04:00
|
|
|
// TODO: these are here only temporarily - it's a private
|
|
|
|
// addition to the BeOS create_area() lock flags
|
|
|
|
B_ALREADY_WIRED = 7,
|
2008-05-14 07:55:16 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#define MEMORY_TYPE_SHIFT 28
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* _SYSTEM_VM_DEFS_H */
|