Index: kernel/generic/src/mm/as.c
===================================================================
--- kernel/generic/src/mm/as.c	(revision 7f34182064fa93a69263014cb1b9789bf87da965)
+++ kernel/generic/src/mm/as.c	(revision 301ff30236f92bdd150603d5f6eb622239140696)
@@ -419,6 +419,6 @@
 			if ((cond = (bool) node->keys)) {
 				uintptr_t b = node->key[node->keys - 1];
-				count_t c =
-				    (count_t) node->value[node->keys - 1];
+				size_t c =
+				    (size_t) node->value[node->keys - 1];
 				unsigned int i = 0;
 			
@@ -556,8 +556,8 @@
 		for (i = 0; i < node->keys; i++) {
 			uintptr_t b = node->key[i];
-			count_t j;
+			size_t j;
 			pte_t *pte;
 			
-			for (j = 0; j < (count_t) node->value[i]; j++) {
+			for (j = 0; j < (size_t) node->value[i]; j++) {
 				page_table_lock(as, false);
 				pte = page_mapping_find(as, b + j * PAGE_SIZE);
@@ -789,6 +789,6 @@
 	int page_flags;
 	uintptr_t *old_frame;
-	index_t frame_idx;
-	count_t used_pages;
+	size_t frame_idx;
+	size_t used_pages;
 	
 	/* Flags for the new memory mapping */
@@ -828,5 +828,5 @@
 		node = list_get_instance(cur, btree_node_t, leaf_link);
 		for (i = 0; i < node->keys; i++) {
-			used_pages += (count_t) node->value[i];
+			used_pages += (size_t) node->value[i];
 		}
 	}
@@ -854,8 +854,8 @@
 		for (i = 0; i < node->keys; i++) {
 			uintptr_t b = node->key[i];
-			count_t j;
+			size_t j;
 			pte_t *pte;
 			
-			for (j = 0; j < (count_t) node->value[i]; j++) {
+			for (j = 0; j < (size_t) node->value[i]; j++) {
 				page_table_lock(as, false);
 				pte = page_mapping_find(as, b + j * PAGE_SIZE);
@@ -904,7 +904,7 @@
 		for (i = 0; i < node->keys; i++) {
 			uintptr_t b = node->key[i];
-			count_t j;
+			size_t j;
 			
-			for (j = 0; j < (count_t) node->value[i]; j++) {
+			for (j = 0; j < (size_t) node->value[i]; j++) {
 				page_table_lock(as, false);
 
@@ -1398,8 +1398,8 @@
  * @return		Zero on failure and non-zero on success.
  */
-int used_space_insert(as_area_t *a, uintptr_t page, count_t count)
+int used_space_insert(as_area_t *a, uintptr_t page, size_t count)
 {
 	btree_node_t *leaf, *node;
-	count_t pages;
+	size_t pages;
 	unsigned int i;
 
@@ -1407,5 +1407,5 @@
 	ASSERT(count);
 
-	pages = (count_t) btree_search(&a->used_space, page, &leaf);
+	pages = (size_t) btree_search(&a->used_space, page, &leaf);
 	if (pages) {
 		/*
@@ -1424,6 +1424,6 @@
 		uintptr_t left_pg = node->key[node->keys - 1];
 		uintptr_t right_pg = leaf->key[0];
-		count_t left_cnt = (count_t) node->value[node->keys - 1];
-		count_t right_cnt = (count_t) leaf->value[0];
+		size_t left_cnt = (size_t) node->value[node->keys - 1];
+		size_t right_cnt = (size_t) leaf->value[0];
 		
 		/*
@@ -1479,5 +1479,5 @@
 	} else if (page < leaf->key[0]) {
 		uintptr_t right_pg = leaf->key[0];
-		count_t right_cnt = (count_t) leaf->value[0];
+		size_t right_cnt = (size_t) leaf->value[0];
 	
 		/*
@@ -1514,6 +1514,6 @@
 		uintptr_t left_pg = leaf->key[leaf->keys - 1];
 		uintptr_t right_pg = node->key[0];
-		count_t left_cnt = (count_t) leaf->value[leaf->keys - 1];
-		count_t right_cnt = (count_t) node->value[0];
+		size_t left_cnt = (size_t) leaf->value[leaf->keys - 1];
+		size_t right_cnt = (size_t) node->value[0];
 		
 		/*
@@ -1569,5 +1569,5 @@
 	} else if (page >= leaf->key[leaf->keys - 1]) {
 		uintptr_t left_pg = leaf->key[leaf->keys - 1];
-		count_t left_cnt = (count_t) leaf->value[leaf->keys - 1];
+		size_t left_cnt = (size_t) leaf->value[leaf->keys - 1];
 	
 		/*
@@ -1607,6 +1607,6 @@
 			uintptr_t left_pg = leaf->key[i - 1];
 			uintptr_t right_pg = leaf->key[i];
-			count_t left_cnt = (count_t) leaf->value[i - 1];
-			count_t right_cnt = (count_t) leaf->value[i];
+			size_t left_cnt = (size_t) leaf->value[i - 1];
+			size_t right_cnt = (size_t) leaf->value[i];
 
 			/*
@@ -1666,5 +1666,5 @@
 	}
 
-	panic("Inconsistency detected while adding %" PRIc " pages of used "
+	panic("Inconsistency detected while adding %" PRIs " pages of used "
 	    "space at %p.", count, page);
 }
@@ -1680,8 +1680,8 @@
  * @return		Zero on failure and non-zero on success.
  */
-int used_space_remove(as_area_t *a, uintptr_t page, count_t count)
+int used_space_remove(as_area_t *a, uintptr_t page, size_t count)
 {
 	btree_node_t *leaf, *node;
-	count_t pages;
+	size_t pages;
 	unsigned int i;
 
@@ -1689,5 +1689,5 @@
 	ASSERT(count);
 
-	pages = (count_t) btree_search(&a->used_space, page, &leaf);
+	pages = (size_t) btree_search(&a->used_space, page, &leaf);
 	if (pages) {
 		/*
@@ -1718,5 +1718,5 @@
 	if (node && page < leaf->key[0]) {
 		uintptr_t left_pg = node->key[node->keys - 1];
-		count_t left_cnt = (count_t) node->value[node->keys - 1];
+		size_t left_cnt = (size_t) node->value[node->keys - 1];
 
 		if (overlaps(left_pg, left_cnt * PAGE_SIZE, page,
@@ -1734,5 +1734,5 @@
 			} else if (page + count * PAGE_SIZE <
 			    left_pg + left_cnt*PAGE_SIZE) {
-				count_t new_cnt;
+				size_t new_cnt;
 				
 				/*
@@ -1758,5 +1758,5 @@
 	if (page > leaf->key[leaf->keys - 1]) {
 		uintptr_t left_pg = leaf->key[leaf->keys - 1];
-		count_t left_cnt = (count_t) leaf->value[leaf->keys - 1];
+		size_t left_cnt = (size_t) leaf->value[leaf->keys - 1];
 
 		if (overlaps(left_pg, left_cnt * PAGE_SIZE, page,
@@ -1773,5 +1773,5 @@
 			} else if (page + count * PAGE_SIZE < left_pg +
 			    left_cnt * PAGE_SIZE) {
-				count_t new_cnt;
+				size_t new_cnt;
 				
 				/*
@@ -1800,5 +1800,5 @@
 		if (page < leaf->key[i]) {
 			uintptr_t left_pg = leaf->key[i - 1];
-			count_t left_cnt = (count_t) leaf->value[i - 1];
+			size_t left_cnt = (size_t) leaf->value[i - 1];
 
 			/*
@@ -1820,5 +1820,5 @@
 				} else if (page + count * PAGE_SIZE <
 				    left_pg + left_cnt * PAGE_SIZE) {
-					count_t new_cnt;
+					size_t new_cnt;
 				
 					/*
@@ -1845,5 +1845,5 @@
 
 error:
-	panic("Inconsistency detected while removing %" PRIc " pages of used "
+	panic("Inconsistency detected while removing %" PRIs " pages of used "
 	    "space from %p.", count, page);
 }
@@ -1944,5 +1944,5 @@
 		
 			mutex_lock(&area->lock);
-			printf("as_area: %p, base=%p, pages=%" PRIc
+			printf("as_area: %p, base=%p, pages=%" PRIs
 			    " (%p - %p)\n", area, area->base, area->pages,
 			    area->base, area->base + FRAMES2SIZE(area->pages));
