Index: kernel/generic/src/mm/as.c
===================================================================
--- kernel/generic/src/mm/as.c	(revision 1cc2974d3a967c0e83ef5bdab192159eff265896)
+++ kernel/generic/src/mm/as.c	(revision 49eec936c4647e75cf41d75bed65ae4318f975a8)
@@ -454,8 +454,6 @@
 					cond = false;	/* we are almost done */
 					i = (start_free - b) >> PAGE_WIDTH;
-					if (!used_space_remove(area, start_free,
-					    c - i))
-						panic("Could not remove used "
-						    "space.\n");
+					if (!used_space_remove(area, start_free, c - i))
+						panic("Could not remove used space.\n");
 				} else {
 					/*
@@ -464,6 +462,5 @@
 					 */
 					if (!used_space_remove(area, b, c))
-						panic("Could not remove used "
-						    "space.\n");
+						panic("Could not remove used space.\n");
 				}
 			
@@ -1529,5 +1526,5 @@
 	}
 
-	panic("Inconsistency detected while adding %d pages of used space at "
+	panic("Inconsistency detected while adding %" PRIc " pages of used space at "
 	    "%p.\n", count, page);
 }
@@ -1708,5 +1705,5 @@
 
 error:
-	panic("Inconsistency detected while removing %d pages of used space "
+	panic("Inconsistency detected while removing %" PRIc " pages of used space "
 	    "from %p.\n", count, page);
 }
@@ -1801,7 +1798,7 @@
 		
 			mutex_lock(&area->lock);
-			printf("as_area: %p, base=%p, pages=%d (%p - %p)\n",
+			printf("as_area: %p, base=%p, pages=%" PRIc " (%p - %p)\n",
 			    area, area->base, area->pages, area->base,
-			    area->base + area->pages*PAGE_SIZE);
+			    area->base + FRAMES2SIZE(area->pages));
 			mutex_unlock(&area->lock);
 		}
Index: kernel/generic/src/mm/buddy.c
===================================================================
--- kernel/generic/src/mm/buddy.c	(revision 1cc2974d3a967c0e83ef5bdab192159eff265896)
+++ kernel/generic/src/mm/buddy.c	(revision 49eec936c4647e75cf41d75bed65ae4318f975a8)
@@ -45,4 +45,5 @@
 #include <debug.h>
 #include <print.h>
+#include <macros.h>
 
 /** Return size needed for the buddy configuration data */
@@ -290,5 +291,5 @@
 	index_t i;
 	count_t cnt, elem_count = 0, block_count = 0;
-	link_t * cur;
+	link_t *cur;
 	
 
@@ -296,5 +297,5 @@
 	printf("-----\t------\t--------\t----------\t---------------\n");
 	
