Index: kernel/generic/src/mm/as.c
===================================================================
--- kernel/generic/src/mm/as.c	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ kernel/generic/src/mm/as.c	(revision a35b458e9db1ca95e679799dc7c1b12c83359ca3)
@@ -114,8 +114,8 @@
 {
 	as_t *as = (as_t *) obj;
-	
+
 	link_initialize(&as->inactive_as_with_asid_link);
 	mutex_initialize(&as->lock, MUTEX_PASSIVE);
-	
+
 	return as_constructor_arch(as, flags);
 }
@@ -130,12 +130,12 @@
 {
 	as_arch_init();
-	
+
 	as_cache = slab_cache_create("as_t", sizeof(as_t), 0,
 	    as_constructor, as_destructor, SLAB_CACHE_MAGDEFERRED);
-	
+
 	AS_KERNEL = as_create(FLAG_AS_KERNEL);
 	if (!AS_KERNEL)
 		panic("Cannot create kernel address space.");
-	
+
 	/*
 	 * Make sure the kernel address space
@@ -155,15 +155,15 @@
 	as_t *as = (as_t *) slab_alloc(as_cache, 0);
 	(void) as_create_arch(as, 0);
-	
+
 	btree_create(&as->as_area_btree);
-	
+
 	if (flags & FLAG_AS_KERNEL)
 		as->asid = ASID_KERNEL;
 	else
 		as->asid = ASID_INVALID;
-	
+
 	atomic_set(&as->refcount, 0);
 	as->cpu_refcount = 0;
-	
+
 #ifdef AS_PAGE_TABLE
 	as->genarch.page_table = page_table_create(flags);
@@ -171,5 +171,5 @@
 	page_table_create(flags);
 #endif
-	
+
 	return as;
 }
@@ -188,13 +188,13 @@
 {
 	DEADLOCK_PROBE_INIT(p_asidlock);
-	
+
 	assert(as != AS);
 	assert(atomic_get(&as->refcount) == 0);
-	
+
 	/*
 	 * Since there is no reference to this address space, it is safe not to
 	 * lock its mutex.
 	 */
-	
+
 	/*
 	 * We need to avoid deadlock between TLB shootdown and asidlock.
@@ -206,5 +206,5 @@
 	preemption_disable();
 	ipl_t ipl = interrupts_read();
-	
+
 retry:
 	interrupts_disable();
@@ -214,19 +214,19 @@
 		goto retry;
 	}
-	
+
 	/* Interrupts disabled, enable preemption */
 	preemption_enable();
-	
+
 	if ((as->asid != ASID_INVALID) && (as != AS_KERNEL)) {
 		if (as->cpu_refcount == 0)
 			list_remove(&as->inactive_as_with_asid_link);
-		
+
 		asid_put(as->asid);
 	}
-	
+
 	spinlock_unlock(&asidlock);
 	interrupts_restore(ipl);
-	
-	
+
+
 	/*
 	 * Destroy address space areas of the address space.
@@ -237,15 +237,15 @@
 	while (cond) {
 		assert(!list_empty(&as->as_area_btree.leaf_list));
-		
+
 		btree_node_t *node =
 		    list_get_instance(list_first(&as->as_area_btree.leaf_list),
 		    btree_node_t, leaf_link);
-		
+
 		if ((cond = node->keys))
 			as_area_destroy(as, node->key[0]);
 	}
-	
+
 	btree_destroy(&as->as_area_btree);
-	
+
 #ifdef AS_PAGE_TABLE
 	page_table_destroy(as->genarch.page_table);
@@ -253,5 +253,5 @@
 	page_table_destroy(NULL);
 #endif
-	
+
 	slab_free(as_cache, as);
 }
@@ -307,5 +307,5 @@
 	if (overflows_into_positive(addr, P2SZ(count)))
 		return false;
-	
+
 	/*
 	 * We don't want any area to have conflicts with NULL page.
@@ -328,5 +328,5 @@
 			return false;
 	}
-	
+
 	/* First, check the two border cases. */
 	btree_node_t *node =
@@ -334,5 +334,5 @@
 	if (node) {
 		area = (as_area_t *) node->value[node->keys - 1];
-		
+
 		if (area != avoid) {
 			mutex_lock(&area->lock);
@@ -346,5 +346,5 @@
 			int const gp = (guarded ||
 			    (area->flags & AS_AREA_GUARD)) ? 1 : 0;
-			
+
 			/*
 			 * The area comes from the left neighbour node, which
@@ -358,13 +358,13 @@
 				return false;
 			}
-			
+
 			mutex_unlock(&area->lock);
 		}
 	}
-	
+
 	node = btree_leaf_node_right_neighbour(&as->as_area_btree, leaf);
 	if (node) {
 		area = (as_area_t *) node->value[0];
-		
+
 		if (area != avoid) {
 			int gp;
@@ -382,5 +382,5 @@
 				gp--;
 			}
-			
+
 			if (overlaps(addr, P2SZ(count + gp), area->base,
 			    P2SZ(area->pages))) {
@@ -388,9 +388,9 @@
 				return false;
 			}
-			
+
 			mutex_unlock(&area->lock);
 		}
 	}
-	
+
 	/* Second, check the leaf node. */
 	btree_key_t i;
@@ -399,8 +399,8 @@
 		int agp;
 		int gp;
-		
+
 		if (area == avoid)
 			continue;
-		
+
 		mutex_lock(&area->lock);
 
@@ -421,8 +421,8 @@
 			return false;
 		}
-		
+
 		mutex_unlock(&area->lock);
 	}
-	
+
 	/*
 	 * So far, the area does not conflict with other areas.
@@ -434,5 +434,5 @@
 		    addr, P2SZ(count));
 	}
-	
+
 	return true;
 }
@@ -456,8 +456,8 @@
 {
 	assert(mutex_locked(&as->lock));
-	
+
 	if (size == 0)
 		return (uintptr_t) -1;
-	
+
 	/*
 	 * Make sure we allocate from page-aligned
@@ -465,12 +465,12 @@
 	 * each step.
 	 */
-	
+
 	size_t pages = SIZE2FRAMES(size);
-	
+
 	/*
 	 * Find the lowest unmapped address aligned on the size
 	 * boundary, not smaller than bound and of the required size.
 	 */
-	
+
 	/* First check the bound address itself */
 	uintptr_t addr = ALIGN_UP(bound, PAGE_SIZE);
@@ -486,13 +486,13 @@
 			return addr;
 	}
-	
+
 	/* Eventually check the addresses behind each area */
 	list_foreach(as->as_area_btree.leaf_list, leaf_link, btree_node_t, node) {
-		
+
 		for (btree_key_t i = 0; i < node->keys; i++) {
 			as_area_t *area = (as_area_t *) node->value[i];
-			
+
 			mutex_lock(&area->lock);
-			
+
 			addr =
 			    ALIGN_UP(area->base + P2SZ(area->pages), PAGE_SIZE);
@@ -508,12 +508,12 @@
 			    ((addr >= bound) && (addr >= area->base) &&
 			    (check_area_conflicts(as, addr, pages, guarded, area)));
-			
+
 			mutex_unlock(&area->lock);
-			
+
 			if (avail)
 				return addr;
 		}
 	}
-	
+
 	/* No suitable address space area found */
 	return (uintptr_t) -1;
