Introduced new B_KERNEL_AREA_FLAGS and B_USER_AREA_FLAGS that can be used

instead B_KERNEL_PROTECTION and B_USER_PROTECTION.
Unlike before, B_USER_CLONEABLE_AREA is now only in B_KERNEL_AREA_FLAGS,
but no longer in B_KERNEL_PROTECTION. This fixes a couple of problems
when B_USER_CLONEABLE_AREA was defined without specifing read/write
access.
PAGE_PRESENT|MODIFIED|ACCESSED are in the same "namespace" as the
protection flags, and therefore, shouldn't overlap.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12154 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2005-03-30 06:34:17 +00:00
parent 9602a1c9d6
commit 9f90fa0e3a
2 changed files with 11 additions and 8 deletions

View File

@ -32,9 +32,9 @@
#define RESERVED_REGION_ID -1
// page attributes (in addition to B_READ_AREA etc.)
#define PAGE_MODIFIED 64
#define PAGE_ACCESSED 128
#define PAGE_PRESENT 256
#define PAGE_MODIFIED 0x1000
#define PAGE_ACCESSED 0x2000
#define PAGE_PRESENT 0x4000
// Should only be used by vm internals
status_t vm_page_fault(addr_t address, addr_t faultAddress, bool isWrite, bool isUser, addr_t *newip);

View File

@ -170,21 +170,24 @@ enum {
// Note: the VM probably won't support all combinations - it will try
// its best, but create_area() will fail if it has to.
// Of course, the exact behaviour will be documented somewhere...
#define B_EXECUTE_AREA 4
#define B_STACK_AREA 8
#define B_EXECUTE_AREA 0x04
#define B_STACK_AREA 0x08
// "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.
// "execute" protection is currently ignored, but nevertheless, you
// should use it if you require to execute code in that area.
#define B_KERNEL_EXECUTE_AREA 64
#define B_KERNEL_STACK_AREA 128
#define B_KERNEL_EXECUTE_AREA 0x40
#define B_KERNEL_STACK_AREA 0x80
#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 | B_USER_CLONEABLE_AREA)
| B_KERNEL_STACK_AREA)
#define B_USER_AREA_FLAGS (B_USER_PROTECTION)
#define B_KERNEL_AREA_FLAGS (B_KERNEL_PROTECTION | B_USER_CLONEABLE_AREA)
#endif /* _KERNEL_VM_TYPES_H */