2002-07-09 16:24:59 +04:00
|
|
|
/*
|
2008-07-17 03:36:25 +04:00
|
|
|
* Copyright 2002-2008, Haiku. All rights reserved.
|
2005-03-19 04:58:05 +03:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*
|
|
|
|
* Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
|
|
|
|
* Distributed under the terms of the NewOS License.
|
|
|
|
*/
|
2009-12-02 21:05:10 +03:00
|
|
|
#ifndef _KERNEL_VM_VM_PRIV_H
|
|
|
|
#define _KERNEL_VM_VM_PRIV_H
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2007-09-27 16:21:33 +04:00
|
|
|
|
2009-12-02 21:05:10 +03:00
|
|
|
#include <vm/vm_types.h>
|
2007-09-27 16:21:33 +04:00
|
|
|
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2005-05-15 19:06:57 +04:00
|
|
|
// reserved area definitions
|
|
|
|
#define RESERVED_AREA_ID -1
|
|
|
|
#define RESERVED_AVOID_BASE 0x01
|
2004-06-10 06:01:59 +04:00
|
|
|
|
2004-06-08 12:24:53 +04:00
|
|
|
// page attributes (in addition to B_READ_AREA etc.)
|
2005-03-30 10:34:17 +04:00
|
|
|
#define PAGE_MODIFIED 0x1000
|
|
|
|
#define PAGE_ACCESSED 0x2000
|
|
|
|
#define PAGE_PRESENT 0x4000
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2005-05-17 03:17:45 +04:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2002-07-09 16:24:59 +04:00
|
|
|
// Should only be used by vm internals
|
2007-09-03 19:41:14 +04:00
|
|
|
status_t vm_page_fault(addr_t address, addr_t faultAddress, bool isWrite,
|
2013-03-06 21:03:54 +04:00
|
|
|
bool isExecute, bool isUser, addr_t *newip);
|
2004-11-03 20:24:41 +03:00
|
|
|
void vm_unreserve_memory(size_t bytes);
|
2010-01-26 17:44:58 +03:00
|
|
|
status_t vm_try_reserve_memory(size_t bytes, int priority, bigtime_t timeout);
|
2004-11-03 20:24:41 +03:00
|
|
|
status_t vm_daemon_init(void);
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2007-09-27 00:19:51 +04:00
|
|
|
const char *page_state_to_string(int state);
|
|
|
|
// for debugging purposes only
|
|
|
|
|
2005-05-17 03:17:45 +04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2009-12-02 21:05:10 +03:00
|
|
|
#endif /* _KERNEL_VM_VM_PRIV_H */
|