@@ -530,11 +530,11 @@
 {
 	bool dealloc = false;
-	
+
 	mutex_lock(&sh_info->lock);
 	assert(sh_info->refcount);
-	
+
 	if (--sh_info->refcount == 0) {
 		dealloc = true;
-		
+
 		/*
 		 * Now walk carefully the pagemap B+tree and free/remove
@@ -544,12 +544,12 @@
 		    btree_node_t, node) {
 			btree_key_t i;
-			
+
 			for (i = 0; i < node->keys; i++)
 				frame_free((uintptr_t) node->value[i], 1);
 		}
-		
+
 	}
 	mutex_unlock(&sh_info->lock);
-	
+
 	if (dealloc) {
 		if (sh_info->backend && sh_info->backend->destroy_shared_data) {
@@ -588,10 +588,10 @@
 	if ((*base != (uintptr_t) AS_AREA_ANY) && !IS_ALIGNED(*base, PAGE_SIZE))
 		return NULL;
-	
+
 	if (size == 0)
 		return NULL;
 
 	size_t pages = SIZE2FRAMES(size);
-	
+
 	/* Writeable executable areas are not supported. */
 	if ((flags & AS_AREA_EXEC) && (flags & AS_AREA_WRITE))
@@ -599,7 +599,7 @@
 
 	bool const guarded = flags & AS_AREA_GUARD;
-	
+
 	mutex_lock(&as->lock);
-	
+
 	if (*base == (uintptr_t) AS_AREA_ANY) {
 		*base = as_get_unmapped_area(as, bound, size, guarded);
@@ -619,9 +619,9 @@
 		return NULL;
 	}
-	
+
 	as_area_t *area = (as_area_t *) malloc(sizeof(as_area_t), 0);
-	
+
 	mutex_initialize(&area->lock, MUTEX_PASSIVE);
-	
+
 	area->as = as;
 	area->flags = flags;
@@ -632,5 +632,5 @@
 	area->backend = backend;
 	area->sh_info = NULL;
-	
+
 	if (backend_data)
 		area->backend_data = *backend_data;
@@ -655,5 +655,5 @@
 
 		area->sh_info = si;
-	
+
 		if (area->backend && area->backend->create_shared_data) {
 			if (!area->backend->create_shared_data(area)) {
@@ -679,7 +679,7 @@
 	btree_insert(&as->as_area_btree, *base, (void *) area,
 	    NULL);
-	
+
 	mutex_unlock(&as->lock);
-	
+
 	return area;
 }
@@ -697,5 +697,5 @@
 {
 	assert(mutex_locked(&as->lock));
-	
+
 	btree_node_t *leaf;
 	as_area_t *area = (as_area_t *) btree_search(&as->as_area_btree, va,
@@ -706,5 +706,5 @@
 		return area;
 	}
-	
+
 	/*
 	 * Search the leaf node and the rightmost record of its left neighbour
@@ -712,11 +712,11 @@
 	 * space area found there.
 	 */
-	
+
 	/* First, search the leaf node itself. */
 	btree_key_t i;
-	
+
 	for (i = 0; i < leaf->keys; i++) {
 		area = (as_area_t *) leaf->value[i];
-		
+
 		mutex_lock(&area->lock);
 
@@ -724,8 +724,8 @@
 		    (va <= area->base + (P2SZ(area->pages) - 1)))
 			return area;
-		
+
 		mutex_unlock(&area->lock);
 	}
-	
+
 	/*
 	 * Second, locate the left neighbour and test its last record.
@@ -736,13 +736,13 @@
 	if (lnode) {
 		area = (as_area_t *) lnode->value[lnode->keys - 1];
-		
+
 		mutex_lock(&area->lock);
-		
+
 		if (va <= area->base + (P2SZ(area->pages) - 1))
 			return area;
-		
+
 		mutex_unlock(&area->lock);
 	}
-	
+
 	return NULL;
 }
@@ -766,5 +766,5 @@
 
 	mutex_lock(&as->lock);
-	
+
 	/*
 	 * Locate the area.
@@ -784,5 +784,5 @@
 		return ENOTSUP;
 	}
-	
+
 	mutex_lock(&area->sh_info->lock);
 	if (area->sh_info->shared) {
@@ -797,5 +797,5 @@
 	}
 	mutex_unlock(&area->sh_info->lock);
-	
+
 	size_t pages = SIZE2FRAMES((address - area->base) + size);
 	if (!pages) {
@@ -807,15 +807,15 @@
 		return EPERM;
 	}
-	
+
 	if (pages < area->pages) {
 		uintptr_t start_free = area->base + P2SZ(pages);
-		
+
 		/*
 		 * Shrinking the area.
 		 * No need to check for overlaps.
 		 */
-		
+
 		page_table_lock(as, false);
-		
+
 		/*
 		 * Remove frames belonging to used space starting from
@@ -828,9 +828,9 @@
 		while (cond) {
 			assert(!list_empty(&area->used_space.leaf_list));
-			
+
 			btree_node_t *node =
 			    list_get_instance(list_last(&area->used_space.leaf_list),
 			    btree_node_t, leaf_link);
-			
+
 			if ((cond = (node->keys != 0))) {
 				uintptr_t ptr = node->key[node->keys - 1];
@@ -838,8 +838,8 @@
 				    (size_t) node->value[node->keys - 1];
 				size_t i = 0;
-				
+
 				if (overlaps(ptr, P2SZ(node_size), area->base,
 				    P2SZ(pages))) {
-					
+
 					if (ptr + P2SZ(node_size) <= start_free) {
 						/*
@@ -850,5 +850,5 @@
 						break;
 					}
-					
+
 					/*
 					 * Part of the interval corresponding
@@ -856,5 +856,5 @@
 					 * address space area.
 					 */
-					
+
 					/* We are almost done */
 					cond = false;
@@ -871,5 +871,5 @@
 						panic("Cannot remove used space.");
 				}
-				
+
 				/*
 				 * Start TLB shootdown sequence.
@@ -887,14 +887,14 @@
 				    as->asid, area->base + P2SZ(pages),
 				    area->pages - pages);
-		
+
 				for (; i < node_size; i++) {
 					pte_t pte;
 					bool found = page_mapping_find(as,
 					    ptr + P2SZ(i), false, &pte);
-					
+
 					assert(found);
 					assert(PTE_VALID(&pte));
 					assert(PTE_PRESENT(&pte));
-					
+
 					if ((area->backend) &&
 					    (area->backend->frame_free)) {
@@ -903,16 +903,16 @@
 						    PTE_GET_FRAME(&pte));
 					}
-					
+
 					page_mapping_remove(as, ptr + P2SZ(i));
 				}
-		
+
 				/*
 				 * Finish TLB shootdown sequence.
 				 */
-		
+
 				tlb_invalidate_pages(as->asid,
 				    area->base + P2SZ(pages),
 				    area->pages - pages);
-		
+
 				/*
 				 * Invalidate software translation caches
@@ -944,5 +944,5 @@
 		}
 	}
-	
+
 	if (area->backend && area->backend->resize) {
 		if (!area->backend->resize(area, pages)) {
@@ -952,10 +952,10 @@
 		}
 	}
-	
+
 	area->pages = pages;
-	
+
 	mutex_unlock(&area->lock);
 	mutex_unlock(&as->lock);
-	
+
 	return 0;
 }
@@ -972,5 +972,5 @@
 {
 	mutex_lock(&as->lock);
-	
+
 	as_area_t *area = find_area_and_lock(as, address);
 	if (!area) {
@@ -981,9 +981,9 @@
 	if (area->backend && area->backend->destroy)
 		area->backend->destroy(area);
-	
+
 	uintptr_t base = area->base;
-	
+
 	page_table_lock(as, false);
-	
+
 	/*
 	 * Start TLB shootdown sequence.
@@ -991,5 +991,5 @@
 	ipl_t ipl = tlb_shootdown_start(TLB_INVL_PAGES, as->asid, area->base,
 	    area->pages);
-	
+
 	/*
 	 * Visit only the pages mapped by used_space B+tree.
@@ -998,18 +998,18 @@
 	    node) {
 		btree_key_t i;
-		
+
 		for (i = 0; i < node->keys; i++) {
 			uintptr_t ptr = node->key[i];
 			size_t size;
-			
+
 			for (size = 0; size < (size_t) node->value[i]; size++) {
 				pte_t pte;
 				bool found = page_mapping_find(as,
 				     ptr + P2SZ(size), false, &pte);
-				
+
 				assert(found);
 				assert(PTE_VALID(&pte));
 				assert(PTE_PRESENT(&pte));
-				
+
 				if ((area->backend) &&
 				    (area->backend->frame_free)) {
@@ -1018,16 +1018,16 @@
 					    PTE_GET_FRAME(&pte));
 				}
-				
+
 				page_mapping_remove(as, ptr + P2SZ(size));
 			}
 		}
 	}
-	
+
 	/*
 	 * Finish TLB shootdown sequence.
 	 */
-	
+
 	tlb_invalidate_pages(as->asid, area->base, area->pages);
-	
+
 	/*
 	 * Invalidate potential software translation caches
@@ -1036,22 +1036,22 @@
 	as_invalidate_translation_cache(as, area->base, area->pages);
 	tlb_shootdown_finalize(ipl);
-	
+
 	page_table_unlock(as, false);
-	
+
 	btree_destroy(&area->used_space);
-	
+
 	area->attributes |= AS_AREA_ATTR_PARTIAL;
-	
+
 	sh_info_remove_reference(area->sh_info);
-	
+
 	mutex_unlock(&area->lock);
-	
+
 	/*
 	 * Remove the empty area from address space.
 	 */
 	btree_remove(&as->as_area_btree, base, NULL);
-	
+
 	free(area);
-	
+
 	mutex_unlock(&as->lock);
 	return 0;
@@ -1098,5 +1098,5 @@
 		return ENOENT;
 	}
-	
+
 	if (!src_area->backend->is_shareable(src_area)) {
 		/*
@@ -1107,14 +1107,14 @@
 		return ENOTSUP;
 	}
-	
+
 	size_t src_size = P2SZ(src_area->pages);
 	unsigned int src_flags = src_area->flags;
 	mem_backend_t *src_backend = src_area->backend;
 	mem_backend_data_t src_backend_data = src_area->backend_data;
-	
+
 	/* Share the cacheable flag from the original mapping */
 	if (src_flags & AS_AREA_CACHEABLE)
 		dst_flags_mask |= AS_AREA_CACHEABLE;
-	
+
 	if ((src_size != acc_size) ||
 	    ((src_flags & dst_flags_mask) != dst_flags_mask)) {
@@ -1123,5 +1123,5 @@
 		return EPERM;
 	}
-	
+
 	/*
 	 * Now we are committed to sharing the area.
@@ -1130,5 +1130,5 @@
 	 */
 	share_info_t *sh_info = src_area->sh_info;
-	
+
 	mutex_lock(&sh_info->lock);
 	sh_info->refcount++;
@@ -1144,8 +1144,8 @@
 		src_area->backend->share(src_area);
 	}
-	
+
 	mutex_unlock(&src_area->lock);
 	mutex_unlock(&src_as->lock);
-	
+
 	/*
 	 * Create copy of the source address space area.
@@ -1164,8 +1164,8 @@
 		 */
 		sh_info_remove_reference(sh_info);
-		
+
 		return ENOMEM;
 	}
-	
+
 	/*
 	 * Now the destination address space area has been
@@ -1179,5 +1179,5 @@
 	mutex_unlock(&dst_area->lock);
 	mutex_unlock(&dst_as->lock);
-	
+
 	return 0;
 }
@@ -1195,5 +1195,5 @@
 {
 	assert(mutex_locked(&area->lock));
-	
+
 	int flagmap[] = {
 		[PF_ACCESS_READ] = AS_AREA_READ,
@@ -1201,8 +1201,8 @@
 		[PF_ACCESS_EXEC] = AS_AREA_EXEC
 	};
-	
+
 	if (!(area->flags & flagmap[access]))
 		return false;
-	
+
 	return true;
 }
@@ -1218,17 +1218,17 @@
 {
 	unsigned int flags = PAGE_USER | PAGE_PRESENT;
-	
+
 	if (aflags & AS_AREA_READ)
 		flags |= PAGE_READ;
-		
+
 	if (aflags & AS_AREA_WRITE)
 		flags |= PAGE_WRITE;
-	
+
 	if (aflags & AS_AREA_EXEC)
 		flags |= PAGE_EXEC;
-	
+
 	if (aflags & AS_AREA_CACHEABLE)
 		flags |= PAGE_CACHEABLE;
-	
+
 	return flags;
 }
@@ -1252,7 +1252,7 @@
 	/* Flags for the new memory mapping */
 	unsigned int page_flags = area_flags_to_page_flags(flags);
-	
+
 	mutex_lock(&as->lock);
-	
+
 	as_area_t *area = find_area_and_lock(as, address);
 	if (!area) {
@@ -1260,5 +1260,5 @@
 		return ENOENT;
 	}
-	
+
 	if (area->backend != &anon_backend) {
 		/* Copying non-anonymous memory not supported yet */
@@ -1277,23 +1277,23 @@
 	}
 	mutex_unlock(&area->sh_info->lock);
-	
+
 	/*
 	 * Compute total number of used pages in the used_space B+tree
 	 */
 	size_t used_pages = 0;
-	
+
 	list_foreach(area->used_space.leaf_list, leaf_link, btree_node_t,
 	    node) {
 		btree_key_t i;
-		
+
 		for (i = 0; i < node->keys; i++)
 			used_pages += (size_t) node->value[i];
 	}
-	
+
 	/* An array for storing frame numbers */
 	uintptr_t *old_frame = malloc(used_pages * sizeof(uintptr_t), 0);
-	
+
 	page_table_lock(as, false);
-	
+
 	/*
 	 * Start TLB shootdown sequence.
@@ -1301,5 +1301,5 @@
 	ipl_t ipl = tlb_shootdown_start(TLB_INVL_PAGES, as->asid, area->base,
 	    area->pages);
-	
+
 	/*
 	 * Remove used pages from page tables and remember their frame
@@ -1307,24 +1307,24 @@
 	 */
 	size_t frame_idx = 0;
-	
+
 	list_foreach(area->used_space.leaf_list, leaf_link, btree_node_t,
 	    node) {
 		btree_key_t i;
-		
+
 		for (i = 0; i < node->keys; i++) {
 			uintptr_t ptr = node->key[i];
 			size_t size;
-			
+
 			for (size = 0; size < (size_t) node->value[i]; size++) {
 				pte_t pte;
 				bool found = page_mapping_find(as,
 				    ptr + P2SZ(size), false, &pte);
-				
+
 				assert(found);
 				assert(PTE_VALID(&pte));
 				assert(PTE_PRESENT(&pte));
-				
+
 				old_frame[frame_idx++] = PTE_GET_FRAME(&pte);
-				
+
 				/* Remove old mapping */
 				page_mapping_remove(as, ptr + P2SZ(size));
@@ -1332,11 +1332,11 @@
 		}
 	}
-	
+
 	/*
 	 * Finish TLB shootdown sequence.
 	 */
-	
+
 	tlb_invalidate_pages(as->asid, area->base, area->pages);
-	
+
 	/*
 	 * Invalidate potential software translation caches
@@ -1345,12 +1345,12 @@
 	as_invalidate_translation_cache(as, area->base, area->pages);
 	tlb_shootdown_finalize(ipl);
-	
+
 	page_table_unlock(as, false);
-	
+
 	/*
 	 * Set the new flags.
 	 */
 	area->flags = flags;
-	
+
 	/*
 	 * Map pages back in with new flags. This step is kept separate
@@ -1359,30 +1359,30 @@
 	 */
 	frame_idx = 0;
-	
+
 	list_foreach(area->used_space.leaf_list, leaf_link, btree_node_t,
 	    node) {
 		btree_key_t i;
-		
+
 		for (i = 0; i < node->keys; i++) {
 			uintptr_t ptr = node->key[i];
 			size_t size;
-			
+
 			for (size = 0; size < (size_t) node->value[i]; size++) {
 				page_table_lock(as, false);
-				
+
 				/* Insert the new mapping */
 				page_mapping_insert(as, ptr + P2SZ(size),
 				    old_frame[frame_idx++], page_flags);
-				
+
 				page_table_unlock(as, false);
 			}
 		}
 	}
-	
+
 	free(old_frame);
-	
+
 	mutex_unlock(&area->lock);
 	mutex_unlock(&as->lock);
-	
+
 	return 0;
 }
@@ -1414,8 +1414,8 @@
 	if (!THREAD)
 		goto page_fault;
-	
+
 	if (!AS)
 		goto page_fault;
-	
+
 	mutex_lock(&AS->lock);
 	as_area_t *area = find_area_and_lock(AS, page);
