1/*
2 * \brief demandpaging.h
3 *
4 * Copyright (c) 2015 ETH Zurich.
5 * All rights reserved.
6 *
7 * This file is distributed under the terms in the attached LICENSE file.
8 * If you do not find this file, copies can be found by writing to:
9 * ETH Zurich D-INFK, Universitaetsstrasse 6, CH-8092 Zurich. Attn: Systems Group.
10 */
11#ifndef LIB_DEMANDPAGING_INCLUDE_DEMANDPAGING_H_
12#define LIB_DEMANDPAGING_INCLUDE_DEMANDPAGING_H_
13
14struct demand_paging_region;
15
16typedef size_t (demand_paging_evict_fn_t)(void);
17
18/**
19 * @brief initializes the demand paging library
20 *
21 * @return
22 */
23errval_t demand_paging_init(void *ex_stack, size_t stack_size);
24
25
26errval_t demand_paging_region_create(size_t bytes, size_t pagesize, size_t numframes,
27                                     struct demand_paging_region **ret_dpr);
28
29errval_t demand_paging_region_add_frames(struct capref *frames, size_t count,
30                                         struct demand_paging_region *dpr);
31
32errval_t demand_paging_region_remove_frames(size_t count, struct demand_paging_region *dpr,
33                                             struct capref *ret_frames, size_t *ret_count);
34
35errval_t demand_paging_region_destory(struct demand_paging_region *dpr);
36
37
38void *demand_paging_get_base_address(struct demand_paging_region *dpr);
39
40#endif /* LIB_DEMANDPAGING_INCLUDE_DEMANDPAGING_H_ */
41