Index: kernel/generic/src/mm/as.c
===================================================================
--- kernel/generic/src/mm/as.c	(revision 44a7ee5373ccc121fce74799244a44867eed301d)
+++ kernel/generic/src/mm/as.c	(revision 63e27efdf2fe6d3fa02bbb5ee1da00df5cc07e9d)
@@ -67,5 +67,5 @@
 #include <arch/asm.h>
 #include <panic.h>
-#include <debug.h>
+#include <assert.h>
 #include <print.h>
 #include <mem.h>
@@ -189,6 +189,6 @@
 	DEADLOCK_PROBE_INIT(p_asidlock);
 	
-	ASSERT(as != AS);
-	ASSERT(atomic_get(&as->refcount) == 0);
+	assert(as != AS);
+	assert(atomic_get(&as->refcount) == 0);
 	
 	/*
@@ -236,5 +236,5 @@
 	bool cond = true;
 	while (cond) {
-		ASSERT(!list_empty(&as->as_area_btree.leaf_list));
+		assert(!list_empty(&as->as_area_btree.leaf_list));
 		
 		btree_node_t *node =
@@ -298,6 +298,6 @@
     size_t count, bool guarded, as_area_t *avoid)
 {
-	ASSERT((addr % PAGE_SIZE) == 0);
-	ASSERT(mutex_locked(&as->lock));
+	assert((addr % PAGE_SIZE) == 0);
+	assert(mutex_locked(&as->lock));
 
 	/*
@@ -455,5 +455,5 @@
     size_t size, bool guarded)
 {
-	ASSERT(mutex_locked(&as->lock));
+	assert(mutex_locked(&as->lock));
 	
 	if (size == 0)
@@ -532,5 +532,5 @@
 	
 	mutex_lock(&sh_info->lock);
-	ASSERT(sh_info->refcount);
+	assert(sh_info->refcount);
 	
 	if (--sh_info->refcount == 0) {
@@ -696,5 +696,5 @@
 NO_TRACE static as_area_t *find_area_and_lock(as_t *as, uintptr_t va)
 {
-	ASSERT(mutex_locked(&as->lock));
+	assert(mutex_locked(&as->lock));
 	
 	btree_node_t *leaf;
@@ -827,5 +827,5 @@
 		bool cond = true;
 		while (cond) {
-			ASSERT(!list_empty(&area->used_space.leaf_list));
+			assert(!list_empty(&area->used_space.leaf_list));
 			
 			btree_node_t *node =
@@ -893,7 +893,7 @@
 					    ptr + P2SZ(i), false, &pte);
 					
-					ASSERT(found);
-					ASSERT(PTE_VALID(&pte));
-					ASSERT(PTE_PRESENT(&pte));
+					assert(found);
+					assert(PTE_VALID(&pte));
+					assert(PTE_PRESENT(&pte));
 					
 					if ((area->backend) &&
@@ -1008,7 +1008,7 @@
 				     ptr + P2SZ(size), false, &pte);
 				
-				ASSERT(found);
-				ASSERT(PTE_VALID(&pte));
-				ASSERT(PTE_PRESENT(&pte));
+				assert(found);
+				assert(PTE_VALID(&pte));
+				assert(PTE_PRESENT(&pte));
 				
 				if ((area->backend) &&
@@ -1194,5 +1194,5 @@
 NO_TRACE bool as_area_check_access(as_area_t *area, pf_access_t access)
 {
-	ASSERT(mutex_locked(&area->lock));
+	assert(mutex_locked(&area->lock));
 	
 	int flagmap[] = {
@@ -1321,7 +1321,7 @@
 				    ptr + P2SZ(size), false, &pte);
 				
-				ASSERT(found);
-				ASSERT(PTE_VALID(&pte));
-				ASSERT(PTE_PRESENT(&pte));
+				assert(found);
+				assert(PTE_VALID(&pte));
+				assert(PTE_PRESENT(&pte));
 				
 				old_frame[frame_idx++] = PTE_GET_FRAME(&pte);
@@ -1541,5 +1541,5 @@
 	 */
 	if (old_as) {
-		ASSERT(old_as->cpu_refcount);
+		assert(old_as->cpu_refcount);
 		
 		if ((--old_as->cpu_refcount == 0) && (old_as != AS_KERNEL)) {
@@ -1550,5 +1550,5 @@
 			 * ASID.
 			 */
-			ASSERT(old_as->asid != ASID_INVALID);
+			assert(old_as->asid != ASID_INVALID);
 			
 			list_append(&old_as->inactive_as_with_asid_link,
@@ -1597,5 +1597,5 @@
 NO_TRACE unsigned int as_area_get_flags(as_area_t *area)
 {
-	ASSERT(mutex_locked(&area->lock));
+	assert(mutex_locked(&area->lock));
 	
 	return area_flags_to_page_flags(area->flags);
@@ -1615,6 +1615,6 @@
 NO_TRACE pte_t *page_table_create(unsigned int flags)
 {
-	ASSERT(as_operations);
-	ASSERT(as_operations->page_table_create);
+	assert(as_operations);
+	assert(as_operations->page_table_create);
 	
 	return as_operations->page_table_create(flags);
@@ -1630,6 +1630,6 @@
 NO_TRACE void page_table_destroy(pte_t *page_table)
 {
-	ASSERT(as_operations);
-	ASSERT(as_operations->page_table_destroy);
+	assert(as_operations);
+	assert(as_operations->page_table_destroy);
 	
 	as_operations->page_table_destroy(page_table);
@@ -1651,6 +1651,6 @@
 NO_TRACE void page_table_lock(as_t *as, bool lock)
 {
-	ASSERT(as_operations);
-	ASSERT(as_operations->page_table_lock);
+	assert(as_operations);
+	assert(as_operations->page_table_lock);
 	
 	as_operations->page_table_lock(as, lock);
@@ -1665,6 +1665,6 @@
 NO_TRACE void page_table_unlock(as_t *as, bool unlock)
 {
-	ASSERT(as_operations);
-	ASSERT(as_operations->page_table_unlock);
+	assert(as_operations);
+	assert(as_operations->page_table_unlock);
 	
 	as_operations->page_table_unlock(as, unlock);
@@ -1680,6 +1680,6 @@
 NO_TRACE bool page_table_locked(as_t *as)
 {
-	ASSERT(as_operations);
-	ASSERT(as_operations->page_table_locked);
+	assert(as_operations);
+	assert(as_operations->page_table_locked);
 
 	return as_operations->page_table_locked(as);
@@ -1724,7 +1724,7 @@
 bool used_space_insert(as_area_t *area, uintptr_t page, size_t count)
 {
-	ASSERT(mutex_locked(&area->lock));
-	ASSERT(IS_ALIGNED(page, PAGE_SIZE));
-	ASSERT(count);
+	assert(mutex_locked(&area->lock));
+	assert(IS_ALIGNED(page, PAGE_SIZE));
+	assert(count);
 	
 	btree_node_t *leaf = NULL;
@@ -1737,5 +1737,5 @@
 	}
 
-	ASSERT(leaf != NULL);
+	assert(leaf != NULL);
 	
 	if (!leaf->keys) {
@@ -2010,7 +2010,7 @@
 bool used_space_remove(as_area_t *area, uintptr_t page, size_t count)
 {
-	ASSERT(mutex_locked(&area->lock));
-	ASSERT(IS_ALIGNED(page, PAGE_SIZE));
-	ASSERT(count);
+	assert(mutex_locked(&area->lock));
+	assert(IS_ALIGNED(page, PAGE_SIZE));
+	assert(count);
 	
 	btree_node_t *leaf;
@@ -2257,5 +2257,5 @@
 			as_area_t *area = node->value[i];
 			
-			ASSERT(area_idx < area_cnt);
+			assert(area_idx < area_cnt);
 			mutex_lock(&area->lock);
 			
