vfs: check userland buffers before reading them.
[haiku.git] / headers / private / kernel / vm / vm_priv.h
blob9091c60c812fbfbf7e166467e0851e9b0abd57ed
1 /*
2 * Copyright 2002-2008, Haiku. All rights reserved.
3 * Distributed under the terms of the MIT License.
5 * Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
6 * Distributed under the terms of the NewOS License.
7 */
8 #ifndef _KERNEL_VM_VM_PRIV_H
9 #define _KERNEL_VM_VM_PRIV_H
12 #include <vm/vm_types.h>
15 // reserved area definitions
16 #define RESERVED_AREA_ID -1
17 #define RESERVED_AVOID_BASE 0x01
19 // page attributes (in addition to B_READ_AREA etc.)
20 #define PAGE_MODIFIED 0x1000
21 #define PAGE_ACCESSED 0x2000
22 #define PAGE_PRESENT 0x4000
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
29 // Should only be used by vm internals
30 status_t vm_page_fault(addr_t address, addr_t faultAddress, bool isWrite,
31 bool isExecute, bool isUser, addr_t *newip);
32 void vm_unreserve_memory(size_t bytes);
33 status_t vm_try_reserve_memory(size_t bytes, int priority, bigtime_t timeout);
34 status_t vm_daemon_init(void);
36 const char *page_state_to_string(int state);
37 // for debugging purposes only
39 #ifdef __cplusplus
41 #endif
43 #endif /* _KERNEL_VM_VM_PRIV_H */