OS: Rename B_USER_CLONEABLE_AREA to B_CLONEABLE_AREA.

It now lives in OS.h. The idea is that this will now be
accessible to userland applications, so userland memory
is protected from access by other processes, just as
kernel memory is.

No functional change (the constants are still the same,
though I've changed some to use shifts to make clear
which bits are allocated are which are unused.)
This commit is contained in:
Augustin Cavalier
2019-08-10 15:51:41 -04:00
parent e4d335404f
commit 8a0c9d52c6
22 changed files with 60 additions and 70 deletions
+2 -3
View File
@@ -111,9 +111,8 @@ typedef struct {
#define B_ANY_KERNEL_BLOCK_ADDRESS (B_ANY_KERNEL_ADDRESS + 1)
/* area protection flags for the kernel */
#define B_KERNEL_READ_AREA 16
#define B_KERNEL_WRITE_AREA 32
#define B_USER_CLONEABLE_AREA 256
#define B_KERNEL_READ_AREA (1 << 4)
#define B_KERNEL_WRITE_AREA (1 << 5)
/* MTR attributes for mapping physical memory (Intel Architecture only) */
// TODO: rename those to something more meaningful
+5 -4
View File
@@ -83,13 +83,14 @@ typedef struct area_info {
#define B_RANDOMIZED_BASE_ADDRESS 7
/* area protection */
#define B_READ_AREA 1
#define B_WRITE_AREA 2
#define B_EXECUTE_AREA 4
#define B_STACK_AREA 8
#define B_READ_AREA (1 << 0)
#define B_WRITE_AREA (1 << 1)
#define B_EXECUTE_AREA (1 << 2)
#define B_STACK_AREA (1 << 3)
/* "stack" protection is not available on most platforms - it's used
to only commit memory as needed, and have guard pages at the
bottom of the stack. */
#define B_CLONEABLE_AREA (1 << 8)
extern area_id create_area(const char *name, void **startAddress,
uint32 addressSpec, size_t size, uint32 lock,
+5 -5
View File
@@ -29,13 +29,13 @@
// 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.
#define B_OVERCOMMITTING_AREA 0x1000
#define B_SHARED_AREA 0x2000
/* 0x4000 was B_KERNEL_AREA until hrev52545 */
#define B_OVERCOMMITTING_AREA (1 << 12)
#define B_SHARED_AREA (1 << 13)
#define B_USER_AREA_FLAGS (B_USER_PROTECTION | B_OVERCOMMITTING_AREA)
#define B_USER_AREA_FLAGS \
(B_USER_PROTECTION | B_OVERCOMMITTING_AREA | B_CLONEABLE_AREA)
#define B_KERNEL_AREA_FLAGS \
(B_KERNEL_PROTECTION | B_USER_CLONEABLE_AREA | B_SHARED_AREA)
(B_KERNEL_PROTECTION | B_SHARED_AREA)
// mapping argument for several internal VM functions
enum {