-	for (i=0;i <= b->max_order; i++) {
+	for (i = 0;i <= b->max_order; i++) {
 		cnt = 0;
 		if (!list_empty(&b->order[i])) {
@@ -303,5 +304,6 @@
 		}
 	
-		printf("#%zd\t%5zd\t%7zdK\t%8zdK\t%6zd\t", i, cnt, (cnt * (1 << i) * elem_size) >> 10, ((1 << i) * elem_size) >> 10, 1 << i);
+		printf("#%" PRIi "\t%5" PRIc "\t%7" PRIc "K\t%8" PRIi "K\t%6u\t",
+			i, cnt, SIZE2KB(cnt * (1 << i) * elem_size), SIZE2KB((1 << i) * elem_size), 1 << i);
 		if (!list_empty(&b->order[i])) {
 			for (cur = b->order[i].next; cur != &b->order[i]; cur = cur->next) {
@@ -316,6 +318,5 @@
 	}
 	printf("-----\t------\t--------\t----------\t---------------\n");
-	printf("Buddy system contains %zd free elements (%zd blocks)\n" , elem_count, block_count);
-
+	printf("Buddy system contains %" PRIc " free elements (%" PRIc " blocks)\n" , elem_count, block_count);
 }
 
Index: kernel/generic/src/mm/frame.c
===================================================================
--- kernel/generic/src/mm/frame.c	(revision 1cc2974d3a967c0e83ef5bdab192159eff265896)
+++ kernel/generic/src/mm/frame.c	(revision 49eec936c4647e75cf41d75bed65ae4318f975a8)
@@ -319,5 +319,5 @@
 	zone = (zone_t *) b->data;
 	index = frame_index(zone, frame);
-	printf("%zd", index);
+	printf("%" PRIi, index);
 }				     
 
@@ -845,5 +845,5 @@
 uintptr_t zone_conf_size(count_t count)
 {
-	int size = sizeof(zone_t) + count*sizeof(frame_t);
+	int size = sizeof(zone_t) + count * sizeof(frame_t);
 	int max_order;
 
@@ -1160,23 +1160,28 @@
 	ipl = interrupts_disable();
 	spinlock_lock(&zones.lock);
-	
-	if (sizeof(void *) == 4) {
-		printf("#  base address free frames  busy frames\n");
-		printf("-- ------------ ------------ ------------\n");
-	} else {
-		printf("#  base address         free frames  busy frames\n");
-		printf("-- -------------------- ------------ ------------\n");
-	}
+
+#ifdef __32_BITS__	
+	printf("#  base address free frames  busy frames\n");
+	printf("-- ------------ ------------ ------------\n");
+#endif
+
+#ifdef __64_BITS__
+	printf("#  base address         free frames  busy frames\n");
+	printf("-- -------------------- ------------ ------------\n");
+#endif
 	
 	for (i = 0; i < zones.count; i++) {
 		zone = zones.info[i];
 		spinlock_lock(&zone->lock);
-		
-		if (sizeof(void *) == 4)
-			printf("%-2d   %#10zx %12zd %12zd\n", i, PFN2ADDR(zone->base),
-			    zone->free_count, zone->busy_count);
-		else
-			printf("%-2d   %#18zx %12zd %12zd\n", i, PFN2ADDR(zone->base),
-			    zone->free_count, zone->busy_count);
+
+#ifdef __32_BITS__
+		printf("%-2u   %10p %12" PRIc " %12" PRIc "\n", i, PFN2ADDR(zone->base),
+		    zone->free_count, zone->busy_count);
+#endif
+
+#ifdef __64_BITS__
+		printf("%-2u   %18p %12" PRIc " %12" PRIc "\n", i, PFN2ADDR(zone->base),
+		    zone->free_count, zone->busy_count);
+#endif
 		
 		spinlock_unlock(&zone->lock);
@@ -1212,11 +1217,10 @@
 	spinlock_lock(&zone->lock);
 	printf("Memory zone information\n");
-	printf("Zone base address: %#.*p\n", sizeof(uintptr_t) * 2,
-	    PFN2ADDR(zone->base));
-	printf("Zone size: %zd frames (%zd KB)\n", zone->count,
+	printf("Zone base address: %p\n", PFN2ADDR(zone->base));
+	printf("Zone size: %" PRIc " frames (%" PRIs " KB)\n", zone->count,
 		SIZE2KB(FRAMES2SIZE(zone->count)));
-	printf("Allocated space: %zd frames (%zd KB)\n", zone->busy_count,
+	printf("Allocated space: %" PRIc " frames (%" PRIs " KB)\n", zone->busy_count,
 		SIZE2KB(FRAMES2SIZE(zone->busy_count)));
-	printf("Available space: %zd frames (%zd KB)\n", zone->free_count,
+	printf("Available space: %" PRIc " frames (%" PRIs " KB)\n", zone->free_count,
 		SIZE2KB(FRAMES2SIZE(zone->free_count)));
 	buddy_system_structure_print(zone->buddy_system, FRAME_SIZE);
Index: kernel/generic/src/mm/slab.c
===================================================================
--- kernel/generic/src/mm/slab.c	(revision 1cc2974d3a967c0e83ef5bdab192159eff265896)
+++ kernel/generic/src/mm/slab.c	(revision 49eec936c4647e75cf41d75bed65ae4318f975a8)
@@ -558,5 +558,5 @@
 	ASSERT(_slab_initialized >= 2);
 
-	cache->mag_cache = malloc(sizeof(slab_mag_cache_t)*config.cpu_count,0);
+	cache->mag_cache = malloc(sizeof(slab_mag_cache_t) * config.cpu_count,0);
 	for (i = 0; i < config.cpu_count; i++) {
 		memsetb((uintptr_t)&cache->mag_cache[i],
@@ -814,5 +814,8 @@
 		cache = list_get_instance(cur, slab_cache_t, link);
 		
-		printf("%-16s %8zd %6zd %6zd %6zd %6zd %9zd %-3s\n", cache->name, cache->size, (1 << cache->order), cache->objects, atomic_get(&cache->allocated_slabs), atomic_get(&cache->cached_objs), atomic_get(&cache->allocated_objs), cache->flags & SLAB_CACHE_SLINSIDE ? "in" : "out");
+		printf("%-16s %8" PRIs " %6d %6u %6ld %6ld %9ld %-3s\n",
+			cache->name, cache->size, (1 << cache->order), cache->objects,
+			atomic_get(&cache->allocated_slabs), atomic_get(&cache->cached_objs),
+			atomic_get(&cache->allocated_objs), cache->flags & SLAB_CACHE_SLINSIDE ? "in" : "out");
 	}
 	spinlock_unlock(&slab_cache_lock);
@@ -827,5 +830,5 @@
 	_slab_cache_create(&mag_cache,
 			   "slab_magazine",
-			   sizeof(slab_magazine_t)+SLAB_MAG_SIZE*sizeof(void*),
+			   sizeof(slab_magazine_t) + SLAB_MAG_SIZE * sizeof(void*),
 			   sizeof(uintptr_t),
 			   NULL, NULL,
@@ -845,6 +848,6 @@
 
 	/* Initialize structures for malloc */
-	for (i=0, size=(1<<SLAB_MIN_MALLOC_W);
-	     i < (SLAB_MAX_MALLOC_W-SLAB_MIN_MALLOC_W+1);
+	for (i=0, size=(1 << SLAB_MIN_MALLOC_W);
+	     i < (SLAB_MAX_MALLOC_W - SLAB_MIN_MALLOC_W + 1);
 	     i++, size <<= 1) {
 		malloc_caches[i] = slab_cache_create(malloc_names[i],