@@ -1428,5 +1428,5 @@
 		goto page_fault;
 	}
-	
+
 	if (area->attributes & AS_AREA_ATTR_PARTIAL) {
 		/*
@@ -1438,5 +1438,5 @@
 		goto page_fault;
 	}
-	
+
 	if ((!area->backend) || (!area->backend->page_fault)) {
 		/*
@@ -1448,7 +1448,7 @@
 		goto page_fault;
 	}
-	
+
 	page_table_lock(AS, false);
-	
+
 	/*
 	 * To avoid race condition between two page faults on the same address,
@@ -1467,5 +1467,5 @@
 		}
 	}
-	
+
 	/*
 	 * Resort to the backend page fault handler.
@@ -1478,10 +1478,10 @@
 		goto page_fault;
 	}
-	
+
 	page_table_unlock(AS, false);
 	mutex_unlock(&area->lock);
 	mutex_unlock(&AS->lock);
 	return AS_PF_OK;
-	
+
 page_fault:
 	if (THREAD->in_copy_from_uspace) {
@@ -1501,5 +1501,5 @@
 		panic_memtrap(istate, access, address, NULL);
 	}
-	
+
 	return AS_PF_DEFER;
 }
@@ -1521,5 +1521,5 @@
 	DEADLOCK_PROBE_INIT(p_asidlock);
 	preemption_disable();
-	
+
 retry:
 	(void) interrupts_disable();
@@ -1536,5 +1536,5 @@
 	}
 	preemption_enable();
-	
+
 	/*
 	 * First, take care of the old address space.
@@ -1542,5 +1542,5 @@
 	if (old_as) {
 		assert(old_as->cpu_refcount);
-		
+
 		if ((--old_as->cpu_refcount == 0) && (old_as != AS_KERNEL)) {
 			/*
@@ -1551,9 +1551,9 @@
 			 */
 			assert(old_as->asid != ASID_INVALID);
-			
+
 			list_append(&old_as->inactive_as_with_asid_link,
 			    &inactive_as_with_asid_list);
 		}
-		
+
 		/*
 		 * Perform architecture-specific tasks when the address space
@@ -1562,5 +1562,5 @@
 		as_deinstall_arch(old_as);
 	}
-	
+
 	/*
 	 * Second, prepare the new address space.
@@ -1572,9 +1572,9 @@
 			new_as->asid = asid_get();
 	}
-	
+
 #ifdef AS_PAGE_TABLE
 	SET_PTL0_ADDRESS(new_as->genarch.page_table);
 #endif
-	
+
 	/*
 	 * Perform architecture-specific steps.
@@ -1582,7 +1582,7 @@
 	 */
 	as_install_arch(new_as);
-	
+
 	spinlock_unlock(&asidlock);
-	
+
 	AS = new_as;
 }
@@ -1598,5 +1598,5 @@
 {
 	assert(mutex_locked(&area->lock));
-	
+
 	return area_flags_to_page_flags(area->flags);
 }
@@ -1617,5 +1617,5 @@
 	assert(as_operations);
 	assert(as_operations->page_table_create);
-	
+
 	return as_operations->page_table_create(flags);
 }
@@ -1632,5 +1632,5 @@
 	assert(as_operations);
 	assert(as_operations->page_table_destroy);
-	
+
 	as_operations->page_table_destroy(page_table);
 }
@@ -1653,5 +1653,5 @@
 	assert(as_operations);
 	assert(as_operations->page_table_lock);
-	
+
 	as_operations->page_table_lock(as, lock);
 }
@@ -1667,5 +1667,5 @@
 	assert(as_operations);
 	assert(as_operations->page_table_unlock);
-	
+
 	as_operations->page_table_unlock(as, unlock);
 }
@@ -1697,8 +1697,8 @@
 {
 	size_t size;
-	
+
 	page_table_lock(AS, true);
 	as_area_t *src_area = find_area_and_lock(AS, base);
-	
+
 	if (src_area) {
 		size = P2SZ(src_area->pages);
@@ -1706,5 +1706,5 @@
 	} else
 		size = 0;
-	
+
 	page_table_unlock(AS, true);
 	return size;
@@ -1727,5 +1727,5 @@
 	assert(IS_ALIGNED(page, PAGE_SIZE));
 	assert(count);
-	
+
 	btree_node_t *leaf = NULL;
 	size_t pages = (size_t) btree_search(&area->used_space, page, &leaf);
@@ -1738,10 +1738,10 @@
 
 	assert(leaf != NULL);
-	
+
 	if (!leaf->keys) {
 		btree_insert(&area->used_space, page, (void *) count, leaf);
 		goto success;
 	}
-	
+
 	btree_node_t *node = btree_leaf_node_left_neighbour(&area->used_space, leaf);
 	if (node) {
@@ -1750,5 +1750,5 @@
 		size_t left_cnt = (size_t) node->value[node->keys - 1];
 		size_t right_cnt = (size_t) leaf->value[0];
-		
+
 		/*
 		 * Examine the possibility that the interval fits
@@ -1756,5 +1756,5 @@
 		 * the left neigbour and the first interval of the leaf.
 		 */
-		
+
 		if (page >= right_pg) {
 			/* Do nothing. */
@@ -1804,10 +1804,10 @@
 		uintptr_t right_pg = leaf->key[0];
 		size_t right_cnt = (size_t) leaf->value[0];
-		
+
 		/*
 		 * Investigate the border case in which the left neighbour does
 		 * not exist but the interval fits from the left.
 		 */
-		
+
 		if (overlaps(page, P2SZ(count), right_pg, P2SZ(right_cnt))) {
 			/* The interval intersects with the right interval. */
@@ -1832,5 +1832,5 @@
 		}
 	}
-	
+
 	node = btree_leaf_node_right_neighbour(&area->used_space, leaf);
 	if (node) {
@@ -1839,5 +1839,5 @@
 		size_t left_cnt = (size_t) leaf->value[leaf->keys - 1];
 		size_t right_cnt = (size_t) node->value[0];
-		
+
 		/*
 		 * Examine the possibility that the interval fits
@@ -1845,5 +1845,5 @@
 		 * the right neigbour and the last interval of the leaf.
 		 */
-		
+
 		if (page < left_pg) {
 			/* Do nothing. */
@@ -1893,10 +1893,10 @@
 		uintptr_t left_pg = leaf->key[leaf->keys - 1];
 		size_t left_cnt = (size_t) leaf->value[leaf->keys - 1];
-		
+
 		/*
 		 * Investigate the border case in which the right neighbour
 		 * does not exist but the interval fits from the right.
 		 */
-		
+
 		if (overlaps(page, P2SZ(count), left_pg, P2SZ(left_cnt))) {
 			/* The interval intersects with the left interval. */
@@ -1919,5 +1919,5 @@
 		}
 	}
-	
+
 	/*
 	 * Note that if the algorithm made it thus far, the interval can fit
@@ -1932,9 +1932,9 @@
 			size_t left_cnt = (size_t) leaf->value[i - 1];
 			size_t right_cnt = (size_t) leaf->value[i];
-			
+
 			/*
 			 * The interval fits between left_pg and right_pg.
 			 */
-			
+
 			if (overlaps(page, P2SZ(count), left_pg,
 			    P2SZ(left_cnt))) {
@@ -1988,8 +1988,8 @@
 		}
 	}
-	
+
 	panic("Inconsistency detected while adding %zu pages of used "
 	    "space at %p.", count, (void *) page);
-	
+
 success:
 	area->resident += count;
@@ -2013,5 +2013,5 @@
 	assert(IS_ALIGNED(page, PAGE_SIZE));
 	assert(count);
-	
+
 	btree_node_t *leaf;
 	size_t pages = (size_t) btree_search(&area->used_space, page, &leaf);
@@ -2038,9 +2038,9 @@
 				}
 			}
-			
+
 			goto error;
 		}
 	}
-	
+
 	btree_node_t *node = btree_leaf_node_left_neighbour(&area->used_space,
 	    leaf);
@@ -2048,5 +2048,5 @@
 		uintptr_t left_pg = node->key[node->keys - 1];
 		size_t left_cnt = (size_t) node->value[node->keys - 1];
-		
+
 		if (overlaps(left_pg, P2SZ(left_cnt), page, P2SZ(count))) {
 			if (page + P2SZ(count) == left_pg + P2SZ(left_cnt)) {
@@ -2078,13 +2078,13 @@
 			}
 		}
-		
+
 		return false;
 	} else if (page < leaf->key[0])
 		return false;
-	
+
 	if (page > leaf->key[leaf->keys - 1]) {
 		uintptr_t left_pg = leaf->key[leaf->keys - 1];
 		size_t left_cnt = (size_t) leaf->value[leaf->keys - 1];
-		
+
 		if (overlaps(left_pg, P2SZ(left_cnt), page, P2SZ(count))) {
 			if (page + P2SZ(count) == left_pg + P2SZ(left_cnt)) {
@@ -2115,8 +2115,8 @@
 			}
 		}
-		
+
 		return false;
 	}
-	
+
 	/*
 	 * The border cases have been already resolved.
@@ -2128,5 +2128,5 @@
 			uintptr_t left_pg = leaf->key[i - 1];
 			size_t left_cnt = (size_t) leaf->value[i - 1];
-			
+
 			/*
 			 * Now the interval is between intervals corresponding
@@ -2166,13 +2166,13 @@
 				}
 			}
-			
+
 			return false;
 		}
 	}
-	
+
 error:
 	panic("Inconsistency detected while removing %zu pages of used "
 	    "space from %p.", count, (void *) page);
-	
+
 success:
 	area->resident -= count;
@@ -2204,5 +2204,5 @@
 	if (area == NULL)
 		return (sysarg_t) AS_MAP_FAILED;
-	
+
 	return (sysarg_t) virt;
 }
@@ -2233,42 +2233,42 @@
 {
 	mutex_lock(&as->lock);
-	
+
 	/* First pass, count number of areas. */
-	
+
 	size_t area_cnt = 0;
-	
+
 	list_foreach(as->as_area_btree.leaf_list, leaf_link, btree_node_t,
 	    node) {
 		area_cnt += node->keys;
 	}
-	
+
 	size_t isize = area_cnt * sizeof(as_area_info_t);
 	as_area_info_t *info = malloc(isize, 0);
-	
+
 	/* Second pass, record data. */
-	
+
 	size_t area_idx = 0;
-	
+
 	list_foreach(as->as_area_btree.leaf_list, leaf_link, btree_node_t,
 	    node) {
 		btree_key_t i;
-		
+
 		for (i = 0; i < node->keys; i++) {
 			as_area_t *area = node->value[i];
-			
+
 			assert(area_idx < area_cnt);
 			mutex_lock(&area->lock);
-			
+
 			info[area_idx].start_addr = area->base;
 			info[area_idx].size = P2SZ(area->pages);
 			info[area_idx].flags = area->flags;
 			++area_idx;
-			
+
 			mutex_unlock(&area->lock);
 		}
 	}
-	
+
 	mutex_unlock(&as->lock);
-	
+
 	*obuf = info;
 	*osize = isize;
