remove warnings, optimize vm_alloc
This commit is contained in:
parent
a1f07c8027
commit
531556f53c
1 changed files with 5 additions and 5 deletions
|
@ -337,8 +337,8 @@ size_t vm_alloc(uint32_t npages, uint32_t flags)
|
|||
|
||||
if (flags & MAP_KERNEL_SPACE) {
|
||||
pgd_lock = &kslock;
|
||||
start = (((size_t) &kernel_end) + PAGE_SIZE) & PAGE_MASK;
|
||||
end = (KERNEL_SPACE - 2*PAGE_SIZE) & PAGE_MASK; // we need 1 PAGE for our PGTs
|
||||
start = (((size_t) &kernel_end) + 10*PAGE_SIZE) & PAGE_MASK;
|
||||
end = (KERNEL_SPACE - PAGE_SIZE) & PAGE_MASK;
|
||||
} else {
|
||||
pgd_lock = &task->pgd_lock;
|
||||
start = KERNEL_SPACE & PAGE_MASK;
|
||||
|
@ -382,7 +382,7 @@ size_t vm_alloc(uint32_t npages, uint32_t flags)
|
|||
}
|
||||
|
||||
if (!(pgt->entries[idx_table])) {
|
||||
i+=PAGE_SIZE;
|
||||
i += PAGE_SIZE;
|
||||
j++;
|
||||
} else {
|
||||
// restart search
|
||||
|
@ -617,7 +617,7 @@ int arch_paging_init(void)
|
|||
npages = mb_info->mods_count * sizeof(multiboot_module_t) >> PAGE_SHIFT;
|
||||
if (mb_info->mods_count * sizeof(multiboot_module_t) & (PAGE_SIZE-1))
|
||||
npages++;
|
||||
map_region((size_t) (mb_info->mods_addr), (size_t) (mb_info->mods_addr), npages, MAP_KERNEL_SPACE);
|
||||
map_region((size_t) (mb_info->mods_addr), (size_t) (mb_info->mods_addr), npages, MAP_REMAP|MAP_KERNEL_SPACE);
|
||||
|
||||
for(i=0; i<mb_info->mods_count; i++, mmodule++) {
|
||||
// map physical address to the same virtual address
|
||||
|
@ -625,7 +625,7 @@ int arch_paging_init(void)
|
|||
if (mmodule->mod_end & (PAGE_SIZE-1))
|
||||
npages++;
|
||||
kprintf("Map module %s at 0x%x (%u pages)\n", (char*) mmodule->cmdline, mmodule->mod_start, npages);
|
||||
map_region((size_t) (mmodule->mod_start), (size_t) (mmodule->mod_start), npages, MAP_KERNEL_SPACE);
|
||||
map_region((size_t) (mmodule->mod_start), (size_t) (mmodule->mod_start), npages, MAP_REMAP|MAP_KERNEL_SPACE);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue