Index: generic/src/mm/as.c
===================================================================
--- generic/src/mm/as.c	(revision 8d6bc2d55a5723b035ceb3586ac601c79ece9e54)
+++ generic/src/mm/as.c	(revision baafe7129927f6fcfc81c0942b4cae0a700500cb)
@@ -84,6 +84,6 @@
 as_operations_t *as_operations = NULL;
 
-/** Address space lock. It protects inactive_as_with_asid_head. Must be acquired before as_t mutex. */
-SPINLOCK_INITIALIZE(as_lock);
+/** This lock protects inactive_as_with_asid_head list. It must be acquired before as_t mutex. */
+SPINLOCK_INITIALIZE(inactive_as_with_asid_lock);
 
 /**
@@ -129,5 +129,5 @@
 		as->asid = ASID_INVALID;
 	
-	as->refcount = 0;
+	as->cpu_refcount = 0;
 	as->page_table = page_table_create(flags);
 
@@ -138,5 +138,5 @@
 void as_free(as_t *as)
 {
-	ASSERT(as->refcount == 0);
+	ASSERT(as->cpu_refcount == 0);
 
 	/* TODO: free as_areas and other resources held by as */
@@ -734,5 +734,5 @@
  *
  * Note that this function cannot sleep as it is essentially a part of
- * the scheduling. Sleeping here would lead to deadlock on wakeup.
+ * scheduling. Sleeping here would lead to deadlock on wakeup.
  *
  * @param old Old address space or NULL.
@@ -745,5 +745,5 @@
 	
 	ipl = interrupts_disable();
-	spinlock_lock(&as_lock);
+	spinlock_lock(&inactive_as_with_asid_lock);
 
 	/*
@@ -752,6 +752,6 @@
 	if (old) {
 		mutex_lock_active(&old->lock);
-		ASSERT(old->refcount);
-		if((--old->refcount == 0) && (old != AS_KERNEL)) {
+		ASSERT(old->cpu_refcount);
+		if((--old->cpu_refcount == 0) && (old != AS_KERNEL)) {
 			/*
 			 * The old address space is no longer active on
@@ -770,5 +770,5 @@
 	 */
 	mutex_lock_active(&new->lock);
-	if ((new->refcount++ == 0) && (new != AS_KERNEL)) {
+	if ((new->cpu_refcount++ == 0) && (new != AS_KERNEL)) {
 		if (new->asid != ASID_INVALID)
 			list_remove(&new->inactive_as_with_asid_link);
@@ -791,5 +791,5 @@
 		mutex_unlock(&new->lock);
 	}
-	spinlock_unlock(&as_lock);
+	spinlock_unlock(&inactive_as_with_asid_lock);
 	interrupts_restore(ipl);
 	
