Added B_STACK_AREA and B_KERNEL_STACK_AREA protection values.
vm_store::fault() now returns a status_t. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10004 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,7 +1,10 @@
|
|||||||
/*
|
/*
|
||||||
** Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
|
* Copyright 2002-2004, Axel Dörfler, [email protected].
|
||||||
** Distributed under the terms of the NewOS License.
|
* 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 _KERNEL_VM_TYPES_H
|
#ifndef _KERNEL_VM_TYPES_H
|
||||||
#define _KERNEL_VM_TYPES_H
|
#define _KERNEL_VM_TYPES_H
|
||||||
|
|
||||||
@@ -138,7 +141,7 @@ typedef struct vm_store_ops {
|
|||||||
bool (*has_page)(struct vm_store *backing_store, off_t offset);
|
bool (*has_page)(struct vm_store *backing_store, off_t offset);
|
||||||
status_t (*read)(struct vm_store *backing_store, off_t offset, const iovec *vecs, size_t count, size_t *_numBytes);
|
status_t (*read)(struct vm_store *backing_store, off_t offset, const iovec *vecs, size_t count, size_t *_numBytes);
|
||||||
status_t (*write)(struct vm_store *backing_store, off_t offset, const iovec *vecs, size_t count, size_t *_numBytes);
|
status_t (*write)(struct vm_store *backing_store, off_t offset, const iovec *vecs, size_t count, size_t *_numBytes);
|
||||||
int (*fault)(struct vm_store *backing_store, struct vm_address_space *aspace, off_t offset);
|
status_t (*fault)(struct vm_store *backing_store, struct vm_address_space *aspace, off_t offset);
|
||||||
void (*acquire_ref)(struct vm_store *backing_store);
|
void (*acquire_ref)(struct vm_store *backing_store);
|
||||||
void (*release_ref)(struct vm_store *backing_store);
|
void (*release_ref)(struct vm_store *backing_store);
|
||||||
} vm_store_ops;
|
} vm_store_ops;
|
||||||
@@ -152,8 +155,8 @@ enum {
|
|||||||
|
|
||||||
enum {
|
enum {
|
||||||
// ToDo: these are here only temporarily - it's a private
|
// ToDo: these are here only temporarily - it's a private
|
||||||
// addition to the BeOS create_area() flags
|
// addition to the BeOS create_area() lock flags
|
||||||
B_ALREADY_WIRED = 6
|
B_ALREADY_WIRED = 6,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
@@ -166,14 +169,21 @@ enum {
|
|||||||
// its best, but create_area() will fail if it has to.
|
// its best, but create_area() will fail if it has to.
|
||||||
// Of course, the exact behaviour will be documented somewhere...
|
// Of course, the exact behaviour will be documented somewhere...
|
||||||
#define B_EXECUTE_AREA 4
|
#define B_EXECUTE_AREA 4
|
||||||
// "execute" protection is not available on x86 - but defining it
|
#define B_STACK_AREA 8
|
||||||
// doesn't hurt too much, either :-)
|
// "stack" protection is not available on most platforms - it's used
|
||||||
// (but don't use it right now, it's not yet supported at all)
|
// to only commit memory as needed, and have guard pages at the
|
||||||
#define B_KERNEL_READ_AREA 8
|
// bottom of the stack.
|
||||||
#define B_KERNEL_WRITE_AREA 16
|
// "execute" protection is currently ignored, but nevertheless, you
|
||||||
#define B_KERNEL_EXECUTE_AREA 32
|
// should use it if you require to execute code in that area.
|
||||||
|
|
||||||
#define B_USER_PROTECTION (B_READ_AREA | B_WRITE_AREA | B_EXECUTE_AREA)
|
#define B_KERNEL_READ_AREA 16
|
||||||
#define B_KERNEL_PROTECTION (B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | B_KERNEL_EXECUTE_AREA)
|
#define B_KERNEL_WRITE_AREA 32
|
||||||
|
#define B_KERNEL_EXECUTE_AREA 64
|
||||||
|
#define B_KERNEL_STACK_AREA 128
|
||||||
|
|
||||||
|
#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)
|
||||||
|
|
||||||
#endif /* _KERNEL_VM_TYPES_H */
|
#endif /* _KERNEL_VM_TYPES_H */
|
||||||
|
|||||||
Reference in New Issue
Block a user