Index: generic/src/mm/as.c
===================================================================
--- generic/src/mm/as.c	(revision 2e9eae2bc030606ff48cccb46abe0afb51099458)
+++ generic/src/mm/as.c	(revision 0ffa3ef51d117153ad4c8c5fdb3b525ff042ef01)
@@ -98,6 +98,6 @@
 
 static int area_flags_to_page_flags(int aflags);
-static as_area_t *find_area_and_lock(as_t *as, __address va);
-static bool check_area_conflicts(as_t *as, __address va, size_t size, as_area_t *avoid_area);
+static as_area_t *find_area_and_lock(as_t *as, uintptr_t va);
+static bool check_area_conflicts(as_t *as, uintptr_t va, size_t size, as_area_t *avoid_area);
 static void sh_info_remove_reference(share_info_t *sh_info);
 
@@ -200,5 +200,5 @@
  * @return Address space area on success or NULL on failure.
  */
-as_area_t *as_area_create(as_t *as, int flags, size_t size, __address base, int attrs,
+as_area_t *as_area_create(as_t *as, int flags, size_t size, uintptr_t base, int attrs,
 	       mem_backend_t *backend, mem_backend_data_t *backend_data)
 {
@@ -239,5 +239,5 @@
 		a->backend_data = *backend_data;
 	else
-		memsetb((__address) &a->backend_data, sizeof(a->backend_data), 0);
+		memsetb((uintptr_t) &a->backend_data, sizeof(a->backend_data), 0);
 
 	btree_create(&a->used_space);
@@ -260,5 +260,5 @@
  * @return Zero on success or a value from @ref errno.h otherwise.
  */ 
-int as_area_resize(as_t *as, __address address, size_t size, int flags)
+int as_area_resize(as_t *as, uintptr_t address, size_t size, int flags)
 {
 	as_area_t *area;
@@ -313,5 +313,5 @@
 	if (pages < area->pages) {
 		bool cond;
-		__address start_free = area->base + pages*PAGE_SIZE;
+		uintptr_t start_free = area->base + pages*PAGE_SIZE;
 
 		/*
@@ -338,5 +338,5 @@
 			node = list_get_instance(area->used_space.leaf_head.prev, btree_node_t, leaf_link);
 			if ((cond = (bool) node->keys)) {
-				__address b = node->key[node->keys - 1];
+				uintptr_t b = node->key[node->keys - 1];
 				count_t c = (count_t) node->value[node->keys - 1];
 				int i = 0;
@@ -419,8 +419,8 @@
  * @return Zero on success or a value from @ref errno.h on failure. 
  */
-int as_area_destroy(as_t *as, __address address)
+int as_area_destroy(as_t *as, uintptr_t address)
 {
 	as_area_t *area;
-	__address base;
+	uintptr_t base;
 	link_t *cur;
 	ipl_t ipl;
@@ -452,5 +452,5 @@
 		node = list_get_instance(cur, btree_node_t, leaf_link);
 		for (i = 0; i < node->keys; i++) {
-			__address b = node->key[i];
+			uintptr_t b = node->key[i];
 			count_t j;
 			pte_t *pte;
@@ -519,6 +519,6 @@
  *	   to share non-anonymous address space area is detected.
  */
-int as_area_share(as_t *src_as, __address src_base, size_t acc_size,
-		  as_t *dst_as, __address dst_base, int dst_flags_mask)
+int as_area_share(as_t *src_as, uintptr_t src_base, size_t acc_size,
+		  as_t *dst_as, uintptr_t dst_base, int dst_flags_mask)
 {
 	ipl_t ipl;
@@ -666,5 +666,5 @@
  * 	   fault was caused by copy_to_uspace() or copy_from_uspace().
  */
-int as_page_fault(__address page, pf_access_t access, istate_t *istate)
+int as_page_fault(uintptr_t page, pf_access_t access, istate_t *istate)
 {
 	pte_t *pte;
@@ -745,8 +745,8 @@
 	if (THREAD->in_copy_from_uspace) {
 		THREAD->in_copy_from_uspace = false;
-		istate_set_retaddr(istate, (__address) &memcpy_from_uspace_failover_address);
+		istate_set_retaddr(istate, (uintptr_t) &memcpy_from_uspace_failover_address);
 	} else if (THREAD->in_copy_to_uspace) {
 		THREAD->in_copy_to_uspace = false;
-		istate_set_retaddr(istate, (__address) &memcpy_to_uspace_failover_address);
+		istate_set_retaddr(istate, (uintptr_t) &memcpy_to_uspace_failover_address);
 	} else {
 		return AS_PF_FAULT;
@@ -943,5 +943,5 @@
  * @return Locked address space area containing va on success or NULL on failure.
  */
-as_area_t *find_area_and_lock(as_t *as, __address va)
+as_area_t *find_area_and_lock(as_t *as, uintptr_t va)
 {
 	as_area_t *a;
@@ -999,5 +999,5 @@
  * @return True if there is no conflict, false otherwise.
  */
-bool check_area_conflicts(as_t *as, __address va, size_t size, as_area_t *avoid_area)
+bool check_area_conflicts(as_t *as, uintptr_t va, size_t size, as_area_t *avoid_area)
 {
 	as_area_t *a;
@@ -1072,5 +1072,5 @@
 
 /** Return size of the address space area with given base.  */
-size_t as_get_size(__address base)
+size_t as_get_size(uintptr_t base)
 {
 	ipl_t ipl;
@@ -1100,5 +1100,5 @@
  * @return 0 on failure and 1 on success.
  */
-int used_space_insert(as_area_t *a, __address page, count_t count)
+int used_space_insert(as_area_t *a, uintptr_t page, count_t count)
 {
 	btree_node_t *leaf, *node;
@@ -1124,5 +1124,5 @@
 	node = btree_leaf_node_left_neighbour(&a->used_space, leaf);
 	if (node) {
-		__address left_pg = node->key[node->keys - 1], right_pg = leaf->key[0];
+		uintptr_t left_pg = node->key[node->keys - 1], right_pg = leaf->key[0];
 		count_t left_cnt = (count_t) node->value[node->keys - 1], right_cnt = (count_t) leaf->value[0];
 		
@@ -1167,5 +1167,5 @@
 		}
 	} else if (page < leaf->key[0]) {
-		__address right_pg = leaf->key[0];
+		uintptr_t right_pg = leaf->key[0];
 		count_t right_cnt = (count_t) leaf->value[0];
 	
@@ -1198,5 +1198,5 @@
 	node = btree_leaf_node_right_neighbour(&a->used_space, leaf);
 	if (node) {
-		__address left_pg = leaf->key[leaf->keys - 1], right_pg = node->key[0];
+		uintptr_t left_pg = leaf->key[leaf->keys - 1], right_pg = node->key[0];
 		count_t left_cnt = (count_t) leaf->value[leaf->keys - 1], right_cnt = (count_t) node->value[0];
 		
@@ -1241,5 +1241,5 @@
 		}
 	} else if (page >= leaf->key[leaf->keys - 1]) {
-		__address left_pg = 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];
 	
@@ -1273,5 +1273,5 @@
 	for (i = 1; i < leaf->keys; i++) {
 		if (page < leaf->key[i]) {
-			__address left_pg = leaf->key[i - 1], right_pg = leaf->key[i];
+			uintptr_t left_pg = leaf->key[i - 1], right_pg = leaf->key[i];
 			count_t left_cnt = (count_t) leaf->value[i - 1], right_cnt = (count_t) leaf->value[i];
 
@@ -1327,5 +1327,5 @@
  * @return 0 on failure and 1 on success.
  */
-int used_space_remove(as_area_t *a, __address page, count_t count)
+int used_space_remove(as_area_t *a, uintptr_t page, count_t count)
 {
 	btree_node_t *leaf, *node;
@@ -1364,5 +1364,5 @@
 	node = btree_leaf_node_left_neighbour(&a->used_space, leaf);
 	if (node && page < leaf->key[0]) {
-		__address left_pg = node->key[node->keys - 1];
+		uintptr_t left_pg = node->key[node->keys - 1];
 		count_t left_cnt = (count_t) node->value[node->keys - 1];
 
@@ -1397,5 +1397,5 @@
 	
 	if (page > leaf->key[leaf->keys - 1]) {
-		__address left_pg = 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];
 
@@ -1433,5 +1433,5 @@
 	for (i = 1; i < leaf->keys - 1; i++) {
 		if (page < leaf->key[i]) {
-			__address left_pg = leaf->key[i - 1];
+			uintptr_t left_pg = leaf->key[i - 1];
 			count_t left_cnt = (count_t) leaf->value[i - 1];
 
@@ -1497,5 +1497,5 @@
 			node = list_get_instance(cur, btree_node_t, leaf_link);
 			for (i = 0; i < node->keys; i++) 
-				frame_free((__address) node->value[i]);
+				frame_free((uintptr_t) node->value[i]);
 		}
 		
@@ -1514,22 +1514,22 @@
 
 /** Wrapper for as_area_create(). */
-__native sys_as_area_create(__address address, size_t size, int flags)
+unative_t sys_as_area_create(uintptr_t address, size_t size, int flags)
 {
 	if (as_area_create(AS, flags | AS_AREA_CACHEABLE, size, address, AS_AREA_ATTR_NONE, &anon_backend, NULL))
-		return (__native) address;
+		return (unative_t) address;
 	else
-		return (__native) -1;
+		return (unative_t) -1;
 }
 
 /** Wrapper for as_area_resize. */
-__native sys_as_area_resize(__address address, size_t size, int flags)
-{
-	return (__native) as_area_resize(AS, address, size, 0);
+unative_t sys_as_area_resize(uintptr_t address, size_t size, int flags)
+{
+	return (unative_t) as_area_resize(AS, address, size, 0);
 }
 
 /** Wrapper for as_area_destroy. */
-__native sys_as_area_destroy(__address address)
-{
-	return (__native) as_area_destroy(AS, address);
+unative_t sys_as_area_destroy(uintptr_t address)
+{
+	return (unative_t) as_area_destroy(AS, address);
 }
 
