Merge branch 'cleanup' into vogel
This commit is contained in:
commit
f361783f4b
2 changed files with 8 additions and 12 deletions
|
@ -34,7 +34,7 @@
|
|||
// ____ _ _
|
||||
// / ___| _ _ _ __ ___ | |__ ___ | |___
|
||||
// \___ \| | | | '_ ` _ \| '_ \ / _ \| / __|
|
||||
// ___) | |_| | | | | | | |_) | (_) | \__ \
|
||||
// ___) | |_| | | | | | | |_) | (_) | \__
|
||||
// |____/ \__, |_| |_| |_|_.__/ \___/|_|___/
|
||||
// |___/
|
||||
//
|
||||
|
@ -253,7 +253,7 @@
|
|||
// _____ _ _
|
||||
// | ___| _ _ __ ___| |_(_) ___ _ __ ___
|
||||
// | |_ | | | | '_ \ / __| __| |/ _ \| '_ \/ __|
|
||||
// | _|| |_| | | | | (__| |_| | (_) | | | \__ \
|
||||
// | _|| |_| | | | | (__| |_| | (_) | | | \__
|
||||
// |_| \__,_|_| |_|\___|\__|_|\___/|_| |_|___/
|
||||
//
|
||||
// #########################################################################################
|
||||
|
|
16
mm/memory.c
16
mm/memory.c
|
@ -109,7 +109,8 @@ int mmu_init(void)
|
|||
|
||||
while (mmap < mmap_end) {
|
||||
if (mmap->type == MULTIBOOT_MEMORY_AVAILABLE) {
|
||||
/* set the available memory as "unused" */
|
||||
/
|
||||
// set the available memory as "unused"
|
||||
addr = mmap->addr;
|
||||
end_addr = addr + mmap->len;
|
||||
|
||||
|
@ -129,7 +130,7 @@ int mmu_init(void)
|
|||
}
|
||||
}
|
||||
#elif defined(CONFIG_ROCKCREEK)
|
||||
/* of course, the first slots belong to the private memory */
|
||||
// of course, the first slots belong to the private memory
|
||||
for(addr=0x00; addr<1*0x1000000; addr+=PAGE_SIZE) {
|
||||
page_clear_mark(addr >> PAGE_SHIFT);
|
||||
if (addr > addr + PAGE_SIZE)
|
||||
|
@ -147,9 +148,7 @@ int mmu_init(void)
|
|||
atomic_int32_inc(&total_available_pages);
|
||||
}
|
||||
|
||||
/*
|
||||
* Mark the bootinfo as used.
|
||||
*/
|
||||
// mark the bootinfo as used.
|
||||
page_set_mark((size_t)bootinfo >> PAGE_SHIFT);
|
||||
atomic_int32_inc(&total_allocated_pages);
|
||||
atomic_int32_dec(&total_available_pages);
|
||||
|
@ -164,7 +163,7 @@ int mmu_init(void)
|
|||
atomic_int32_add(&total_allocated_pages, kernel_size >> PAGE_SHIFT);
|
||||
atomic_int32_sub(&total_available_pages, kernel_size >> PAGE_SHIFT);
|
||||
|
||||
/* set kernel space as used */
|
||||
// set kernel space as used
|
||||
for(i=(size_t) &kernel_start >> PAGE_SHIFT; i < (size_t) &kernel_end >> PAGE_SHIFT; i++)
|
||||
page_set_mark(i);
|
||||
if ((size_t) &kernel_end & (PAGE_SIZE-1))
|
||||
|
@ -194,9 +193,7 @@ int mmu_init(void)
|
|||
if (mb_info && (mb_info->flags & MULTIBOOT_INFO_MODS)) {
|
||||
multiboot_module_t* mmodule = (multiboot_module_t*) ((size_t) mb_info->mods_addr);
|
||||
|
||||
/*
|
||||
* Mark the mb_info as used.
|
||||
*/
|
||||
// mark the mb_info as used.
|
||||
page_set_mark((size_t)mb_info >> PAGE_SHIFT);
|
||||
atomic_int32_inc(&total_allocated_pages);
|
||||
atomic_int32_dec(&total_available_pages);
|
||||
|
@ -371,7 +368,6 @@ void kfree(void* addr, size_t sz)
|
|||
|
||||
index = phyaddr >> PAGE_SHIFT;
|
||||
page_clear_mark(index);
|
||||
|
||||
}
|
||||
spinlock_unlock(&bitmap_lock);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue