Fixed the pageframe allocation error introduced by

d641f5a211

This did only occur on the SCC: If someone allocated much memory and
wrote over it, it did affect the initrd...
This commit is contained in:
Jacek Galowicz 2012-05-03 04:16:41 -07:00
parent b1bf768341
commit 0a577b9f7e

View file

@ -183,15 +183,6 @@ int mmu_init(void)
atomic_int32_inc(&total_allocated_pages);
atomic_int32_dec(&total_available_pages);
/*
* The init ram disk are already loaded.
* Therefore, we set these pages as used.
*/
for(addr=bootinfo->addr; addr < bootinfo->addr+bootinfo->size; addr+=PAGE_SIZE) {
page_set_mark(addr >> PAGE_SHIFT);
atomic_int32_inc(&total_allocated_pages);
atomic_int32_dec(&total_available_pages);
}
#else
#error Currently, MetalSVM supports only the Multiboot specification or the RockCreek processor!
#endif
@ -239,6 +230,17 @@ int mmu_init(void)
atomic_int32_inc(&total_pages);
atomic_int32_inc(&total_available_pages);
}
/*
* The init ram disk are already loaded.
* Therefore, we set these pages as used.
*/
for(addr=bootinfo->addr; addr < bootinfo->addr+bootinfo->size; addr+=PAGE_SIZE) {
// This area is already mapped, so we need to virt_to_phys() these addresses.
page_set_mark(virt_to_phys(addr) >> PAGE_SHIFT);
atomic_int32_inc(&total_allocated_pages);
atomic_int32_dec(&total_available_pages);
}
#endif
return ret;