1/**
2 * \file
3 * \brief Kernel memory management.
4 */
5
6/*
7 * Copyright (c) 2012 ETH Zurich.
8 * All rights reserved.
9 *
10 * This file is distributed under the terms in the attached LICENSE file.
11 * If you do not find this file, copies can be found by writing to:
12 * ETH Zurich D-INFK, Universitaetstrasse 6, CH-8092 Zurich. Attn: Systems Group.
13 */
14
15#ifndef PAGING_H
16#define PAGING_H
17
18#include <barrelfish/types.h>
19#include <errors/errno.h>
20
21struct mapping_info {
22    lpaddr_t pte;       ///< where the capability is mapped
23    size_t pte_count;   ///< the amount of PTEs mapped in this mapping
24    uint64_t offset;    ///< the offset into the physical region identified by the capability where the mapping begins.
25};
26
27struct cte;
28struct capability;
29void create_mapping_cap(struct cte *mapping_cte, struct capability *cap,
30                        struct cte *ptable, cslot_t entry, size_t pte_count);
31errval_t compile_vaddr(struct cte *ptable, size_t entry, genvaddr_t *retvaddr);
32errval_t unmap_capability(struct cte *mem);
33errval_t paging_tlb_flush_range(struct cte *frame, size_t offset, size_t pages);
34
35#endif // PAGING_H
36