From cf6fdf406781aaca0f09fc838fe9c8ce1cfcecd5 Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Wed, 22 Jun 2011 08:38:49 +0200 Subject: [PATCH] reducing the size of the kernel image by using unintialized global arrays --- mm/memory.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mm/memory.c b/mm/memory.c index c6241d52..ad29aedd 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -39,7 +39,7 @@ * * Set whole address space as occupied */ -static uint8_t bitmap[BITMAP_SIZE] = {[0 ... BITMAP_SIZE-1] = 0xFF}; +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); @@ -94,6 +94,9 @@ int mmu_init(void) unsigned int i; size_t addr; + // at first, set default value of the bitmap + memset(bitmap, 0xFF, sizeof(uint8_t)*BITMAP_SIZE); + #ifdef CONFIG_MULTIBOOT if (mb_info && (mb_info->flags & MULTIBOOT_INFO_MEM_MAP)) { size_t end_addr;