Add PAGE_SIZE constant
This commit is contained in:
parent
41531cf4d2
commit
c8a81b1101
@ -8,6 +8,9 @@ import hulk.bootinfo;
|
|||||||
import hulk.klog;
|
import hulk.klog;
|
||||||
import hulk.linker_addresses;
|
import hulk.linker_addresses;
|
||||||
|
|
||||||
|
/** Page size. */
|
||||||
|
enum size_t PAGE_SIZE = 4096u;
|
||||||
|
|
||||||
struct hippo
|
struct hippo
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@ -80,7 +83,7 @@ struct hippo
|
|||||||
{
|
{
|
||||||
free_page(phys);
|
free_page(phys);
|
||||||
}
|
}
|
||||||
phys += 4096u;
|
phys += PAGE_SIZE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -112,7 +112,7 @@ struct hurl
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
PageTable * next_pt = cast(PageTable *)hippo.allocate_page();
|
PageTable * next_pt = cast(PageTable *)hippo.allocate_page();
|
||||||
memset32(next_pt, 0, 4096u / 4u);
|
memset64(next_pt, 0u, PAGE_SIZE / 8u);
|
||||||
(*pt)[virtual, level] = PageTableEntry(next_pt, MAP_WRITABLE | MAP_PRESENT);
|
(*pt)[virtual, level] = PageTableEntry(next_pt, MAP_WRITABLE | MAP_PRESENT);
|
||||||
pt = next_pt;
|
pt = next_pt;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user