Index: test/fpu/fpu1/test.c
===================================================================
--- test/fpu/fpu1/test.c	(revision 7ee0e2fa610021a3023ca5ce1f183ca5f3f759d2)
+++ test/fpu/fpu1/test.c	(revision 0ffa3ef51d117153ad4c8c5fdb3b525ff042ef01)
@@ -96,8 +96,8 @@
 
 		if((int)(100000000*e)!=E_10e8)
-			panic("tid%d: e*10e8=%zd should be %zd\n", THREAD->tid, (__native) (100000000*e),(__native) E_10e8);
+			panic("tid%d: e*10e8=%zd should be %zd\n", THREAD->tid, (unative_t) (100000000*e),(unative_t) E_10e8);
 	}
 
-	printf("tid%d: e*10e8=%zd should be %zd\n", THREAD->tid, (__native) (100000000*e),(__native) E_10e8);
+	printf("tid%d: e*10e8=%zd should be %zd\n", THREAD->tid, (unative_t) (100000000*e),(unative_t) E_10e8);
 	atomic_inc(&threads_ok);
 }
@@ -137,13 +137,13 @@
 #ifdef __ia64_ARCH_H__
 		if((int)(1000000*pi)!=PI_10e8)
-			panic("tid%d: pi*10e8=%zd should be %zd\n", THREAD->tid, (__native) (1000000*pi),(__native) (PI_10e8/100));
+			panic("tid%d: pi*10e8=%zd should be %zd\n", THREAD->tid, (unative_t) (1000000*pi),(unative_t) (PI_10e8/100));
 #else
 		if((int)(100000000*pi)!=PI_10e8)
-			panic("tid%d: pi*10e8=%zd should be %zd\n", THREAD->tid, (__native) (100000000*pi),(__native) PI_10e8);
+			panic("tid%d: pi*10e8=%zd should be %zd\n", THREAD->tid, (unative_t) (100000000*pi),(unative_t) PI_10e8);
 #endif
 
 	}
 
-	printf("tid%d: pi*10e8=%zd should be %zd\n", THREAD->tid, (__native) (100000000*pi),(__native) PI_10e8);
+	printf("tid%d: pi*10e8=%zd should be %zd\n", THREAD->tid, (unative_t) (100000000*pi),(unative_t) PI_10e8);
 	atomic_inc(&threads_ok);
 }
