Fix A1 allocator to map the correct pages
This commit is contained in:
parent
63fbbc9051
commit
dd07a08388
@ -35,17 +35,17 @@ struct A1
|
|||||||
|
|
||||||
ulong address = Hurl.A1_BASE + allocated;
|
ulong address = Hurl.A1_BASE + allocated;
|
||||||
|
|
||||||
ulong mapped_limit = round_up_power_2(address, PAGE_SIZE);
|
ulong current_limit = round_up_power_2(address, PAGE_SIZE);
|
||||||
|
|
||||||
allocated += size;
|
allocated += size;
|
||||||
|
|
||||||
ulong desired_limit = round_up_power_2(Hurl.A1_BASE + allocated, PAGE_SIZE);
|
ulong desired_limit = round_up_power_2(Hurl.A1_BASE + allocated, PAGE_SIZE);
|
||||||
|
|
||||||
while (desired_limit > mapped_limit)
|
while (desired_limit > current_limit)
|
||||||
{
|
{
|
||||||
void * page = Hippo.allocate_page();
|
void * page = Hippo.allocate_page();
|
||||||
Hurl.map(Hurl.A1_BASE + mapped_limit, page, PT_WRITABLE);
|
Hurl.map(current_limit, page, PT_WRITABLE);
|
||||||
mapped_limit += PAGE_SIZE;
|
current_limit += PAGE_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return cast(void *)address;
|
return cast(void *)address;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user