1 /*
2  * Copyright (c) 2015-2016 Travis Geiselbrecht
3  *
4  * Use of this source code is governed by a MIT-style
5  * license that can be found in the LICENSE file or at
6  * https://opensource.org/licenses/MIT
7  */
8 #pragma once
9 
10 #include <lk/compiler.h>
11 #include <lk/list.h>
12 
13 __BEGIN_CDECLS
14 
15 struct arch_aspace {
16     /* pointer to the translation table */
17     paddr_t tt_phys;
18     uint32_t *tt_virt;
19 
20     /* range of address space */
21     vaddr_t base;
22     size_t size;
23 
24     /* list of pages allocated for these page tables */
25     struct list_node pt_page_list;
26 };
27 
arch_mmu_is_valid_vaddr(struct arch_aspace * aspace,vaddr_t vaddr)28 static inline bool arch_mmu_is_valid_vaddr(struct arch_aspace *aspace, vaddr_t vaddr) {
29     return (vaddr >= aspace->base && vaddr <= aspace->base + aspace->size - 1);
30 }
31 
32 __END_CDECLS
33