Index: test/fpu/mips1/test.c
===================================================================
--- test/fpu/mips1/test.c	(revision 7ee0e2fa610021a3023ca5ce1f183ca5f3f759d2)
+++ test/fpu/mips1/test.c	(revision 0ffa3ef51d117153ad4c8c5fdb3b525ff042ef01)
@@ -48,5 +48,5 @@
 {
 	int i;
-	int arg __attribute__((aligned(16))) = (int)((__native) data);
+	int arg __attribute__((aligned(16))) = (int)((unative_t) data);
 	int after_arg __attribute__((aligned(16)));
 
@@ -78,5 +78,5 @@
 {
 	int i;
-	int arg __attribute__((aligned(16))) = (int)((__native) data);
+	int arg __attribute__((aligned(16))) = (int)((unative_t) data);
 	int after_arg __attribute__((aligned(16)));
 
@@ -117,8 +117,8 @@
 
 	for (i=0; i<THREADS/2; i++) {  
-		if (!(t = thread_create(testit1, (void *)((__native)i*2), TASK, 0, "testit1")))
+		if (!(t = thread_create(testit1, (void *)((unative_t)i*2), TASK, 0, "testit1")))
 			panic("could not create thread\n");
 		thread_ready(t);
-		if (!(t = thread_create(testit2, (void *)((__native)i*2+1), TASK, 0, "testit2")))
+		if (!(t = thread_create(testit2, (void *)((unative_t)i*2+1), TASK, 0, "testit2")))
 			panic("could not create thread\n");
 		thread_ready(t);
Index: test/fpu/sse1/test.c
===================================================================
--- test/fpu/sse1/test.c	(revision 7ee0e2fa610021a3023ca5ce1f183ca5f3f759d2)
+++ test/fpu/sse1/test.c	(revision 0ffa3ef51d117153ad4c8c5fdb3b525ff042ef01)
@@ -48,5 +48,5 @@
 {
 	int i;
-	int arg __attribute__((aligned(16))) = (int)((__native) data);
+	int arg __attribute__((aligned(16))) = (int)((unative_t) data);
 	int after_arg __attribute__((aligned(16)));
 
@@ -78,5 +78,5 @@
 {
 	int i;
-	int arg __attribute__((aligned(16))) = (int)((__native) data);
+	int arg __attribute__((aligned(16))) = (int)((unative_t) data);
 	int after_arg __attribute__((aligned(16)));
 
@@ -117,8 +117,8 @@
 
 	for (i=0; i<THREADS/2; i++) {  
-		if (!(t = thread_create(testit1, (void *)((__native)i*2), TASK, 0, "testit1")))
+		if (!(t = thread_create(testit1, (void *)((unative_t)i*2), TASK, 0, "testit1")))
 			panic("could not create thread\n");
 		thread_ready(t);
-		if (!(t = thread_create(testit2, (void *)((__native)i*2+1), TASK, 0, "testit2")))
+		if (!(t = thread_create(testit2, (void *)((unative_t)i*2+1), TASK, 0, "testit2")))
 			panic("could not create thread\n");
 		thread_ready(t);
Index: test/mm/falloc1/test.c
===================================================================
--- test/mm/falloc1/test.c	(revision 7ee0e2fa610021a3023ca5ce1f183ca5f3f759d2)
+++ test/mm/falloc1/test.c	(revision 0ffa3ef51d117153ad4c8c5fdb3b525ff042ef01)
@@ -41,5 +41,5 @@
 
 void test(void) {
-	__address * frames = (__address *) malloc(MAX_FRAMES*sizeof(__address), 0);
+	uintptr_t * frames = (uintptr_t *) malloc(MAX_FRAMES*sizeof(uintptr_t), 0);
 	int results[MAX_ORDER+1];
 	
@@ -55,5 +55,5 @@
 			allocated = 0;
 			for (i = 0; i < MAX_FRAMES >> order; i++) {
-				frames[allocated] = (__address) frame_alloc(order, FRAME_ATOMIC | FRAME_KA);
+				frames[allocated] = (uintptr_t) frame_alloc(order, FRAME_ATOMIC | FRAME_KA);
 				
 				if (ALIGN_UP(frames[allocated], FRAME_SIZE << order) != frames[allocated]) {
Index: test/mm/falloc2/test.c
===================================================================
--- test/mm/falloc2/test.c	(revision 7ee0e2fa610021a3023ca5ce1f183ca5f3f759d2)
+++ test/mm/falloc2/test.c	(revision 0ffa3ef51d117153ad4c8c5fdb3b525ff042ef01)
@@ -53,8 +53,8 @@
 {
 	int order, run, allocated, i;
-	__u8 val = THREAD->tid % THREADS;
+	uint8_t val = THREAD->tid % THREADS;
 	index_t k;
 	
-	__address * frames =  (__address *) malloc(MAX_FRAMES * sizeof(__address), FRAME_ATOMIC);
+	uintptr_t * frames =  (uintptr_t *) malloc(MAX_FRAMES * sizeof(uintptr_t), FRAME_ATOMIC);
 	ASSERT(frames != NULL);
 	
@@ -66,5 +66,5 @@
 			allocated = 0;
 			for (i = 0; i < (MAX_FRAMES >> order); i++) {
-				frames[allocated] = (__address)frame_alloc(order, FRAME_ATOMIC | FRAME_KA);
+				frames[allocated] = (uintptr_t)frame_alloc(order, FRAME_ATOMIC | FRAME_KA);
 				if (frames[allocated]) {
 					memsetb(frames[allocated], FRAME_SIZE << order, val);
@@ -79,5 +79,5 @@
 			for (i = 0; i < allocated; i++) {
 				for (k = 0; k <= ((FRAME_SIZE << order) - 1); k++) {
-					if (((__u8 *) frames[i])[k] != val) {
+					if (((uint8_t *) frames[i])[k] != val) {
 						printf("Thread #%d (cpu%d): Unexpected data (%d) in block %p offset %#zx\n", THREAD->tid, CPU->id, ((char *) frames[i])[k], frames[i], k);
 						failed();
Index: test/mm/mapping1/test.c
===================================================================
--- test/mm/mapping1/test.c	(revision 7ee0e2fa610021a3023ca5ce1f183ca5f3f759d2)
+++ test/mm/mapping1/test.c	(revision 0ffa3ef51d117153ad4c8c5fdb3b525ff042ef01)
@@ -43,6 +43,6 @@
 void test(void)
 {
-	__address frame0, frame1;
-	__u32 v0, v1;
+	uintptr_t frame0, frame1;
+	uint32_t v0, v1;
 
 	printf("Memory management test mapping #1\n");
@@ -52,7 +52,7 @@
 
 	printf("Writing %#x to physical address %p.\n", VALUE0, KA2PA(frame0));
-	*((__u32 *) frame0) = VALUE0;
+	*((uint32_t *) frame0) = VALUE0;
 	printf("Writing %#x to physical address %p.\n", VALUE1, KA2PA(frame1));
-	*((__u32 *) frame1) = VALUE1;
+	*((uint32_t *) frame1) = VALUE1;
 	
 	printf("Mapping virtual address %p to physical address %p.\n", PAGE0, KA2PA(frame0));
@@ -61,6 +61,6 @@
 	page_mapping_insert(AS_KERNEL, PAGE1, KA2PA(frame1), PAGE_PRESENT | PAGE_WRITE);
 	
-	printf("Value at virtual address %p is %#x.\n", PAGE0, v0 = *((__u32 *) PAGE0));
-	printf("Value at virtual address %p is %#x.\n", PAGE1, v1 = *((__u32 *) PAGE1));
+	printf("Value at virtual address %p is %#x.\n", PAGE0, v0 = *((uint32_t *) PAGE0));
+	printf("Value at virtual address %p is %#x.\n", PAGE1, v1 = *((uint32_t *) PAGE1));
 	
 	ASSERT(v0 == VALUE0);
@@ -68,13 +68,13 @@
 
 	printf("Writing %#x to virtual address %p.\n", 0, PAGE0);
-	*((__u32 *) PAGE0) = 0;
+	*((uint32_t *) PAGE0) = 0;
 	printf("Writing %#x to virtual address %p.\n", 0, PAGE1);
-	*((__u32 *) PAGE1) = 0;	
+	*((uint32_t *) PAGE1) = 0;	
 
-	v0 = *((__u32 *) PAGE0);
-	v1 = *((__u32 *) PAGE1);
+	v0 = *((uint32_t *) PAGE0);
+	v1 = *((uint32_t *) PAGE1);
 	
-	printf("Value at virtual address %p is %#x.\n", PAGE0, *((__u32 *) PAGE0));	
-	printf("Value at virtual address %p is %#x.\n", PAGE1, *((__u32 *) PAGE1));
+	printf("Value at virtual address %p is %#x.\n", PAGE0, *((uint32_t *) PAGE0));	
+	printf("Value at virtual address %p is %#x.\n", PAGE1, *((uint32_t *) PAGE1));
 
 	ASSERT(v0 == 0);
Index: test/mm/purge1/test.c
===================================================================
--- test/mm/purge1/test.c	(revision 7ee0e2fa610021a3023ca5ce1f183ca5f3f759d2)
+++ test/mm/purge1/test.c	(revision 0ffa3ef51d117153ad4c8c5fdb3b525ff042ef01)
@@ -38,5 +38,5 @@
 
 extern void tlb_invalidate_all(void);
-extern void tlb_invalidate_pages(asid_t asid, __address va, count_t cnt);
+extern void tlb_invalidate_pages(asid_t asid, uintptr_t va, count_t cnt);
 void test(void)
 {
Index: test/mm/slab1/test.c
===================================================================
--- test/mm/slab1/test.c	(revision 7ee0e2fa610021a3023ca5ce1f183ca5f3f759d2)
+++ test/mm/slab1/test.c	(revision 0ffa3ef51d117153ad4c8c5fdb3b525ff042ef01)
@@ -50,5 +50,5 @@
 	for (i=0; i < count; i++) {
 		data[i] = slab_alloc(cache, 0);
-		memsetb((__address)data[i], size, 0);
+		memsetb((uintptr_t)data[i], size, 0);
 	}
 	printf("done.\n");
@@ -62,5 +62,5 @@
 	for (i=0; i < count; i++) {
 		data[i] = slab_alloc(cache, 0);
-		memsetb((__address)data[i], size, 0);
+		memsetb((uintptr_t)data[i], size, 0);
 	}
 	printf("done.\n");
@@ -75,5 +75,5 @@
 	for (i=count/2; i < count; i++) {
 		data[i] = slab_alloc(cache, 0);
-		memsetb((__address)data[i], size, 0);
+		memsetb((uintptr_t)data[i], size, 0);
 	}
 	printf("done.\n");
@@ -111,5 +111,5 @@
 static void slabtest(void *data)
 {
-	int offs = (int)(__native) data;
+	int offs = (int)(unative_t) data;
 	int i,j;
 	
@@ -141,5 +141,5 @@
 	semaphore_initialize(&thr_sem,0);
 	for (i=0; i<THREADS; i++) {  
-		if (!(t = thread_create(slabtest, (void *)(__native)i, TASK, 0, "slabtest")))
+		if (!(t = thread_create(slabtest, (void *)(unative_t)i, TASK, 0, "slabtest")))
 			panic("could not create thread\n");
 		thread_ready(t);
Index: test/mm/slab2/test.c
===================================================================
--- test/mm/slab2/test.c	(revision 7ee0e2fa610021a3023ca5ce1f183ca5f3f759d2)
+++ test/mm/slab2/test.c	(revision 0ffa3ef51d117153ad4c8c5fdb3b525ff042ef01)
@@ -68,6 +68,6 @@
 			break;
 		}
-		memsetb((__address)data1, ITEM_SIZE, 0);
-		memsetb((__address)data2, ITEM_SIZE, 0);
+		memsetb((uintptr_t)data1, ITEM_SIZE, 0);
+		memsetb((uintptr_t)data2, ITEM_SIZE, 0);
 		*((void **)data1) = olddata1;
 		*((void **)data2) = olddata2;
@@ -91,5 +91,5 @@
 			panic("Incorrect memory size - use another test.");
 		}
-		memsetb((__address)data1, ITEM_SIZE, 0);
+		memsetb((uintptr_t)data1, ITEM_SIZE, 0);
 		*((void **)data1) = olddata1;
 		olddata1 = data1;
@@ -100,5 +100,5 @@
 			break;
 		}
-		memsetb((__address)data1, ITEM_SIZE, 0);
+		memsetb((uintptr_t)data1, ITEM_SIZE, 0);
 		*((void **)data1) = olddata1;
 		olddata1 = data1;
Index: test/print/print1/test.c
===================================================================
--- test/print/print1/test.c	(revision 7ee0e2fa610021a3023ca5ce1f183ca5f3f759d2)
+++ test/print/print1/test.c	(revision 0ffa3ef51d117153ad4c8c5fdb3b525ff042ef01)
@@ -34,5 +34,5 @@
 {
 	int retval;
-	__native nat = 0x12345678u;
+	unative_t nat = 0x12345678u;
 	
 	char buffer[BUFFER_SIZE];
@@ -50,5 +50,5 @@
 	printf(" 0xint: x '%#x', 5.3x '%#5.3x', -5.3x '%#-5.3x', 3.5x '%#3.5x', -3.5x '%#-3.5x' \n",17, 17, 17, 17, 17 );
 
-	printf("'%#llx' 64bit, '%#x' 32bit, '%#hhx' 8bit, '%#hx' 16bit, __native '%#zx'. '%#llx' 64bit and '%s' string.\n", 0x1234567887654321ll, 0x12345678, 0x12, 0x1234, nat, 0x1234567887654321ull, "Lovely string" );
+	printf("'%#llx' 64bit, '%#x' 32bit, '%#hhx' 8bit, '%#hx' 16bit, unative_t '%#zx'. '%#llx' 64bit and '%s' string.\n", 0x1234567887654321ll, 0x12345678, 0x12, 0x1234, nat, 0x1234567887654321ull, "Lovely string" );
 	
 	printf(" Print to NULL '%s'\n",NULL);
Index: test/synch/rwlock4/test.c
===================================================================
--- test/synch/rwlock4/test.c	(revision 7ee0e2fa610021a3023ca5ce1f183ca5f3f759d2)
+++ test/synch/rwlock4/test.c	(revision 0ffa3ef51d117153ad4c8c5fdb3b525ff042ef01)
@@ -51,7 +51,7 @@
 static waitq_t can_start;
 
-__u32 seed = 0xdeadbeef;
+uint32_t seed = 0xdeadbeef;
 
-static __u32 random(__u32 max);
+static uint32_t random(uint32_t max);
 
 static void writer(void *arg);
@@ -59,7 +59,7 @@
 static void failed(void);
 
-__u32 random(__u32 max)
+uint32_t random(uint32_t max)
 {
-	__u32 rc;
+	uint32_t rc;
 
 	spinlock_lock(&lock);	
@@ -122,5 +122,5 @@
 {
 	context_t ctx;
-	__u32 i, k;
+	uint32_t i, k;
 	
 	printf("Read/write locks test #4\n");
Index: test/synch/semaphore2/test.c
===================================================================
--- test/synch/semaphore2/test.c	(revision 7ee0e2fa610021a3023ca5ce1f183ca5f3f759d2)
+++ test/synch/semaphore2/test.c	(revision 0ffa3ef51d117153ad4c8c5fdb3b525ff042ef01)
@@ -46,14 +46,14 @@
 static waitq_t can_start;
 
-__u32 seed = 0xdeadbeef;
+uint32_t seed = 0xdeadbeef;
 
-static __u32 random(__u32 max);
+static uint32_t random(uint32_t max);
 
 static void consumer(void *arg);
 static void failed(void);
 
-__u32 random(__u32 max)
+uint32_t random(uint32_t max)
 {
-	__u32 rc;
+	uint32_t rc;
 
 	spinlock_lock(&lock);	
@@ -96,5 +96,5 @@
 void test(void)
 {
-	__u32 i, k;
+	uint32_t i, k;
 	
 	printf("Semaphore test #2\n");
Index: test/sysinfo/test.c
===================================================================
--- test/sysinfo/test.c	(revision 7ee0e2fa610021a3023ca5ce1f183ca5f3f759d2)
+++ test/sysinfo/test.c	(revision 0ffa3ef51d117153ad4c8c5fdb3b525ff042ef01)
@@ -34,7 +34,7 @@
 #include <sysinfo/sysinfo.h>
 /*
-static __native counter(sysinfo_item_t *root)
+static unative_t counter(sysinfo_item_t *root)
 {
-	static __native i=0;
+	static unative_t i=0;
 	return i++;
 }*/