@@ -2283,13 +2283,13 @@
 {
 	mutex_lock(&as->lock);
-	
+
 	/* Print out info about address space areas */
 	list_foreach(as->as_area_btree.leaf_list, leaf_link, btree_node_t,
 	    node) {
 		btree_key_t i;
-		
+
 		for (i = 0; i < node->keys; i++) {
 			as_area_t *area = node->value[i];
-			
+
 			mutex_lock(&area->lock);
 			printf("as_area: %p, base=%p, pages=%zu"
@@ -2300,5 +2300,5 @@
 		}
 	}
-	
+
 	mutex_unlock(&as->lock);
 }
Index: kernel/generic/src/mm/backend_anon.c
===================================================================
--- kernel/generic/src/mm/backend_anon.c	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ kernel/generic/src/mm/backend_anon.c	(revision a35b458e9db1ca95e679799dc7c1b12c83359ca3)
@@ -125,14 +125,14 @@
 	    node) {
 		unsigned int i;
-		
+
 		for (i = 0; i < node->keys; i++) {
 			uintptr_t base = node->key[i];
 			size_t count = (size_t) node->value[i];
 			unsigned int j;
-			
+
 			for (j = 0; j < count; j++) {
 				pte_t pte;
 				bool found;
-			
+
 				page_table_lock(area->as, false);
 				found = page_mapping_find(area->as,
@@ -201,5 +201,5 @@
 	if (area->sh_info->shared) {
 		btree_node_t *leaf;
-		
+
 		/*
 		 * The area is shared, chances are that the mapping can be found
@@ -214,5 +214,5 @@
 			bool allocate = true;
 			unsigned int i;
-			
+
 			/*
 			 * Zero can be returned as a valid frame address.
@@ -230,5 +230,5 @@
 				memsetb((void *) kpage, PAGE_SIZE, 0);
 				km_temporary_page_put(kpage);
-				
+
 				/*
 				 * Insert the address of the newly allocated
@@ -272,5 +272,5 @@
 	}
 	mutex_unlock(&area->sh_info->lock);
-	
+
 	/*
 	 * Map 'upage' to 'frame'.
@@ -281,5 +281,5 @@
 	if (!used_space_insert(area, upage, 1))
 		panic("Cannot insert used space.");
-		
+
 	return AS_PF_OK;
 }
Index: kernel/generic/src/mm/backend_elf.c
===================================================================
--- kernel/generic/src/mm/backend_elf.c	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ kernel/generic/src/mm/backend_elf.c	(revision a35b458e9db1ca95e679799dc7c1b12c83359ca3)
@@ -102,5 +102,5 @@
 	if (area->pages <= nonanon_pages)
 		return true;
-	
+
 	return reserve_try_alloc(area->pages - nonanon_pages);
 }
@@ -123,5 +123,5 @@
 			reserve_free(nonanon_pages - new_pages);
 	}
-	
+
 	return true;
 }
@@ -166,12 +166,12 @@
 	    cur = cur->next) {
 		unsigned int i;
-		
+
 		node = list_get_instance(cur, btree_node_t, leaf_link);
-		
+
 		for (i = 0; i < node->keys; i++) {
 			uintptr_t base = node->key[i];
 			size_t count = (size_t) node->value[i];
 			unsigned int j;
-			
+
 			/*
 			 * Skip read-only areas of used space that are backed
@@ -182,9 +182,9 @@
 				    base + P2SZ(count) <= start_anon)
 					continue;
-			
+
 			for (j = 0; j < count; j++) {
 				pte_t pte;
 				bool found;
-			
+
 				/*
 				 * Skip read-only pages that are backed by the
@@ -195,5 +195,5 @@
 					    base + P2SZ(j + 1) <= start_anon)
 						continue;
-				
+
 				page_table_lock(area->as, false);
 				found = page_mapping_find(area->as,
@@ -212,5 +212,5 @@
 				frame_reference_add(pfn);
 			}
-				
+
 		}
 	}
@@ -267,11 +267,11 @@
 	if (!as_area_check_access(area, access))
 		return AS_PF_FAULT;
-	
+
 	if (upage < ALIGN_DOWN(entry->p_vaddr, PAGE_SIZE))
 		return AS_PF_FAULT;
-	
+
 	if (upage >= entry->p_vaddr + entry->p_memsz)
 		return AS_PF_FAULT;
-	
+
 	i = (upage - ALIGN_DOWN(entry->p_vaddr, PAGE_SIZE)) >> PAGE_WIDTH;
 	base = (uintptr_t)
@@ -288,5 +288,5 @@
 		 * The address space area is shared.
 		 */
-		
+
 		frame = (uintptr_t) btree_search(&area->sh_info->pagemap,
 		    upage - area->base, &leaf);
Index: kernel/generic/src/mm/backend_phys.c
===================================================================
--- kernel/generic/src/mm/backend_phys.c	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ kernel/generic/src/mm/backend_phys.c	(revision a35b458e9db1ca95e679799dc7c1b12c83359ca3)
@@ -75,5 +75,5 @@
 	.page_fault = phys_page_fault,
 	.frame_free = NULL,
-	
+
 	.create_shared_data = phys_create_shared_data,
 	.destroy_shared_data = phys_destroy_shared_data
@@ -145,5 +145,5 @@
 	page_mapping_insert(AS, upage, base + (upage - area->base),
 	    as_area_get_flags(area));
-	
+
 	if (!used_space_insert(area, upage, 1))
 		panic("Cannot insert used space.");
Index: kernel/generic/src/mm/backend_user.c
===================================================================
--- kernel/generic/src/mm/backend_user.c	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ kernel/generic/src/mm/backend_user.c	(revision a35b458e9db1ca95e679799dc7c1b12c83359ca3)
@@ -172,5 +172,5 @@
 		/* Nothing to do */
 	}
-		
+
 }
 
Index: kernel/generic/src/mm/frame.c
===================================================================
--- kernel/generic/src/mm/frame.c	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ kernel/generic/src/mm/frame.c	(revision a35b458e9db1ca95e679799dc7c1b12c83359ca3)
@@ -108,5 +108,5 @@
 		return (size_t) -1;
 	}
-	
+
 	size_t i;
 	for (i = 0; i < zones.count; i++) {
@@ -114,5 +114,5 @@
 		if (overlaps(zones.info[i].base, zones.info[i].count,
 		    base, count)) {
-			
+
 			/*
 			 * If the overlaping zones are of the same type
@@ -121,5 +121,5 @@
 			 *
 			 */
-			
+
 			if ((zones.info[i].flags != flags) ||
 			    (!iswithin(zones.info[i].base, zones.info[i].count,
@@ -132,5 +132,5 @@
 				    (void *) PFN2ADDR(zones.info[i].count));
 			}
-			
+
 			return (size_t) -1;
 		}
@@ -138,11 +138,11 @@
 			break;
 	}
-	
+
 	/* Move other zones up */
 	for (size_t j = zones.count; j > i; j--)
 		zones.info[j] = zones.info[j - 1];
-	
+
 	zones.count++;
-	
+
 	return i;
 }
@@ -163,5 +163,5 @@
 	for (i = 0; i < zones.count; i++)
 		total += zones.info[i].free_count;
-	
+
 	return total;
 }
@@ -195,5 +195,5 @@
 	if (hint >= zones.count)
 		hint = 0;
-	
+
 	size_t i = hint;
 	do {
@@ -201,11 +201,11 @@
 		    && (zones.info[i].base + zones.info[i].count >= frame + count))
 			return i;
-		
+
 		i++;
 		if (i >= zones.count)
 			i = 0;
-		
+
 	} while (i != hint);
-	
+
 	return (size_t) -1;
 }
@@ -219,5 +219,5 @@
 	 * the bitmap if the last argument is NULL.
 	 */
-	
+
 	return ((zone->flags & ZONE_AVAILABLE) &&
 	    bitmap_allocate_range(&zone->bitmap, count, zone->base,
@@ -245,14 +245,14 @@
 	for (size_t pos = 0; pos < zones.count; pos++) {
 		size_t i = (pos + hint) % zones.count;
-		
+
 		/* Check whether the zone meets the search criteria. */
 		if (!ZONE_FLAGS_MATCH(zones.info[i].flags, flags))
 			continue;
-		
+
 		/* Check if the zone can satisfy the allocation request. */
 		if (zone_can_alloc(&zones.info[i], count, constraint))
 			return i;
 	}
-	
+
 	return (size_t) -1;
 }
@@ -291,18 +291,18 @@
 	for (size_t pos = 0; pos < zones.count; pos++) {
 		size_t i = (pos + hint) % zones.count;
-		
+
 		/* Skip zones containing only high-priority memory. */
 		if (is_high_priority(zones.info[i].base, zones.info[i].count))
 			continue;
-		
+
 		/* Check whether the zone meets the search criteria. */
 		if (!ZONE_FLAGS_MATCH(zones.info[i].flags, flags))
 			continue;
-		
+
 		/* Check if the zone can satisfy the allocation request. */
 		if (zone_can_alloc(&zones.info[i], count, constraint))
 			return i;
 	}
-	
+
 	return (size_t) -1;
 }
@@ -328,14 +328,14 @@
 	if (hint >= zones.count)
 		hint = 0;
-	
+
 	/*
 	 * Prefer zones with low-priority memory over
 	 * zones with high-priority memory.
 	 */
-	
+
 	size_t znum = find_free_zone_lowprio(count, flags, constraint, hint);
 	if (znum != (size_t) -1)
 		return znum;
-	
+
 	/* Take all zones into account */
 	return find_free_zone_all(count, flags, constraint, hint);
@@ -350,5 +350,5 @@
 {
 	assert(index < zone->count);
-	
+
 	return &zone->frames[index];
 }
@@ -371,25 +371,25 @@
 {
 	assert(zone->flags & ZONE_AVAILABLE);
-	
+
 	/* Allocate frames from zone */
 	size_t index = (size_t) -1;
 	int avail = bitmap_allocate_range(&zone->bitmap, count, zone->base,
 	    FRAME_LOWPRIO, constraint, &index);
-	
+
 	assert(avail);
 	assert(index != (size_t) -1);
-	
+
 	/* Update frame reference count */
 	for (size_t i = 0; i < count; i++) {
 		frame_t *frame = zone_get_frame(zone, index + i);
-		
+
 		assert(frame->refcount == 0);
 		frame->refcount = 1;
 	}
-	
+
 	/* Update zone information. */
 	zone->free_count -= count;
 	zone->busy_count += count;
-	
+
 	return index;
 }
@@ -408,19 +408,19 @@
 {
 	assert(zone->flags & ZONE_AVAILABLE);
-	
+
 	frame_t *frame = zone_get_frame(zone, index);
-	
+
 	assert(frame->refcount > 0);
-	
+
 	if (!--frame->refcount) {
 		bitmap_set(&zone->bitmap, index, 0);
-		
+
 		/* Update zone information. */
 		zone->free_count++;
 		zone->busy_count--;
-		
+
 		return 1;
 	}
-	
+
 	return 0;
 }
