- add the SCC support in our memory management unit

git-svn-id: http://svn.lfbs.rwth-aachen.de/svn/scc/trunk/MetalSVM@147 315a16e6-25f9-4109-90ae-ca3045a26c18
This commit is contained in:
stefan 2010-09-08 07:10:02 +00:00
parent af556712bd
commit e7865175bd

View file

@ -83,7 +83,7 @@ int mmu_init(void)
{
size_t kernel_size;
unsigned int i;
size_t addr;
size_t addr, end_addr;
/* set whole address space as occupied */
// array is already initialized (see declaration)
@ -115,6 +115,10 @@ int mmu_init(void)
while(1) ;
}
/*
* Modules like init ram disk are already loaded.
* Therefore, we set these pages as used.
*/
if (mb_info && (mb_info->flags & (1 << 3))) {
multiboot_module_t* mmodule = (multiboot_module_t*) mb_info->mods_addr;
@ -125,21 +129,24 @@ int mmu_init(void)
atomic_int32_dec(&total_available_pages);
}
}
}
}
#elif defined(CONFIG_ROCKCREEK)
for(i=0; i< SCC_PMEM_REGIONS; i++){
for(i=0; i<SCC_PMEM_REGIONS; i++) {
addr = scc_info.private_mem[i].low;
end_addr = scc_info.private_mem[i].high;
while(addr < scc_info.private_mem[i].high) {
while(addr < end_addr) {
page_clear_mark(addr / PAGE_SIZE);
if (addr < addr + PAGE_SIZE)
break;
addr += PAGE_SIZE;
atomic_int32_inc(&total_pages);
atomic_int32_inc(&total_available_pages);
}
}
#else
#error Currently, MetalSVM supports only Multiboot or the RockCreek processor!
#error Currently, MetalSVM supports only the Multiboot specification or the RockCreek processor!
#endif
kernel_size = (size_t) &kernel_end - (size_t) &kernel_start;