Index: kernel/generic/src/mm/as.c
===================================================================
--- kernel/generic/src/mm/as.c	(revision dad59517515e53c29f935bc4cbe535d802b998c0)
+++ kernel/generic/src/mm/as.c	(revision cf5ddf618974e3d854b08c9d0db88f2ad90fee8c)
@@ -169,5 +169,5 @@
 	as->cpu_refcount = 0;
 #ifdef AS_PAGE_TABLE
-	as->page_table = page_table_create(flags);
+	as->genarch.page_table = page_table_create(flags);
 #else
 	page_table_create(flags);
@@ -221,5 +221,5 @@
 	btree_destroy(&as->as_area_btree);
 #ifdef AS_PAGE_TABLE
-	page_table_destroy(as->page_table);
+	page_table_destroy(as->genarch.page_table);
 #else
 	page_table_destroy(NULL);
@@ -864,5 +864,5 @@
  * @param new New address space.
  */
-void as_switch(as_t *old, as_t *replace)
+void as_switch(as_t *old_as, as_t *new_as)
 {
 	ipl_t ipl;
@@ -875,8 +875,8 @@
 	 * First, take care of the old address space.
 	 */	
-	if (old) {
-		mutex_lock_active(&old->lock);
-		ASSERT(old->cpu_refcount);
-		if((--old->cpu_refcount == 0) && (old != AS_KERNEL)) {
+	if (old_as) {
+		mutex_lock_active(&old_as->lock);
+		ASSERT(old_as->cpu_refcount);
+		if((--old_as->cpu_refcount == 0) && (old_as != AS_KERNEL)) {
 			/*
 			 * The old address space is no longer active on
@@ -885,9 +885,9 @@
 			 * ASID.
 			 */
-			 ASSERT(old->asid != ASID_INVALID);
-			 list_append(&old->inactive_as_with_asid_link,
+			 ASSERT(old_as->asid != ASID_INVALID);
+			 list_append(&old_as->inactive_as_with_asid_link,
 			     &inactive_as_with_asid_head);
 		}
-		mutex_unlock(&old->lock);
+		mutex_unlock(&old_as->lock);
 
 		/*
@@ -895,5 +895,5 @@
 		 * is being removed from the CPU.
 		 */
-		as_deinstall_arch(old);
+		as_deinstall_arch(old_as);
 	}
 
@@ -901,17 +901,19 @@
 	 * Second, prepare the new address space.
 	 */
-	mutex_lock_active(&replace->lock);
-	if ((replace->cpu_refcount++ == 0) && (replace != AS_KERNEL)) {
-		if (replace->asid != ASID_INVALID) {
-			list_remove(&replace->inactive_as_with_asid_link);
+	mutex_lock_active(&new_as->lock);
+	if ((new_as->cpu_refcount++ == 0) && (new_as != AS_KERNEL)) {
+		if (new_as->asid != ASID_INVALID) {
+			list_remove(&new_as->inactive_as_with_asid_link);
 		} else {
 			/*
-			 * Defer call to asid_get() until replace->lock is released.
+			 * Defer call to asid_get() until new_as->lock is released.
 			 */
 			needs_asid = true;
 		}
 	}
-	SET_PTL0_ADDRESS(replace->page_table);
-	mutex_unlock(&replace->lock);
+#ifdef AS_PAGE_TABLE
+	SET_PTL0_ADDRESS(new_as->genarch.page_table);
+#endif
+	mutex_unlock(&new_as->lock);
 
 	if (needs_asid) {
@@ -923,7 +925,7 @@
 		
 		asid = asid_get();
-		mutex_lock_active(&replace->lock);
-		replace->asid = asid;
-		mutex_unlock(&replace->lock);
+		mutex_lock_active(&new_as->lock);
+		new_as->asid = asid;
+		mutex_unlock(&new_as->lock);
 	}
 	spinlock_unlock(&inactive_as_with_asid_lock);
@@ -934,7 +936,7 @@
 	 * (e.g. write ASID to hardware register etc.)
 	 */
-	as_install_arch(replace);
-	
-	AS = replace;
+	as_install_arch(new_as);
+	
+	AS = new_as;
 }
 
