FreeNOS
IntelPageDirectory.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_INTEL_PAGEDIRECTORY_H
19#define __LIBARCH_INTEL_PAGEDIRECTORY_H
20
21#include <Types.h>
22#include <MemoryContext.h>
23#include "IntelPageTable.h"
24
26class SplitAllocator;
27
43{
44 public:
45
56 Address from,
57 Address to);
58
70 Address phys,
72 SplitAllocator *alloc);
73
83 SplitAllocator *alloc);
84
95 Address *phys,
96 SplitAllocator *alloc) const;
97
109 SplitAllocator *alloc) const;
110
121 SplitAllocator *alloc,
122 const bool tablesOnly);
123
133 SplitAllocator *alloc);
134
135 private:
136
143 inline void releasePhysical(SplitAllocator *alloc,
144 const Address phys);
145
155
164
165 private:
166
169};
170
177#endif /* __LIBARCH_INTEL_PAGEDIRECTORY_H */
u32 flags
Definition IntelACPI.h:3
Intel page directory implementation.
MemoryContext::Result unmap(Address virt, SplitAllocator *alloc)
Remove virtual address mapping.
void releasePhysical(SplitAllocator *alloc, const Address phys)
Release a single physical page.
IntelPageTable * getPageTable(Address virt, SplitAllocator *alloc) const
Retrieve second level page table.
MemoryContext::Result translate(Address virt, Address *phys, SplitAllocator *alloc) const
Translate virtual address to physical address.
MemoryContext::Result map(Address virt, Address phys, Memory::Access access, SplitAllocator *alloc)
Map a virtual address to a physical address.
MemoryContext::Result access(Address virt, Memory::Access *access, SplitAllocator *alloc) const
Get Access flags for a virtual address.
u32 m_tables[1024]
Array of page directory entries.
MemoryContext::Result releaseRange(const Memory::Range range, SplitAllocator *alloc)
Release range of memory.
MemoryContext::Result releaseSection(const Memory::Range range, SplitAllocator *alloc, const bool tablesOnly)
Release memory sections.
MemoryContext::Result copy(IntelPageDirectory *directory, Address from, Address to)
Copy mappings from another directory.
Intel 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