Index: arch/ia64/Makefile.inc
===================================================================
--- arch/ia64/Makefile.inc	(revision 61e6c39dae3807d33e258548805b2804e4239a94)
+++ arch/ia64/Makefile.inc	(revision eef75f671c5a16e1de01ece7fb216c921e210d41)
@@ -39,5 +39,5 @@
 #
 
-CFLAGS += -mconstant-gp -fno-unwind-tables -minline-int-divide-min-latency
+CFLAGS += -mconstant-gp -fno-unwind-tables
 LFLAGS += -EL
 AFLAGS += -mconstant-gp
Index: generic/include/mm/frame.h
===================================================================
--- generic/include/mm/frame.h	(revision 61e6c39dae3807d33e258548805b2804e4239a94)
+++ generic/include/mm/frame.h	(revision eef75f671c5a16e1de01ece7fb216c921e210d41)
@@ -54,6 +54,6 @@
 	__address base;		/**< physical address of the first frame in the frames array */
 	frame_t *frames;	/**< array of frame_t structures in this zone */
-	count_t free_count;	/**< number of frame_t structures in free list */
-	count_t busy_count;	/**< number of frame_t structures not in free list */
+	count_t free_count;	/**< number of free frame_t structures */
+	count_t busy_count;	/**< number of busy frame_t structures */
 	
 	buddy_system_t * buddy_system; /**< buddy system for the zone */
Index: generic/src/mm/frame.c
===================================================================
--- generic/src/mm/frame.c	(revision 61e6c39dae3807d33e258548805b2804e4239a94)
+++ generic/src/mm/frame.c	(revision eef75f671c5a16e1de01ece7fb216c921e210d41)
@@ -44,4 +44,9 @@
 link_t zone_head;                /**< list of all zones in the system */
 
+/** Blacklist containing non-available areas of memory.
+ *
+ * This blacklist is used to exclude frames that cannot be allocated
+ * (e.g. kernel memory) from available memory map.
+ */
 region_t zone_blacklist[ZONE_BLACKLIST_SIZE];
 count_t zone_blacklist_count = 0;
@@ -123,20 +128,27 @@
 
 	/* Allocate frames from zone buddy system */
-	cur = buddy_system_alloc(zone->buddy_system, order);
-	
-	/* frame will be actually a first frame of the block */
-	frame = list_get_instance(cur, frame_t, buddy_link);
+	tmp = buddy_system_alloc(zone->buddy_system, order);
+	
+	ASSERT(tmp);
+	
+	/* Update zone information. */
+	zone->free_count -= (1 << order);
+	zone->busy_count += (1 << order);
+
+	/* Frame will be actually a first frame of the block. */
+	frame = list_get_instance(tmp, frame_t, buddy_link);
 	
 	/* get frame address */
 	v = FRAME2ADDR(zone, frame);
 
-	if (flags & FRAME_KA)
-		v = PA2KA(v);
-	
 	spinlock_unlock(&zone->lock);
 	spinlock_unlock(&zone_head_lock);
 	interrupts_restore(ipl);
+
+
+	if (flags & FRAME_KA)
+		v = PA2KA(v);
+	
 	return v;
-
 }
 
@@ -191,7 +203,10 @@
 		buddy_system_free(zone->buddy_system, &frame->buddy_link);
 	}
-	
-	spinlock_unlock(&zone->lock);	
-	
+
+	/* Update zone information. */
+	zone->free_count += (1 << frame->buddy_order);
+	zone->busy_count -= (1 << frame->buddy_order);
+	
+	spinlock_unlock(&zone->lock);
 	spinlock_unlock(&zone_head_lock);
 	interrupts_restore(ipl);
@@ -231,5 +246,13 @@
 }
 
-
+/** Create frame zones in region of available memory.
+ *
+ * Avoid any black listed areas of non-available memory.
+ * Assume that the black listed areas cannot overlap
+ * one another or cross available memory region boundaries.
+ *
+ * @param base Base address of available memory region.
+ * @param size Size of the region.
+ */
 void zone_create_in_region(__address base, size_t size) {
 	int i;
@@ -269,5 +292,4 @@
 
 
-
 /** Create frame zone
  *
@@ -374,7 +396,6 @@
  */
 link_t * zone_buddy_find_buddy(buddy_system_t *b, link_t * block) {
-	frame_t * frame, * f;
+	frame_t * frame;
 	zone_t * zone;
-	link_t * cur;
 	count_t index;
 	bool is_left, is_right;
@@ -383,9 +404,4 @@
 	zone = (zone_t *) b->data;
 	
-	/* 
-	 * (FRAME_INDEX % 2^(ORDER+1)) == 0 ===> LEFT BUDDY 
-	 * (FRAME_INDEX % 2^(ORDER+1)) == 2^(ORDER) ===> RIGHT BUDDY
-	 */
-
 	is_left = IS_BUDDY_LEFT_BLOCK(zone, frame);
 	is_right = !is_left;
@@ -407,6 +423,5 @@
 	}
 	
-	return NULL;
-	
+	return NULL;	
 }
 
