FreeNOS
ARMFirstTable.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2015 Niek Linnenbank
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef __LIBARCH_ARM_FIRSTTABLE_H
19#define __LIBARCH_ARM_FIRSTTABLE_H
20
21#include <FreeNOS/System.h>
22#include <Types.h>
23#include <MemoryContext.h>
24#include "ARMSecondTable.h"
25
27class SplitAllocator;
28
44{
45 public:
46
58 Address phys,
60 SplitAllocator *alloc);
61
73 SplitAllocator *alloc);
74
84 SplitAllocator *alloc);
85
96 Address *phys,
97 SplitAllocator *alloc) const;
98
110 SplitAllocator *alloc) const;
111
122 SplitAllocator *alloc,
123 const bool tablesOnly);
124
134 SplitAllocator *alloc);
135
136 private:
137
144 inline void releasePhysical(SplitAllocator *alloc,
145 const Address phys);
146
156 SplitAllocator *alloc) const;
157
166
167 private:
168
171};
172
179#endif /* __LIBARCH_ARM_FIRSTTABLE_H */
u32 flags
Definition IntelACPI.h:3
ARM first level page table.
MemoryContext::Result unmap(Address virt, SplitAllocator *alloc)
Remove virtual address mapping.
ARMSecondTable * getSecondTable(Address virt, SplitAllocator *alloc) const
Retrieve second level page table.
MemoryContext::Result map(Address virt, Address phys, Memory::Access access, SplitAllocator *alloc)
Map a virtual address to a physical address.
MemoryContext::Result releaseSection(const Memory::Range range, SplitAllocator *alloc, const bool tablesOnly)
Release memory sections.
MemoryContext::Result translate(Address virt, Address *phys, SplitAllocator *alloc) const
Translate virtual address to physical address.
MemoryContext::Result releaseRange(const Memory::Range range, SplitAllocator *alloc)
Release range of memory.
MemoryContext::Result access(Address virt, Memory::Access *access, SplitAllocator *alloc) const
Get Access flags for a virtual address.
MemoryContext::Result mapLarge(Memory::Range range, SplitAllocator *alloc)
Map a contigous range of virtual memory to physical memory.
void releasePhysical(SplitAllocator *alloc, const Address phys)
Release a single physical page.
u32 m_tables[4096]
Array of page table entries.
ARM second level page table implementation.
Result
Result codes.
Allocator which separates kernel mapped memory at virtual and physical addresses.
unsigned int u32
Unsigned 32-bit number.
Definition Types.h:53
unsigned long Address
A memory address.
Definition Types.h:131
Access
Memory access flags.
Definition Memory.h:39
Memory range.
Definition Memory.h:56