mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:17:44 +00:00
Kernel: Replace the last "linear" with "virtual".
This commit is contained in:
parent
42f374d0f1
commit
1c5677032a
2 changed files with 3 additions and 2 deletions
|
@ -74,7 +74,7 @@ void MemoryManager::initialize_paging()
|
||||||
// 3 MB -> 4 MB kmalloc() space.
|
// 3 MB -> 4 MB kmalloc() space.
|
||||||
// 4 MB -> 5 MB Supervisor physical pages (available for allocation!)
|
// 4 MB -> 5 MB Supervisor physical pages (available for allocation!)
|
||||||
// 5 MB -> 0xc0000000 Userspace physical pages (available for allocation!)
|
// 5 MB -> 0xc0000000 Userspace physical pages (available for allocation!)
|
||||||
// 0xc0000000-0xffffffff Kernel-only linear address space
|
// 0xc0000000-0xffffffff Kernel-only virtual address space
|
||||||
|
|
||||||
#ifdef MM_DEBUG
|
#ifdef MM_DEBUG
|
||||||
dbgprintf("MM: Quickmap will use %p\n", m_quickmap_addr.get());
|
dbgprintf("MM: Quickmap will use %p\n", m_quickmap_addr.get());
|
||||||
|
@ -225,7 +225,7 @@ auto MemoryManager::ensure_pte(PageDirectory& page_directory, VirtualAddress vad
|
||||||
void MemoryManager::map_protected(VirtualAddress vaddr, size_t length)
|
void MemoryManager::map_protected(VirtualAddress vaddr, size_t length)
|
||||||
{
|
{
|
||||||
InterruptDisabler disabler;
|
InterruptDisabler disabler;
|
||||||
// FIXME: ASSERT(linearAddress is 4KB aligned);
|
ASSERT(vaddr.is_page_aligned());
|
||||||
for (dword offset = 0; offset < length; offset += PAGE_SIZE) {
|
for (dword offset = 0; offset < length; offset += PAGE_SIZE) {
|
||||||
auto pte_address = vaddr.offset(offset);
|
auto pte_address = vaddr.offset(offset);
|
||||||
auto pte = ensure_pte(kernel_page_directory(), pte_address);
|
auto pte = ensure_pte(kernel_page_directory(), pte_address);
|
||||||
|
|
|
@ -11,6 +11,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
bool is_null() const { return m_address == 0; }
|
bool is_null() const { return m_address == 0; }
|
||||||
|
bool is_page_aligned() const { return (m_address & 0xfff) == 0; }
|
||||||
|
|
||||||
VirtualAddress offset(dword o) const { return VirtualAddress(m_address + o); }
|
VirtualAddress offset(dword o) const { return VirtualAddress(m_address + o); }
|
||||||
dword get() const { return m_address; }
|
dword get() const { return m_address; }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue