xref: /haiku/headers/private/kernel/vm/vm_priv.h (revision 13581b3d2a71545960b98fefebc5225b5bf29072)
1 /*
2  * Copyright 2002-2008, Haiku. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  *
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
10 
11 
12 #include <vm/vm_types.h>
13 
14 
15 // reserved area definitions
16 #define RESERVED_AREA_ID -1
17 #define RESERVED_AVOID_BASE 0x01
18 
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
23 
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
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);
35 
36 const char *page_state_to_string(int state);
37 	// for debugging purposes only
38 
39 #ifdef __cplusplus
40 }
41 #endif
42 
43 #endif	/* _KERNEL_VM_VM_PRIV_H */
44