@@ -430,12 +430,12 @@
 {
 	assert(zone->flags & ZONE_AVAILABLE);
-	
+
 	frame_t *frame = zone_get_frame(zone, index);
 	if (frame->refcount > 0)
 		return;
-	
+
 	frame->refcount = 1;
 	bitmap_set_range(&zone->bitmap, index, 1);
-	
+
 	zone->free_count--;
 	reserve_force_alloc(1);
@@ -462,22 +462,22 @@
 	assert(!overlaps(zones.info[z1].base, zones.info[z1].count,
 	    zones.info[z2].base, zones.info[z2].count));
-	
+
 	/* Difference between zone bases */
 	pfn_t base_diff = zones.info[z2].base - zones.info[z1].base;
-	
+
 	zones.info[z1].count = base_diff + zones.info[z2].count;
 	zones.info[z1].free_count += zones.info[z2].free_count;
 	zones.info[z1].busy_count += zones.info[z2].busy_count;
-	
+
 	bitmap_initialize(&zones.info[z1].bitmap, zones.info[z1].count,
 	    confdata + (sizeof(frame_t) * zones.info[z1].count));
 	bitmap_clear_range(&zones.info[z1].bitmap, 0, zones.info[z1].count);
-	
+
 	zones.info[z1].frames = (frame_t *) confdata;
-	
+
 	/*
 	 * Copy frames and bits from both zones to preserve parents, etc.
 	 */
-	
+
 	for (size_t i = 0; i < old_z1->count; i++) {
 		bitmap_set(&zones.info[z1].bitmap, i,
@@ -485,5 +485,5 @@
 		zones.info[z1].frames[i] = old_z1->frames[i];
 	}
-	
+
 	for (size_t i = 0; i < zones.info[z2].count; i++) {
 		bitmap_set(&zones.info[z1].bitmap, base_diff + i,
@@ -510,11 +510,11 @@
 {
 	assert(zones.info[znum].flags & ZONE_AVAILABLE);
-	
+
 	size_t cframes = SIZE2FRAMES(zone_conf_size(count));
-	
+
 	if ((pfn < zones.info[znum].base) ||
 	    (pfn >= zones.info[znum].base + zones.info[znum].count))
 		return;
-	
+
 	for (size_t i = 0; i < cframes; i++)
 		(void) zone_frame_free(&zones.info[znum],
@@ -536,7 +536,7 @@
 {
 	irq_spinlock_lock(&zones.lock, true);
-	
+
 	bool ret = true;
-	
+
 	/*
 	 * We can join only 2 zones with none existing inbetween,
@@ -549,9 +549,9 @@
 		goto errout;
 	}
-	
+
 	pfn_t cframes = SIZE2FRAMES(zone_conf_size(
 	    zones.info[z2].base - zones.info[z1].base
 	    + zones.info[z2].count));
-	
+
 	/* Allocate merged zone data inside one of the zones */
 	pfn_t pfn;
@@ -566,14 +566,14 @@
 		goto errout;
 	}
-	
+
 	/* Preserve original data from z1 */
 	zone_t old_z1 = zones.info[z1];
-	
+
 	/* Do zone merging */
 	zone_merge_internal(z1, z2, &old_z1, (void *) PA2KA(PFN2ADDR(pfn)));
-	
+
 	/* Subtract zone information from busy frames */
 	zones.info[z1].busy_count -= cframes;
-	
+
 	/* Free old zone information */
 	return_config_frames(z1,
@@ -582,14 +582,14 @@
 	    ADDR2PFN(KA2PA((uintptr_t) zones.info[z2].frames)),
 	    zones.info[z2].count);
-	
+
 	/* Move zones down */
 	for (size_t i = z2 + 1; i < zones.count; i++)
 		zones.info[i - 1] = zones.info[i];
-	
+
 	zones.count--;
-	
+
 errout:
 	irq_spinlock_unlock(&zones.lock, true);
-	
+
 	return ret;
 }
@@ -605,5 +605,5 @@
 {
 	size_t i = 1;
-	
+
 	while (i < zones.count) {
 		if (!zone_merge(i - 1, i))
@@ -631,5 +631,5 @@
 	zone->free_count = count;
 	zone->busy_count = 0;
-	
+
 	if (flags & ZONE_AVAILABLE) {
 		/*
@@ -637,15 +637,15 @@
 		 * frame_t structures in the configuration space).
 		 */
-		
+
 		bitmap_initialize(&zone->bitmap, count, confdata +
 		    (sizeof(frame_t) * count));
 		bitmap_clear_range(&zone->bitmap, 0, count);
-		
+
 		/*
 		 * Initialize the array of frame_t structures.
 		 */
-		
+
 		zone->frames = (frame_t *) confdata;
-		
+
 		for (size_t i = 0; i < count; i++)
 			frame_initialize(&zone->frames[i]);
@@ -672,5 +672,5 @@
 {
 	size_t frames = SIZE2FRAMES(zone_conf_size(count));
-	
+
 	return ADDR2PFN((uintptr_t)
 	    frame_alloc(frames, FRAME_LOWMEM | FRAME_ATOMIC, 0));
@@ -697,5 +697,5 @@
 {
 	irq_spinlock_lock(&zones.lock, true);
-	
+
 	if (flags & ZONE_AVAILABLE) {  /* Create available zone */
 		/*
@@ -705,8 +705,8 @@
 		 */
 		assert(confframe != ADDR2PFN((uintptr_t ) NULL));
-		
+
 		/* Update the known end of physical memory. */
 		config.physmem_end = max(config.physmem_end, PFN2ADDR(start + count));
-		
+
 		/*
 		 * If confframe is supposed to be inside our zone, then make sure
@@ -714,5 +714,5 @@
 		 */
 		size_t confcount = SIZE2FRAMES(zone_conf_size(count));
-		
+
 		if ((confframe >= start) && (confframe < start + count)) {
 			for (; confframe < start + count; confframe++) {
@@ -721,9 +721,9 @@
 				    KA2PA(config.base), config.kernel_size))
 					continue;
-				
+
 				if (overlaps(addr, PFN2ADDR(confcount),
 				    KA2PA(config.stack_base), config.stack_size))
 					continue;
-				
+
 				bool overlap = false;
 				for (size_t i = 0; i < init.cnt; i++) {
@@ -735,15 +735,15 @@
 					}
 				}
-				
+
 				if (overlap)
 					continue;
-				
+
 				break;
 			}
-			
+
 			if (confframe >= start + count)
 				panic("Cannot find configuration data for zone.");
 		}
-		
+
 		size_t znum = zones_insert_zone(start, count, flags);
 		if (znum == (size_t) -1) {
@@ -751,8 +751,8 @@
 			return (size_t) -1;
 		}
-		
+
 		void *confdata = (void *) PA2KA(PFN2ADDR(confframe));
 		zone_construct(&zones.info[znum], start, count, flags, confdata);
-		
+
 		/* If confdata in zone, mark as unavailable */
 		if ((confframe >= start) && (confframe < start + count)) {
@@ -761,10 +761,10 @@
 				    i - zones.info[znum].base);
 		}
-		
+
 		irq_spinlock_unlock(&zones.lock, true);
-		
+
 		return znum;
 	}
-	
+
 	/* Non-available zone */
 	size_t znum = zones_insert_zone(start, count, flags);
@@ -773,9 +773,9 @@
 		return (size_t) -1;
 	}
-	
+
 	zone_construct(&zones.info[znum], start, count, flags, NULL);
-	
+
 	irq_spinlock_unlock(&zones.lock, true);
-	
+
 	return znum;
 }
@@ -789,12 +789,12 @@
 {
 	irq_spinlock_lock(&zones.lock, true);
-	
+
 	size_t znum = find_zone(pfn, 1, hint);
-	
+
 	assert(znum != (size_t) -1);
-	
+
 	zone_get_frame(&zones.info[znum],
 	    pfn - zones.info[znum].base)->parent = data;
-	
+
 	irq_spinlock_unlock(&zones.lock, true);
 }
@@ -803,14 +803,14 @@
 {
 	irq_spinlock_lock(&zones.lock, true);
-	
+
 	size_t znum = find_zone(pfn, 1, hint);
-	
+
 	assert(znum != (size_t) -1);
-	
+
 	void *res = zone_get_frame(&zones.info[znum],
 	    pfn - zones.info[znum].base)->parent;
-	
+
 	irq_spinlock_unlock(&zones.lock, true);
-	
+
 	return res;
 }
@@ -831,8 +831,8 @@
 {
 	assert(count > 0);
-	
+
 	size_t hint = pzone ? (*pzone) : 0;
 	pfn_t frame_constraint = ADDR2PFN(constraint);
-	
+
 	/*
 	 * If not told otherwise, we must first reserve the memory.
@@ -840,8 +840,8 @@
 	if (!(flags & FRAME_NO_RESERVE))
 		reserve_force_alloc(count);
-	
+
 loop:
 	irq_spinlock_lock(&zones.lock, true);
-	
+
 	/*
 	 * First, find suitable frame zone.
@@ -849,5 +849,5 @@
 	size_t znum = find_free_zone(count, FRAME_TO_ZONE_FLAGS(flags),
 	    frame_constraint, hint);
-	
+
 	/*
 	 * If no memory, reclaim some slab memory,
@@ -858,14 +858,14 @@
 		size_t freed = slab_reclaim(0);
 		irq_spinlock_lock(&zones.lock, true);
-		
+
 		if (freed > 0)
 			znum = find_free_zone(count, FRAME_TO_ZONE_FLAGS(flags),
 			    frame_constraint, hint);
-		
+
 		if (znum == (size_t) -1) {
 			irq_spinlock_unlock(&zones.lock, true);
 			freed = slab_reclaim(SLAB_RECLAIM_ALL);
 			irq_spinlock_lock(&zones.lock, true);
-			
+
 			if (freed > 0)
 				znum = find_free_zone(count, FRAME_TO_ZONE_FLAGS(flags),
@@ -873,27 +873,27 @@
 		}
 	}
-	
+
 	if (znum == (size_t) -1) {
 		if (flags & FRAME_ATOMIC) {
 			irq_spinlock_unlock(&zones.lock, true);
-			
+
 			if (!(flags & FRAME_NO_RESERVE))
 				reserve_free(count);
-			
+
 			return 0;
 		}
-		
+
 		size_t avail = frame_total_free_get_internal();
-		
+
 		irq_spinlock_unlock(&zones.lock, true);
-		
+
 		if (!THREAD)
 			panic("Cannot wait for %zu frames to become available "
 			    "(%zu available).", count, avail);
-		
+
 		/*
 		 * Sleep until some frames are available again.
 		 */
-		
+
 #ifdef CONFIG_DEBUG
 		log(LF_OTHER, LVL_DEBUG,
@@ -901,5 +901,5 @@
 		    "%zu available.", THREAD->tid, count, avail);
 #endif
-		
+
 		/*
 		 * Since the mem_avail_mtx is an active mutex, we need to
@@ -908,34 +908,34 @@
 		ipl_t ipl = interrupts_disable();
 		mutex_lock(&mem_avail_mtx);
-		
+
 		if (mem_avail_req > 0)
 			mem_avail_req = min(mem_avail_req, count);
 		else
 			mem_avail_req = count;
-		
+
 		size_t gen = mem_avail_gen;
-		
+
 		while (gen == mem_avail_gen)
 			condvar_wait(&mem_avail_cv, &mem_avail_mtx);
-		
+
 		mutex_unlock(&mem_avail_mtx);
 		interrupts_restore(ipl);
-		
+
 #ifdef CONFIG_DEBUG
 		log(LF_OTHER, LVL_DEBUG, "Thread %" PRIu64 " woken up.",
 		    THREAD->tid);
 #endif
-		
+
 		goto loop;
 	}
-	
+
 	pfn_t pfn = zone_frame_alloc(&zones.info[znum], count,
 	    frame_constraint) + zones.info[znum].base;
-	
+
 	irq_spinlock_unlock(&zones.lock, true);
-	
+
 	if (pzone)
 		*pzone = znum;
-	
+
 	return PFN2ADDR(pfn);
 }
@@ -960,7 +960,7 @@
 {
 	size_t freed = 0;
-	
+
 	irq_spinlock_lock(&zones.lock, true);
-	
+
 	for (size_t i = 0; i < count; i++) {
 		/*
@@ -969,13 +969,13 @@
 		pfn_t pfn = ADDR2PFN(start) + i;
 		size_t znum = find_zone(pfn, 1, 0);
-		
+
 		assert(znum != (size_t) -1);
-		
+
 		freed += zone_frame_free(&zones.info[znum],
 		    pfn - zones.info[znum].base);
 	}
-	
+
 	irq_spinlock_unlock(&zones.lock, true);
-	
+
 	/*
 	 * Signal that some memory has been freed.
@@ -984,19 +984,19 @@
 	 * with TLB shootdown.
 	 */
-	
+
 	ipl_t ipl = interrupts_disable();
 	mutex_lock(&mem_avail_mtx);
-	
+
 	if (mem_avail_req > 0)
 		mem_avail_req -= min(mem_avail_req, freed);
-	
+
 	if (mem_avail_req == 0) {
 		mem_avail_gen++;
 		condvar_broadcast(&mem_avail_cv);
 	}
-	
+
 	mutex_unlock(&mem_avail_mtx);
 	interrupts_restore(ipl);
-	
+
 	if (!(flags & FRAME_NO_RESERVE))
 		reserve_free(freed);
@@ -1024,14 +1024,14 @@
 {
 	irq_spinlock_lock(&zones.lock, true);
-	
+
 	/*
 	 * First, find host frame zone for addr.
 	 */
 	size_t znum = find_zone(pfn, 1, 0);
-	
+
 	assert(znum != (size_t) -1);
-	
+
 	zones.info[znum].frames[pfn - zones.info[znum].base].refcount++;
-	
+
 	irq_spinlock_unlock(&zones.lock, true);
 }
@@ -1043,15 +1043,15 @@
 {
 	irq_spinlock_lock(&zones.lock, true);
-	
+
 	for (size_t i = 0; i < count; i++) {
 		size_t znum = find_zone(start + i, 1, 0);
-		
+
 		if (znum == (size_t) -1)  /* PFN not found */
 			continue;
-		
+
 		zone_mark_unavailable(&zones.info[znum],
 		    start + i - zones.info[znum].base);
 	}
-	
+
 	irq_spinlock_unlock(&zones.lock, true);
 }
@@ -1068,8 +1068,8 @@
 		condvar_initialize(&mem_avail_cv);
 	}
-	
+
 	/* Tell the architecture to create some memory */
 	frame_low_arch_init();
-	
+
 	if (config.cpu_active == 1) {
 		frame_mark_unavailable(ADDR2PFN(KA2PA(config.base)),
@@ -1077,13 +1077,13 @@
 		frame_mark_unavailable(ADDR2PFN(KA2PA(config.stack_base)),
 		    SIZE2FRAMES(config.stack_size));
-		
+
 		for (size_t i = 0; i < init.cnt; i++)
 			frame_mark_unavailable(ADDR2PFN(init.tasks[i].paddr),
 			    SIZE2FRAMES(init.tasks[i].size));
-		
+
 		if (ballocs.size)
 			frame_mark_unavailable(ADDR2PFN(KA2PA(ballocs.base)),
 			    SIZE2FRAMES(ballocs.size));
-		
+
 		/*
 		 * Blacklist first frame, as allocating NULL would
@@ -1092,5 +1092,5 @@
 		frame_mark_unavailable(0, 1);
 	}
-	
+
 	frame_high_arch_init();
 }
@@ -1113,9 +1113,9 @@
 {
 	uintptr_t limit = KA2PA(config.identity_base) + config.identity_size;
-	
+
 	if (low) {
 		if (*basep > limit)
 			return false;
-		
+
 		if (*basep + *sizep > limit)
 			*sizep = limit - *basep;
@@ -1123,5 +1123,5 @@
 		if (*basep + *sizep <= limit)
 			return false;
-		
+
 		if (*basep <= limit) {
 			*sizep -= limit - *basep;
@@ -1129,5 +1129,5 @@
 		}
 	}
-	
+
 	return true;
 }
@@ -1139,12 +1139,12 @@
 {
 	irq_spinlock_lock(&zones.lock, true);
-	
+
 	uint64_t total = 0;
-	
+
 	for (size_t i = 0; i < zones.count; i++)
 		total += (uint64_t) FRAMES2SIZE(zones.info[i].count);
-	
+
 	irq_spinlock_unlock(&zones.lock, true);
-	
+
 	return total;
 }
@@ -1157,15 +1157,15 @@
 	assert(busy != NULL);
 	assert(free != NULL);
-	
+
 	irq_spinlock_lock(&zones.lock, true);
-	
+
 	*total = 0;
 	*unavail = 0;
 	*busy = 0;
 	*free = 0;
-	
+
 	for (size_t i = 0; i < zones.count; i++) {
 		*total += (uint64_t) FRAMES2SIZE(zones.info[i].count);
-		
+
 		if (zones.info[i].flags & ZONE_AVAILABLE) {
 			*busy += (uint64_t) FRAMES2SIZE(zones.info[i].busy_count);
@@ -1174,5 +1174,5 @@
 			*unavail += (uint64_t) FRAMES2SIZE(zones.info[i].count);
 	}
-	
+
 	irq_spinlock_unlock(&zones.lock, true);
 }
@@ -1190,5 +1190,5 @@
 	printf("[nr] [base address    ] [frames    ] [flags ] [free frames ] [busy frames ]\n");
 #endif
-	
+
 	/*
 	 * Because printing may require allocation of memory, we may not hold
@@ -1201,17 +1201,17 @@
 	 * the listing).
 	 */
-	
+
 	size_t free_lowmem = 0;
 	size_t free_highmem = 0;
 	size_t free_highprio = 0;
-	
+
 	for (size_t i = 0;; i++) {
 		irq_spinlock_lock(&zones.lock, true);
-		
+
 		if (i >= zones.count) {
 			irq_spinlock_unlock(&zones.lock, true);
 			break;
 		}
-		
+
 		pfn_t fbase = zones.info[i].base;
 		uintptr_t base = PFN2ADDR(fbase);
@@ -1220,17 +1220,17 @@
 		size_t free_count = zones.info[i].free_count;
 		size_t busy_count = zones.info[i].busy_count;
-		
+
 		bool available = ((flags & ZONE_AVAILABLE) != 0);
 		bool lowmem = ((flags & ZONE_LOWMEM) != 0);
 		bool highmem = ((flags & ZONE_HIGHMEM) != 0);
 		bool highprio = is_high_priority(fbase, count);
-		
+
 		if (available) {
 			if (lowmem)
 				free_lowmem += free_count;
-			
+
 			if (highmem)
 				free_highmem += free_count;
-			
+
 			if (highprio) {
 				free_highprio += free_count;
@@ -1241,5 +1241,5 @@
 				 * statistics.
 				 */
-				
+
 				for (size_t index = 0; index < count; index++) {
 					if (is_high_priority(fbase + index, 0)) {
@@ -1251,17 +1251,17 @@
 			}
 		}
-		
+
 		irq_spinlock_unlock(&zones.lock, true);
-		
+
 		printf("%-4zu", i);
-		
+
 #ifdef __32_BITS__
 		printf("  %p", (void *) base);
 #endif
-		
+
 #ifdef __64_BITS__
 		printf(" %p", (void *) base);
 #endif
-		
+
 		printf(" %12zu %c%c%c%c%c    ", count,
 		    available ? 'A' : '-',
@@ -1270,27 +1270,27 @@
 		    (flags & ZONE_LOWMEM) ? 'L' : '-',
 		    (flags & ZONE_HIGHMEM) ? 'H' : '-');
-		
+
 		if (available)
 			printf("%14zu %14zu",
 			    free_count, busy_count);
-		
+
 		printf("\n");
 	}
-	
+
 	printf("\n");
-	
+
 	uint64_t size;
 	const char *size_suffix;
-	
+
 	bin_order_suffix(FRAMES2SIZE(free_lowmem), &size, &size_suffix,
 	    false);
 	printf("Available low memory:    %zu frames (%" PRIu64 " %s)\n",
 	    free_lowmem, size, size_suffix);
-	
+
 	bin_order_suffix(FRAMES2SIZE(free_highmem), &size, &size_suffix,
 	    false);
 	printf("Available high memory:   %zu frames (%" PRIu64 " %s)\n",
 	    free_highmem, size, size_suffix);
-	
+
 	bin_order_suffix(FRAMES2SIZE(free_highprio), &size, &size_suffix,
 	    false);
@@ -1308,5 +1308,5 @@
 	irq_spinlock_lock(&zones.lock, true);
 	size_t znum = (size_t) -1;
-	
+
 	for (size_t i = 0; i < zones.count; i++) {
 		if ((i == num) || (PFN2ADDR(zones.info[i].base) == num)) {
@@ -1315,5 +1315,5 @@
 		}
 	}
-	
+
 	if (znum == (size_t) -1) {
 		irq_spinlock_unlock(&zones.lock, true);
@@ -1321,9 +1321,9 @@
 		return;
 	}
-	
+
 	size_t free_lowmem = 0;
 	size_t free_highmem = 0;
 	size_t free_highprio = 0;
-	
+
 	pfn_t fbase = zones.info[znum].base;
 	uintptr_t base = PFN2ADDR(fbase);
@@ -1332,17 +1332,17 @@
 	size_t free_count = zones.info[znum].free_count;
 	size_t busy_count = zones.info[znum].busy_count;
-	
+
 	bool available = ((flags & ZONE_AVAILABLE) != 0);
 	bool lowmem = ((flags & ZONE_LOWMEM) != 0);
 	bool highmem = ((flags & ZONE_HIGHMEM) != 0);
 	bool highprio = is_high_priority(fbase, count);
-	
+
 	if (available) {
 		if (lowmem)
 			free_lowmem = free_count;
-		
+
 		if (highmem)
 			free_highmem = free_count;
-		
+
 		if (highprio) {
 			free_highprio = free_count;
@@ -1353,5 +1353,5 @@
 			 * statistics.
 			 */
-			
+
 			for (size_t index = 0; index < count; index++) {
 				if (is_high_priority(fbase + index, 0)) {
@@ -1363,12 +1363,12 @@
 		}
 	}
-	
+
 	irq_spinlock_unlock(&zones.lock, true);
-	
+
 	uint64_t size;
 	const char *size_suffix;
-	
+
 	bin_order_suffix(FRAMES2SIZE(count), &size, &size_suffix, false);
-	
+
 	printf("Zone number:             %zu\n", znum);
 	printf("Zone base address:       %p\n", (void *) base);
@@ -1381,5 +1381,5 @@
 	    (flags & ZONE_LOWMEM) ? 'L' : '-',
 	    (flags & ZONE_HIGHMEM) ? 'H' : '-');
-	
+
 	if (available) {
 		bin_order_suffix(FRAMES2SIZE(busy_count), &size, &size_suffix,
@@ -1387,20 +1387,20 @@
 		printf("Allocated space:         %zu frames (%" PRIu64 " %s)\n",
 		    busy_count, size, size_suffix);
-		
+
 		bin_order_suffix(FRAMES2SIZE(free_count), &size, &size_suffix,
 		    false);
 		printf("Available space:         %zu frames (%" PRIu64 " %s)\n",
 		    free_count, size, size_suffix);
-		
+
 		bin_order_suffix(FRAMES2SIZE(free_lowmem), &size, &size_suffix,
 		    false);
 		printf("Available low memory:    %zu frames (%" PRIu64 " %s)\n",
 		    free_lowmem, size, size_suffix);
-		
+
 		bin_order_suffix(FRAMES2SIZE(free_highmem), &size, &size_suffix,
 		    false);
 		printf("Available high memory:   %zu frames (%" PRIu64 " %s)\n",
 		    free_highmem, size, size_suffix);
-		
+
 		bin_order_suffix(FRAMES2SIZE(free_highprio), &size, &size_suffix,
 		    false);
Index: kernel/generic/src/mm/km.c
===================================================================
--- kernel/generic/src/mm/km.c	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ kernel/generic/src/mm/km.c	(revision a35b458e9db1ca95e679799dc7c1b12c83359ca3)
@@ -149,5 +149,5 @@
 	}
 	page_table_unlock(AS_KERNEL, true);
-	
+
 	return vaddr;
 }
@@ -247,5 +247,5 @@
 	assert(framep);
 	assert(!(flags & ~(FRAME_NO_RESERVE | FRAME_ATOMIC)));
-	
+
 	/*
 	 * Allocate a frame, preferably from high memory.
@@ -267,8 +267,8 @@
 		if (!frame)
 			return (uintptr_t) NULL;
-		
+
 		page = PA2KA(frame);
 	}
-	
+
 	*framep = frame;
 	return page;
Index: kernel/generic/src/mm/page.c
===================================================================
--- kernel/generic/src/mm/page.c	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ kernel/generic/src/mm/page.c	(revision a35b458e9db1ca95e679799dc7c1b12c83359ca3)
@@ -99,5 +99,5 @@
 {
 	assert(page_table_locked(as));
-	
+
 	assert(page_mapping_operations);
 	assert(page_mapping_operations->mapping_insert);
@@ -105,5 +105,5 @@
 	page_mapping_operations->mapping_insert(as, ALIGN_DOWN(page, PAGE_SIZE),
 	    ALIGN_DOWN(frame, FRAME_SIZE), flags);
-	
+
 	/* Repel prefetched accesses to the old mapping. */
 	memory_barrier();
@@ -123,11 +123,11 @@
 {
 	assert(page_table_locked(as));
-	
+
 	assert(page_mapping_operations);
 	assert(page_mapping_operations->mapping_remove);
-	
+
 	page_mapping_operations->mapping_remove(as,
 	    ALIGN_DOWN(page, PAGE_SIZE));
-	
+
 	/* Repel prefetched accesses to the old mapping. */
 	memory_barrier();
@@ -148,8 +148,8 @@
 {
 	assert(nolock || page_table_locked(as));
-	
+
 	assert(page_mapping_operations);
 	assert(page_mapping_operations->mapping_find);
-	
+
 	return page_mapping_operations->mapping_find(as,
 	    ALIGN_DOWN(page, PAGE_SIZE), nolock, pte);
@@ -169,8 +169,8 @@
 {
 	assert(nolock || page_table_locked(as));
-	
+
 	assert(page_mapping_operations);
 	assert(page_mapping_operations->mapping_find);
-	
+
 	page_mapping_operations->mapping_update(as,
 	    ALIGN_DOWN(page, PAGE_SIZE), nolock, pte);
@@ -186,5 +186,5 @@
 	assert(page_mapping_operations);
 	assert(page_mapping_operations->mapping_make_global);
-	
+
 	return page_mapping_operations->mapping_make_global(base, size);
 }
@@ -193,5 +193,5 @@
 {
 	page_table_lock(AS, true);
-	
+
 	pte_t pte;
 	bool found = page_mapping_find(AS, virt, false, &pte);
@@ -200,10 +200,10 @@
 		return ENOENT;
 	}
-	
+
 	*phys = PTE_GET_FRAME(&pte) +
 	    (virt - ALIGN_DOWN(virt, PAGE_SIZE));
-	
+
 	page_table_unlock(AS, true);
-	
+
 	return EOK;
 }
@@ -221,5 +221,5 @@
 	if (rc != EOK)
 		return rc;
-	
+
 	rc = copy_to_uspace(phys_ptr, &phys, sizeof(phys));
 	return (sys_errno_t) rc;
Index: kernel/generic/src/mm/slab.c
===================================================================
--- kernel/generic/src/mm/slab.c	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ kernel/generic/src/mm/slab.c	(revision a35b458e9db1ca95e679799dc7c1b12c83359ca3)
@@ -186,15 +186,15 @@
 {
 	size_t zone = 0;
-	
+
 	uintptr_t data_phys =
 	    frame_alloc_generic(cache->frames, flags, 0, &zone);
 	if (!data_phys)
 		return NULL;
-	
+
 	void *data = (void *) PA2KA(data_phys);
-	
+
 	slab_t *slab;
 	size_t fsize;
-	
+
 	if (!(cache->flags & SLAB_CACHE_SLINSIDE)) {
 		slab = slab_alloc(slab_extern_cache, flags);
@@ -207,18 +207,18 @@
 		slab = data + fsize - sizeof(*slab);
 	}
-	
+
 	/* Fill in slab structures */
 	size_t i;
 	for (i = 0; i < cache->frames; i++)
 		frame_set_parent(ADDR2PFN(KA2PA(data)) + i, slab, zone);
-	
+
 	slab->start = data;
 	slab->available = cache->objects;
 	slab->nextavail = 0;
 	slab->cache = cache;
-	
+
 	for (i = 0; i < cache->objects; i++)
 		*((size_t *) (slab->start + i * cache->size)) = i + 1;
-	
+
 	atomic_inc(&cache->allocated_slabs);
 	return slab;
@@ -235,7 +235,7 @@
 	if (!(cache->flags & SLAB_CACHE_SLINSIDE))
 		slab_free(slab_extern_cache, slab);
-	
+
 	atomic_dec(&cache->allocated_slabs);
-	
+
 	return cache->frames;
 }
@@ -263,19 +263,19 @@
 	if (!slab)
 		slab = obj2slab(obj);
-	
+
 	assert(slab->cache == cache);
-	
+
 	size_t freed = 0;
-	
+
 	if (cache->destructor)
 		freed = cache->destructor(obj);
-	
+
 	irq_spinlock_lock(&cache->slablock, true);
 	assert(slab->available < cache->objects);
-	
+
 	*((size_t *) obj) = slab->nextavail;
 	slab->nextavail = (obj - slab->start) / cache->size;
 	slab->available++;
-	
+
 	/* Move it to correct list */
 	if (slab->available == cache->objects) {
@@ -283,5 +283,5 @@
 		list_remove(&slab->link);
 		irq_spinlock_unlock(&cache->slablock, true);
-		
+
 		return freed + slab_space_free(cache, slab);
 	} else if (slab->available == 1) {
@@ -290,5 +290,5 @@
 		list_prepend(&slab->link, &cache->partial_slabs);
 	}
-	
+
 	irq_spinlock_unlock(&cache->slablock, true);
 	return freed;
@@ -303,7 +303,7 @@
 {
 	irq_spinlock_lock(&cache->slablock, true);
-	
+
 	slab_t *slab;
-	
+
 	if (list_empty(&cache->partial_slabs)) {
 		/*
@@ -319,5 +319,5 @@
 		if (!slab)
 			return NULL;
-		
+
 		irq_spinlock_lock(&cache->slablock, true);
 	} else {
@@ -326,16 +326,16 @@
 		list_remove(&slab->link);
 	}
-	
+
 	void *obj = slab->start + slab->nextavail * cache->size;
 	slab->nextavail = *((size_t *) obj);
 	slab->available--;
-	
+
 	if (!slab->available)
 		list_prepend(&slab->link, &cache->full_slabs);
 	else
 		list_prepend(&slab->link, &cache->partial_slabs);
-	
+
 	irq_spinlock_unlock(&cache->slablock, true);
-	
+
 	if ((cache->constructor) && (cache->constructor(obj, flags) != EOK)) {
 		/* Bad, bad, construction failed */
@@ -343,5 +343,5 @@
 		return NULL;
 	}
-	
+
 	return obj;
 }
@@ -361,5 +361,5 @@
 	slab_magazine_t *mag = NULL;
 	link_t *cur;
-	
+
 	irq_spinlock_lock(&cache->maglock, true);
 	if (!list_empty(&cache->magazines)) {
@@ -368,5 +368,5 @@
 		else
 			cur = list_last(&cache->magazines);
-		
+
 		mag = list_get_instance(cur, slab_magazine_t, link);
 		list_remove(&mag->link);
@@ -385,8 +385,8 @@
 {
 	irq_spinlock_lock(&cache->maglock, true);
-	
+
 	list_prepend(&mag->link, &cache->magazines);
 	atomic_inc(&cache->magazine_counter);
-	
+
 	irq_spinlock_unlock(&cache->maglock, true);
 }
@@ -402,12 +402,12 @@
 	size_t i;
 	size_t frames = 0;
-	
+
 	for (i = 0; i < mag->busy; i++) {
 		frames += slab_obj_destroy(cache, mag->objs[i], NULL);
 		atomic_dec(&cache->cached_objs);
 	}
-	
+
 	slab_free(&mag_cache, mag);
-	
+
 	return frames;
 }
@@ -420,11 +420,11 @@
 	slab_magazine_t *cmag = cache->mag_cache[CPU->id].current;
 	slab_magazine_t *lastmag = cache->mag_cache[CPU->id].last;
-	
+
 	assert(irq_spinlock_locked(&cache->mag_cache[CPU->id].lock));
-	
+
 	if (cmag) { /* First try local CPU magazines */
 		if (cmag->busy)
 			return cmag;
-		
+
 		if ((lastmag) && (lastmag->busy)) {
 			cache->mag_cache[CPU->id].current = lastmag;
@@ -433,16 +433,16 @@
 		}
 	}
-	
+
 	/* Local magazines are empty, import one from magazine list */
 	slab_magazine_t *newmag = get_mag_from_cache(cache, 1);
 	if (!newmag)
 		return NULL;
-	
+
 	if (lastmag)
 		magazine_destroy(cache, lastmag);
-	
+
 	cache->mag_cache[CPU->id].last = cmag;
 	cache->mag_cache[CPU->id].current = newmag;
-	
+
 	return newmag;
 }
@@ -457,7 +457,7 @@
 	if (!CPU)
 		return NULL;
-	
+
 	irq_spinlock_lock(&cache->mag_cache[CPU->id].lock, true);
-	
+
 	slab_magazine_t *mag = get_full_current_mag(cache);
 	if (!mag) {
@@ -465,10 +465,10 @@
 		return NULL;
 	}
-	
+
 	void *obj = mag->objs[--mag->busy];
 	irq_spinlock_unlock(&cache->mag_cache[CPU->id].lock, true);
-	
+
 	atomic_dec(&cache->cached_objs);
-	
+
 	return obj;
 }
@@ -487,11 +487,11 @@
 	slab_magazine_t *cmag = cache->mag_cache[CPU->id].current;
 	slab_magazine_t *lastmag = cache->mag_cache[CPU->id].last;
-	
+
 	assert(irq_spinlock_locked(&cache->mag_cache[CPU->id].lock));
-	
+
 	if (cmag) {
 		if (cmag->busy < cmag->size)
 			return cmag;
-		
+
 		if ((lastmag) && (lastmag->busy < lastmag->size)) {
 			cache->mag_cache[CPU->id].last = cmag;
@@ -500,7 +500,7 @@
 		}
 	}
-	
+
 	/* current | last are full | nonexistent, allocate new */
-	
+
 	/*
 	 * We do not want to sleep just because of caching,
@@ -513,16 +513,16 @@
 	if (!newmag)
 		return NULL;
-	
+
 	newmag->size = SLAB_MAG_SIZE;
 	newmag->busy = 0;
-	
+
 	/* Flush last to magazine list */
 	if (lastmag)
 		put_mag_to_cache(cache, lastmag);
-	
+
 	/* Move current as last, save new as current */
 	cache->mag_cache[CPU->id].last = cmag;
 	cache->mag_cache[CPU->id].current = newmag;
-	
+
 	return newmag;
 }
@@ -537,7 +537,7 @@
 	if (!CPU)
 		return -1;
-	
+
 	irq_spinlock_lock(&cache->mag_cache[CPU->id].lock, true);
-	
+
 	slab_magazine_t *mag = make_empty_current_mag(cache);
 	if (!mag) {
@@ -545,11 +545,11 @@
 		return -1;
 	}
-	
+
 	mag->objs[mag->busy++] = obj;
-	
+
 	irq_spinlock_unlock(&cache->mag_cache[CPU->id].lock, true);
-	
+
 	atomic_inc(&cache->cached_objs);
-	
+
 	return 0;
 }
@@ -578,8 +578,8 @@
 	size_t objects = comp_objects(cache);
 	size_t ssize = FRAMES2SIZE(cache->frames);
-	
+
 	if (cache->flags & SLAB_CACHE_SLINSIDE)
 		ssize -= sizeof(slab_t);
-	
+
 	return ssize - objects * cache->size;
 }
@@ -591,9 +591,9 @@
 {
 	assert(_slab_initialized >= 2);
-	
+
 	cache->mag_cache = slab_alloc(&slab_mag_cache, FRAME_ATOMIC);
 	if (!cache->mag_cache)
 		return false;
-	
+
 	size_t i;
 	for (i = 0; i < config.cpu_count; i++) {
@@ -602,5 +602,5 @@
 		    "slab.cache.mag_cache[].lock");
 	}
-	
+
 	return true;
 }
@@ -614,44 +614,44 @@
 {
 	assert(size > 0);
-	
+
 	memsetb(cache, sizeof(*cache), 0);
 	cache->name = name;
-	
+
 	if (align < sizeof(sysarg_t))
 		align = sizeof(sysarg_t);
-	
+
 	size = ALIGN_UP(size, align);
-	
+
 	cache->size = size;
 	cache->constructor = constructor;
 	cache->destructor = destructor;
 	cache->flags = flags;
-	
+
 	list_initialize(&cache->full_slabs);
 	list_initialize(&cache->partial_slabs);
 	list_initialize(&cache->magazines);
-	
+
 	irq_spinlock_initialize(&cache->slablock, "slab.cache.slablock");
 	irq_spinlock_initialize(&cache->maglock, "slab.cache.maglock");
-	
+
 	if (!(cache->flags & SLAB_CACHE_NOMAGAZINE))
 		(void) make_magcache(cache);
-	
+
 	/* Compute slab sizes, object counts in slabs etc. */
 	if (cache->size < SLAB_INSIDE_SIZE)
 		cache->flags |= SLAB_CACHE_SLINSIDE;
-	
+
 	/* Minimum slab frames */
 	cache->frames = SIZE2FRAMES(cache->size);
-	
+
 	while (badness(cache) > SLAB_MAX_BADNESS(cache))
 		cache->frames <<= 1;
-	
+
 	cache->objects = comp_objects(cache);
-	
+
 	/* If info fits in, put it inside */
 	if (badness(cache) > sizeof(slab_t))
 		cache->flags |= SLAB_CACHE_SLINSIDE;
-	
+
 	/* Add cache to cache list */
 	irq_spinlock_lock(&slab_cache_lock, true);
@@ -670,5 +670,5 @@
 	_slab_cache_create(cache, name, size, align, constructor, destructor,
 	    flags);
-	
+
 	return cache;
 }
@@ -685,5 +685,5 @@
 	if (cache->flags & SLAB_CACHE_NOMAGAZINE)
 		return 0; /* Nothing to do */
-	
+
 	/*
 	 * We count up to original magazine count to avoid
@@ -691,8 +691,8 @@
 	 */
 	atomic_count_t magcount = atomic_get(&cache->magazine_counter);
-	
+
 	slab_magazine_t *mag;
 	size_t frames = 0;
-	
+
 	while ((magcount--) && (mag = get_mag_from_cache(cache, 0))) {
 		frames += magazine_destroy(cache, mag);
@@ -700,5 +700,5 @@
 			break;
 	}
-	
+
 	if (flags & SLAB_RECLAIM_ALL) {
 		/* Free cpu-bound magazines */
@@ -707,19 +707,19 @@
 		for (i = 0; i < config.cpu_count; i++) {
 			irq_spinlock_lock(&cache->mag_cache[i].lock, true);
-			
+
 			mag = cache->mag_cache[i].current;
 			if (mag)
 				frames += magazine_destroy(cache, mag);
 			cache->mag_cache[i].current = NULL;
-			
+
 			mag = cache->mag_cache[i].last;
 			if (mag)
 				frames += magazine_destroy(cache, mag);
 			cache->mag_cache[i].last = NULL;
-			
+
 			irq_spinlock_unlock(&cache->mag_cache[i].lock, true);
 		}
 	}
-	
+
 	return frames;
 }
@@ -731,9 +731,9 @@
 {
 	ipl_t ipl = interrupts_disable();
-	
+
 	if ((cache->flags & SLAB_CACHE_NOMAGAZINE) ||
 	    (magazine_obj_put(cache, obj)))
 		slab_obj_destroy(cache, obj, slab);
-	
+
 	interrupts_restore(ipl);
 	atomic_dec(&cache->allocated_objs);
@@ -753,5 +753,5 @@
 	list_remove(&cache->link);
 	irq_spinlock_unlock(&slab_cache_lock, true);
-	
+
 	/*
 	 * Do not lock anything, we assume the software is correct and
@@ -759,18 +759,18 @@
 	 *
 	 */
-	
+
 	/* Destroy all magazines */
 	_slab_reclaim(cache, SLAB_RECLAIM_ALL);
-	
+
 	/* All slabs must be empty */
 	if ((!list_empty(&cache->full_slabs)) ||
 	    (!list_empty(&cache->partial_slabs)))
 		panic("Destroying cache that is not empty.");
-	
+
 	if (!(cache->flags & SLAB_CACHE_NOMAGAZINE)) {
 		slab_t *mag_slab = obj2slab(cache->mag_cache);
 		_slab_free(mag_slab->cache, cache->mag_cache, mag_slab);
 	}
-	
+
 	slab_free(&slab_cache_cache, cache);
 }
@@ -783,18 +783,18 @@
 	/* Disable interrupts to avoid deadlocks with interrupt handlers */
 	ipl_t ipl = interrupts_disable();
-	
+
 	void *result = NULL;
-	
+
 	if (!(cache->flags & SLAB_CACHE_NOMAGAZINE))
 		result = magazine_obj_get(cache);
-	
+
 	if (!result)
 		result = slab_obj_create(cache, flags);
-	
+
 	interrupts_restore(ipl);
-	
+
 	if (result)
 		atomic_inc(&cache->allocated_objs);
-	
+
 	return result;
 }
@@ -812,12 +812,12 @@
 {
 	irq_spinlock_lock(&slab_cache_lock, true);
-	
+
 	size_t frames = 0;
 	list_foreach(slab_cache_list, link, slab_cache_t, cache) {
 		frames += _slab_reclaim(cache, flags);
 	}
-	
+
 	irq_spinlock_unlock(&slab_cache_lock, true);
-	
+
 	return frames;
 }
@@ -828,5 +828,5 @@
 	printf("[cache name      ] [size  ] [pages ] [obj/pg] [slabs ]"
 	    " [cached] [alloc ] [ctl]\n");
-	
+
 	size_t skip = 0;
 	while (true) {
@@ -853,7 +853,7 @@
 		 * statistics.
 		 */
-		
+
 		irq_spinlock_lock(&slab_cache_lock, true);
-		
+
 		link_t *cur;
 		size_t i;
@@ -861,14 +861,14 @@
 		    (i < skip) && (cur != &slab_cache_list.head);
 		    i++, cur = cur->next);
-		
+
 		if (cur == &slab_cache_list.head) {
 			irq_spinlock_unlock(&slab_cache_lock, true);
 			break;
 		}
-		
+
 		skip++;
-		
+
 		slab_cache_t *cache = list_get_instance(cur, slab_cache_t, link);
-		
+
 		const char *name = cache->name;
 		size_t frames = cache->frames;
@@ -879,7 +879,7 @@
 		long allocated_objs = atomic_get(&cache->allocated_objs);
 		unsigned int flags = cache->flags;
-		
+
 		irq_spinlock_unlock(&slab_cache_lock, true);
-		
+
 		printf("%-18s %8zu %8zu %8zu %8ld %8ld %8ld %-5s\n",
 		    name, size, frames, objects, allocated_slabs,
@@ -896,18 +896,18 @@
 	    sizeof(uintptr_t), NULL, NULL, SLAB_CACHE_NOMAGAZINE |
 	    SLAB_CACHE_SLINSIDE);
-	
+
 	/* Initialize slab_cache cache */
 	_slab_cache_create(&slab_cache_cache, "slab_cache_cache",
 	    sizeof(slab_cache_cache), sizeof(uintptr_t), NULL, NULL,
 	    SLAB_CACHE_NOMAGAZINE | SLAB_CACHE_SLINSIDE);
-	
+
 	/* Initialize external slab cache */
 	slab_extern_cache = slab_cache_create("slab_t", sizeof(slab_t), 0,
 	    NULL, NULL, SLAB_CACHE_SLINSIDE | SLAB_CACHE_MAGDEFERRED);
-	
+
 	/* Initialize structures for malloc */
 	size_t i;
 	size_t size;
-	
+
 	for (i = 0, size = (1 << SLAB_MIN_MALLOC_W);
 	    i < (SLAB_MAX_MALLOC_W - SLAB_MIN_MALLOC_W + 1);
@@ -916,5 +916,5 @@
 		    NULL, NULL, SLAB_CACHE_MAGDEFERRED);
 	}
-	
+
 #ifdef CONFIG_DEBUG
 	_slab_initialized = 1;
@@ -934,20 +934,20 @@
 	_slab_initialized = 2;
 #endif
-	
+
 	_slab_cache_create(&slab_mag_cache, "slab_mag_cache",
 	    sizeof(slab_mag_cache_t) * config.cpu_count, sizeof(uintptr_t),
 	    NULL, NULL, SLAB_CACHE_NOMAGAZINE | SLAB_CACHE_SLINSIDE);
-	
+
 	irq_spinlock_lock(&slab_cache_lock, false);
-	
+
 	list_foreach(slab_cache_list, link, slab_cache_t, slab) {
 		if ((slab->flags & SLAB_CACHE_MAGDEFERRED) !=
 		    SLAB_CACHE_MAGDEFERRED)
 			continue;
-		
+
 		(void) make_magcache(slab);
 		slab->flags &= ~SLAB_CACHE_MAGDEFERRED;
 	}
-	
+
 	irq_spinlock_unlock(&slab_cache_lock, false);
 }
