#include <ipc/ipc_port.h>
#include <ipc/ipc_types.h>
#include <ipc/ipc_space.h>
-#include <kern/lock.h>
+#include <kern/locks.h>
#include <kern/kalloc.h>
#include <kern/thread.h>
#include <vm/vm_kern.h>
#define MACH_PORT_FACE mach_port_t
-#if 0
-#ifndef USE_PRECIOUS
-#define USE_PRECIOUS TRUE
-#endif
+#if CONFIG_FREEZE
+#define RECLAIM_SWAP 1
+#else
+#define RECLAIM_SWAP 0
#endif
+#define USE_PRECIOUS 0
+
#ifdef USER_PAGER
#define UP(stuff) stuff
#else /* USER_PAGER */
/*
* Debug.
*/
-__private_extern__ char my_name[];
+extern char my_name[];
#define DEFAULT_PAGER_DEBUG 0
#ifdef MACH_KERNEL
#define BS_LOCK_INIT(bs) lck_mtx_init(&(bs)->bs_lock, &default_pager_lck_grp, &default_pager_lck_attr)
+#define BS_LOCK_DESTROY(bs) lck_mtx_destroy(&(bs)->bs_lock, &default_pager_lck_grp)
#define BS_LOCK(bs) lck_mtx_lock(&(bs)->bs_lock)
#define BS_UNLOCK(bs) lck_mtx_unlock(&(bs)->bs_lock)
extern int backing_store_release_trigger_disable;
#define BSL_LOCK_INIT() lck_mtx_init(&backing_store_list.bsl_lock, &default_pager_lck_grp, &default_pager_lck_attr)
+#define BSL_LOCK_DESTROY() lck_mtx_destroy(&backing_store_list.bsl_lock, &default_pager_lck_grp)
#define BSL_LOCK() lck_mtx_lock(&backing_store_list.bsl_lock)
#define BSL_UNLOCK() lck_mtx_unlock(&backing_store_list.bsl_lock)
#define PAGING_SEGMENT_NULL ((paging_segment_t) 0)
#define PS_LOCK_INIT(ps) lck_mtx_init(&(ps)->ps_lock, &default_pager_lck_grp, &default_pager_lck_attr)
+#define PS_LOCK_DESTROY(ps) lck_mtx_destroy(&(ps)->ps_lock, &default_pager_lck_grp)
#define PS_LOCK(ps) lck_mtx_lock(&(ps)->ps_lock)
#define PS_UNLOCK(ps) lck_mtx_unlock(&(ps)->ps_lock)
extern int paging_segment_max; /* highest used paging segment index */
extern int ps_select_array[DEFAULT_PAGER_BACKING_STORE_MAXPRI+1];
-#define PSL_LOCK_INIT() lck_mtx_init(&paging_segments_lock, &default_pager_lck_grp, &default_pager_lck_attr)
+#define PSL_LOCK_INIT() lck_mtx_init(&paging_segments_lock, &default_pager_lck_grp, &default_pager_lck_attr)
+#define PSL_LOCK_DESTROY() lck_mtx_destroy(&paging_segments_lock, &default_pager_lck_grp)
#define PSL_LOCK() lck_mtx_lock(&paging_segments_lock)
#define PSL_UNLOCK() lck_mtx_unlock(&paging_segments_lock)
} vstruct_alias_t;
#define DPT_LOCK_INIT(lock) lck_mtx_init(&(lock), &default_pager_lck_grp, &default_pager_lck_attr)
+#define DPT_LOCK_DESTROY(lock) lck_mtx_destroy(&(lock), &default_pager_lck_grp)
#define DPT_LOCK(lock) lck_mtx_lock(&(lock))
#define DPT_UNLOCK(lock) lck_mtx_unlock(&(lock))
#define DPT_SLEEP(lock, e, i) lck_mtx_sleep(&(lock), LCK_SLEEP_DEFAULT, (event_t)(e), i)
#define VS_UNLOCK(vs) hw_lock_unlock(&(vs)->vs_lock)
#define VS_MAP_LOCK_TYPE lck_mtx_t
#define VS_MAP_LOCK_INIT(vs) lck_mtx_init(&(vs)->vs_map_lock, &default_pager_lck_grp, &default_pager_lck_attr)
+#define VS_MAP_LOCK_DESTROY(vs) lck_mtx_destroy(&(vs)->vs_map_lock, &default_pager_lck_grp)
#define VS_MAP_LOCK(vs) lck_mtx_lock(&(vs)->vs_map_lock)
#define VS_MAP_TRY_LOCK(vs) lck_mtx_try_lock(&(vs)->vs_map_lock)
#define VS_MAP_UNLOCK(vs) lck_mtx_unlock(&(vs)->vs_map_lock)
int vsl_count; /* saves code */
};
-__private_extern__ struct vstruct_list_head vstruct_list;
+extern struct vstruct_list_head vstruct_list;
__private_extern__ void vstruct_list_insert(vstruct_t vs);
__private_extern__ void vstruct_list_delete(vstruct_t vs);
extern lck_attr_t default_pager_lck_attr;
#define VSL_LOCK_INIT() lck_mtx_init(&vstruct_list.vsl_lock, &default_pager_lck_grp, &default_pager_lck_attr)
+#define VSL_LOCK_DESTROY() lck_mtx_destroy(&vstruct_list.vsl_lock, &default_pager_lck_grp)
#define VSL_LOCK() lck_mtx_lock(&vstruct_list.vsl_lock)
#define VSL_LOCK_TRY() lck_mtx_try_lock(&vstruct_list.vsl_lock)
#define VSL_UNLOCK() lck_mtx_unlock(&vstruct_list.vsl_lock)
#define VSL_SLEEP(e,i) lck_mtx_sleep(&vstruct_list.vsl_lock, LCK_SLEEP_DEFAULT, (e), (i))
#ifdef MACH_KERNEL
-__private_extern__ zone_t vstruct_zone;
+extern zone_t vstruct_zone;
#endif
/*
MACH_PORT_FACE);
extern vstruct_t ps_vstruct_create(dp_size_t);
extern void ps_vstruct_dealloc(vstruct_t);
+extern kern_return_t ps_vstruct_reclaim(vstruct_t,
+ boolean_t,
+ boolean_t);
extern kern_return_t pvs_cluster_read(vstruct_t,
dp_offset_t,
dp_size_t,
/* Should we encrypt data before writing to swap ? */
extern boolean_t dp_encryption;
+extern boolean_t dp_isssd;
+
#endif /* _DEFAULT_PAGER_INTERNAL_H_ */