- remove using of uninitialized local variables

git-svn-id: http://svn.lfbs.rwth-aachen.de/svn/scc/trunk/MetalSVM@60 315a16e6-25f9-4109-90ae-ca3045a26c18
This commit is contained in:
stefan 2010-08-10 20:15:23 +00:00
parent 2a6664f01a
commit 67ba4fba6a

View file

@ -33,7 +33,7 @@
* 0 => free
* 1 => occupied
*/
static uint8_t bitmap[BITMAP_SIZE];
static uint8_t bitmap[BITMAP_SIZE] = {[0 ... BITMAP_SIZE-1] = 0xFF};
static spinlock_t bitmap_lock = SPINLOCK_INIT;
static size_t alloc_start;
atomic_int32_t total_pages = ATOMIC_INIT(0);
@ -85,18 +85,20 @@ int mmu_init(void)
size_t addr;
/* set whole address space as occupied */
memset(bitmap, 0xFF, sizeof(uint8_t)*BITMAP_SIZE);
// array is already initialized (see declaration)
//memset(bitmap, 0xFF, sizeof(uint8_t)*BITMAP_SIZE);
#ifdef CONFIG_MULTIBOOT
if (mb_info && (mb_info->flags & (1 << (6)))) {
multiboot_memory_map_t* mmap = (multiboot_memory_map_t*) mb_info->mmap_addr;
multiboot_memory_map_t* mmap_end = (void*) ((size_t) mb_info->mmap_addr + mb_info->mmap_length);
size_t end_addr;
while (mmap < mmap_end) {
if (mmap->type == MULTIBOOT_MEMORY_AVAILABLE) {
/* set the available memory as "unused" */
size_t end_addr = addr + mmap->len;
addr = mmap->addr;
addr = mmap->addr;
end_addr = addr + mmap->len;
while (addr < end_addr) {
page_clear_mark(addr / PAGE_SIZE);