@@ -957,10 +957,10 @@
 	assert(_slab_initialized);
 	assert(size <= (1 << SLAB_MAX_MALLOC_W));
-	
+
 	if (size < (1 << SLAB_MIN_MALLOC_W))
 		size = (1 << SLAB_MIN_MALLOC_W);
-	
+
 	uint8_t idx = fnzb(size - 1) - SLAB_MIN_MALLOC_W + 1;
-	
+
 	return slab_alloc(malloc_caches[idx], flags);
 }
@@ -970,24 +970,24 @@
 	assert(_slab_initialized);
 	assert(size <= (1 << SLAB_MAX_MALLOC_W));
-	
+
 	void *new_ptr;
-	
+
 	if (size > 0) {
 		if (size < (1 << SLAB_MIN_MALLOC_W))
 			size = (1 << SLAB_MIN_MALLOC_W);
 		uint8_t idx = fnzb(size - 1) - SLAB_MIN_MALLOC_W + 1;
-		
+
 		new_ptr = slab_alloc(malloc_caches[idx], flags);
 	} else
 		new_ptr = NULL;
-	
+
 	if ((new_ptr != NULL) && (ptr != NULL)) {
 		slab_t *slab = obj2slab(ptr);
 		memcpy(new_ptr, ptr, min(size, slab->cache->size));
 	}
-	
+
 	if (ptr != NULL)
 		free(ptr);
-	
+
 	return new_ptr;
 }
@@ -997,5 +997,5 @@
 	if (!ptr)
 		return;
-	
+
 	slab_t *slab = obj2slab(ptr);
 	_slab_free(slab->cache, ptr, slab);
Index: kernel/generic/src/mm/tlb.c
===================================================================
--- kernel/generic/src/mm/tlb.c	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ kernel/generic/src/mm/tlb.c	(revision a35b458e9db1ca95e679799dc7c1b12c83359ca3)
@@ -87,12 +87,12 @@
 	CPU->tlb_active = false;
 	irq_spinlock_lock(&tlblock, false);
-	
+
 	size_t i;
 	for (i = 0; i < config.cpu_count; i++) {
 		if (i == CPU->id)
 			continue;
-		
+
 		cpu_t *cpu = &cpus[i];
-		
+
 		irq_spinlock_lock(&cpu->lock, false);
 		if (cpu->tlb_messages_count == TLB_MESSAGE_QUEUE_LEN) {
@@ -118,7 +118,7 @@
 		irq_spinlock_unlock(&cpu->lock, false);
 	}
-	
+
 	tlb_shootdown_ipi_send();
-	
+
 busy_wait:
 	for (i = 0; i < config.cpu_count; i++) {
@@ -126,5 +126,5 @@
 			goto busy_wait;
 	}
-	
+
 	return ipl;
 }
@@ -153,12 +153,12 @@
 {
 	assert(CPU);
-	
+
 	CPU->tlb_active = false;
 	irq_spinlock_lock(&tlblock, false);
 	irq_spinlock_unlock(&tlblock, false);
-	
+
 	irq_spinlock_lock(&CPU->lock, false);
 	assert(CPU->tlb_messages_count <= TLB_MESSAGE_QUEUE_LEN);
-	
+
 	size_t i;
 	for (i = 0; i < CPU->tlb_messages_count; i++) {
@@ -167,5 +167,5 @@
 		uintptr_t page = CPU->tlb_messages[i].page;
 		size_t count = CPU->tlb_messages[i].count;
-		
+
 		switch (type) {
 		case TLB_INVL_ALL:
@@ -183,9 +183,9 @@
 			break;
 		}
-		
+
 		if (type == TLB_INVL_ALL)
 			break;
 	}
-	
+
 	CPU->tlb_messages_count = 0;
 	irq_spinlock_unlock(&CPU->lock, false);
