Index: kernel/test/avltree/avltree1.c
===================================================================
--- kernel/test/avltree/avltree1.c	(revision 6c441cf8f35799043d891a3a77032e1b0e49112b)
+++ kernel/test/avltree/avltree1.c	(revision cd8ad523401f883e29a5bd5c6ac5d359a1a1dc53)
@@ -62,5 +62,5 @@
 		tmp = test_tree_parents(node->lft);
 		if (tmp != node) {
-			printf("Bad parent pointer key: %d, address: %p\n",
+			printf("Bad parent pointer key: %" PRIu64 ", address: %p\n",
 			    tmp->key, node->lft);
 		}
@@ -69,5 +69,5 @@
 		tmp = test_tree_parents(node->rgt);
 		if (tmp != node) {
-			printf("Bad parent pointer key: %d, address: %p\n",
+			printf("Bad parent pointer key: %" PRIu64 ", address: %p\n",
 			    tmp->key,node->rgt);
 		}
@@ -110,5 +110,5 @@
 		return;
 
-	printf("%d[%d]", node->key, node->balance);
+	printf("%" PRIu64 "[%" PRIu8 "]", node->key, node->balance);
 	if (node->lft != NULL || node->rgt != NULL) {
 		printf("(");
@@ -192,5 +192,5 @@
 	
 	if (!quiet)
-		printf("Inserting %d nodes...", node_count);
+		printf("Inserting %" PRIc " nodes...", node_count);
 
 	for (i = 0; i < node_count; i++) {
Index: kernel/test/fpu/fpu1.c
===================================================================
--- kernel/test/fpu/fpu1.c	(revision 6c441cf8f35799043d891a3a77032e1b0e49112b)
+++ kernel/test/fpu/fpu1.c	(revision cd8ad523401f883e29a5bd5c6ac5d359a1a1dc53)
@@ -127,5 +127,5 @@
 		if ((int) (100000000 * e) != E_10e8) {
 			if (!sh_quiet)
-				printf("tid%llu: e*10e8=%zd should be %zd\n", THREAD->tid, (unative_t) (100000000 * e), (unative_t) E_10e8);
+				printf("tid%" PRIu64 ": e*10e8=%zd should be %" PRIun "\n", THREAD->tid, (unative_t) (100000000 * e), (unative_t) E_10e8);
 			atomic_inc(&threads_fault);
 			break;
@@ -162,5 +162,5 @@
 		if ((int) (1000000 * pi) != PI_10e8) {
 			if (!sh_quiet)
-				printf("tid%llu: pi*10e8=%zd should be %zd\n", THREAD->tid, (unative_t) (1000000 * pi), (unative_t) (PI_10e8 / 100));
+				printf("tid%" PRIu64 ": pi*10e8=%zd should be %" PRIun "\n", THREAD->tid, (unative_t) (1000000 * pi), (unative_t) (PI_10e8 / 100));
 			atomic_inc(&threads_fault);
 			break;
@@ -169,5 +169,5 @@
 		if ((int) (100000000 * pi) != PI_10e8) {
 			if (!sh_quiet)
-				printf("tid%llu: pi*10e8=%zd should be %zd\n", THREAD->tid, (unative_t) (100000000 * pi), (unative_t) PI_10e8);
+				printf("tid%" PRIu64 ": pi*10e8=%zd should be %" PRIun "\n", THREAD->tid, (unative_t) (100000000 * pi), (unative_t) PI_10e8);
 			atomic_inc(&threads_fault);
 			break;
@@ -188,5 +188,5 @@
 	
 	if (!quiet)
-		printf("Creating %d threads... ", 2 * THREADS);
+		printf("Creating %u threads... ", 2 * THREADS);
 
 	for (i = 0; i < THREADS; i++) {  
@@ -195,5 +195,5 @@
 		if (!(t = thread_create(e, NULL, TASK, 0, "e", false))) {
 			if (!quiet)
-				printf("could not create thread %d\n", 2 * i);
+				printf("could not create thread %u\n", 2 * i);
 			break;
 		}
@@ -203,5 +203,5 @@
 		if (!(t = thread_create(pi, NULL, TASK, 0, "pi", false))) {
 			if (!quiet)
-				printf("could not create thread %d\n", 2 * i + 1);
+				printf("could not create thread %u\n", 2 * i + 1);
 			break;
 		}
Index: kernel/test/fpu/mips2.c
===================================================================
--- kernel/test/fpu/mips2.c	(revision 6c441cf8f35799043d891a3a77032e1b0e49112b)
+++ kernel/test/fpu/mips2.c	(revision cd8ad523401f883e29a5bd5c6ac5d359a1a1dc53)
@@ -73,5 +73,5 @@
 		if (arg != after_arg) {
 			if (!sh_quiet)
-				printf("General reg tid%llu: arg(%d) != %d\n", THREAD->tid, arg, after_arg);
+				printf("General reg tid%" PRIu64 ": arg(%d) != %d\n", THREAD->tid, arg, after_arg);
 			atomic_inc(&threads_fault);
 			break;
@@ -105,5 +105,5 @@
 		if (arg != after_arg) {
 			if (!sh_quiet)
-				printf("General reg tid%llu: arg(%d) != %d\n", THREAD->tid, arg, after_arg);
+				printf("General reg tid%" PRIu64 ": arg(%d) != %d\n", THREAD->tid, arg, after_arg);
 			atomic_inc(&threads_fault);
 			break;
@@ -124,5 +124,5 @@
 	
 	if (!quiet)
-		printf("Creating %d threads... ", 2 * THREADS);
+		printf("Creating %u threads... ", 2 * THREADS);
 
 	for (i = 0; i < THREADS; i++) {
@@ -131,5 +131,5 @@
 		if (!(t = thread_create(testit1, (void *) ((unative_t) 2 * i), TASK, 0, "testit1", false))) {
 			if (!quiet)
-				printf("could not create thread %d\n", 2 * i);
+				printf("could not create thread %u\n", 2 * i);
 			break;
 		}
@@ -139,5 +139,5 @@
 		if (!(t = thread_create(testit2, (void *) ((unative_t) 2 * i + 1), TASK, 0, "testit2", false))) {
 			if (!quiet)
-				printf("could not create thread %d\n", 2 * i + 1);
+				printf("could not create thread %u\n", 2 * i + 1);
 			break;
 		}
Index: kernel/test/fpu/sse1.c
===================================================================
--- kernel/test/fpu/sse1.c	(revision 6c441cf8f35799043d891a3a77032e1b0e49112b)
+++ kernel/test/fpu/sse1.c	(revision cd8ad523401f883e29a5bd5c6ac5d359a1a1dc53)
@@ -73,5 +73,5 @@
 		if (arg != after_arg) {
 			if (!sh_quiet)
-				printf("tid%llu: arg(%d) != %d\n", THREAD->tid, arg, after_arg);
+				printf("tid%" PRIu64 ": arg(%d) != %d\n", THREAD->tid, arg, after_arg);
 			atomic_inc(&threads_fault);
 			break;
@@ -105,5 +105,5 @@
 		if (arg != after_arg) {
 			if (!sh_quiet)
-				printf("tid%llu: arg(%d) != %d\n", THREAD->tid, arg, after_arg);
+				printf("tid%" PRIu64 ": arg(%d) != %d\n", THREAD->tid, arg, after_arg);
 			atomic_inc(&threads_fault);
 			break;
@@ -124,5 +124,5 @@
 	
 	if (!quiet)
-		printf("Creating %d threads... ", 2 * THREADS);
+		printf("Creating %u threads... ", 2 * THREADS);
 
 	for (i = 0; i < THREADS; i++) {
@@ -131,5 +131,5 @@
 		if (!(t = thread_create(testit1, (void *) ((unative_t) 2 * i), TASK, 0, "testit1", false))) {
 			if (!quiet)
-				printf("could not create thread %d\n", 2 * i);
+				printf("could not create thread %u\n", 2 * i);
 			break;
 		}
@@ -139,5 +139,5 @@
 		if (!(t = thread_create(testit2, (void *) ((unative_t) 2 * i + 1), TASK, 0, "testit2", false))) {
 			if (!quiet)
-				printf("could not create thread %d\n", 2 * i + 1);
+				printf("could not create thread %u\n", 2 * i + 1);
 			break;
 		}
Index: kernel/test/mm/falloc2.c
===================================================================
--- kernel/test/mm/falloc2.c	(revision 6c441cf8f35799043d891a3a77032e1b0e49112b)
+++ kernel/test/mm/falloc2.c	(revision cd8ad523401f883e29a5bd5c6ac5d359a1a1dc53)
@@ -59,5 +59,5 @@
 	if (frames == NULL) {
 		if (!sh_quiet)
-			printf("Thread #%llu (cpu%d): Unable to allocate frames\n", THREAD->tid, CPU->id);
+			printf("Thread #%" PRIu64 " (cpu%u): Unable to allocate frames\n", THREAD->tid, CPU->id);
 		atomic_inc(&thread_fail);
 		atomic_dec(&thread_count);
@@ -70,5 +70,5 @@
 		for (order = 0; order <= MAX_ORDER; order++) {
 			if (!sh_quiet)
-				printf("Thread #%llu (cpu%d): Allocating %d frames blocks ... \n", THREAD->tid, CPU->id, 1 << order);
+				printf("Thread #%" PRIu64 " (cpu%u): Allocating %d frames blocks ... \n", THREAD->tid, CPU->id, 1 << order);
 			
 			allocated = 0;
@@ -83,8 +83,8 @@
 			
 			if (!sh_quiet)
-				printf("Thread #%llu (cpu%d): %d blocks allocated.\n", THREAD->tid, CPU->id, allocated);
+				printf("Thread #%" PRIu64 " (cpu%u): %d blocks allocated.\n", THREAD->tid, CPU->id, allocated);
 			
 			if (!sh_quiet)
-				printf("Thread #%llu (cpu%d): Deallocating ... \n", THREAD->tid, CPU->id);
+				printf("Thread #%" PRIu64 " (cpu%u): Deallocating ... \n", THREAD->tid, CPU->id);
 			
 			for (i = 0; i < allocated; i++) {
@@ -92,5 +92,5 @@
 					if (((uint8_t *) frames[i])[k] != val) {
 						if (!sh_quiet)
-							printf("Thread #%llu (cpu%d): Unexpected data (%d) in block %p offset %#zx\n", THREAD->tid, CPU->id, ((char *) frames[i])[k], frames[i], k);
+							printf("Thread #%" PRIu64 " (cpu%u): Unexpected data (%c) in block %p offset %#" PRIi "\n", THREAD->tid, CPU->id, ((char *) frames[i])[k], frames[i], k);
 						atomic_inc(&thread_fail);
 						goto cleanup;
@@ -101,5 +101,5 @@
 			
 			if (!sh_quiet)
-				printf("Thread #%llu (cpu%d): Finished run.\n", THREAD->tid, CPU->id);
+				printf("Thread #%" PRIu64 " (cpu%u): Finished run.\n", THREAD->tid, CPU->id);
 		}
 	}
@@ -109,5 +109,5 @@
 	
 	if (!sh_quiet)
-		printf("Thread #%llu (cpu%d): Exiting\n", THREAD->tid, CPU->id);
+		printf("Thread #%" PRIu64 " (cpu%u): Exiting\n", THREAD->tid, CPU->id);
 	atomic_dec(&thread_count);
 }
@@ -125,5 +125,5 @@
 		if (!thrd) {
 			if (!quiet)
-				printf("Could not create thread %d\n", i);
+				printf("Could not create thread %u\n", i);
 			break;
 		}
@@ -133,5 +133,5 @@
 	while (atomic_get(&thread_count) > 0) {
 		if (!quiet)
-			printf("Threads left: %d\n", atomic_get(&thread_count));
+			printf("Threads left: %ld\n", atomic_get(&thread_count));
 		thread_sleep(1);
 	}
Index: kernel/test/mm/slab1.c
===================================================================
--- kernel/test/mm/slab1.c	(revision 6c441cf8f35799043d891a3a77032e1b0e49112b)
+++ kernel/test/mm/slab1.c	(revision cd8ad523401f883e29a5bd5c6ac5d359a1a1dc53)
@@ -138,5 +138,5 @@
 	
 	if (!sh_quiet)
-		printf("Starting thread #%llu...\n", THREAD->tid);
+		printf("Starting thread #%" PRIu64 "...\n", THREAD->tid);
 	
 	for (j = 0; j < 10; j++) {
@@ -152,5 +152,5 @@
 	
 	if (!sh_quiet)
-		printf("Thread #%llu finished\n", THREAD->tid);
+		printf("Thread #" PRIu64 " finished\n", THREAD->tid);
 	
 	semaphore_up(&thr_sem);
Index: kernel/test/mm/slab2.c
===================================================================
--- kernel/test/mm/slab2.c	(revision 6c441cf8f35799043d891a3a77032e1b0e49112b)
+++ kernel/test/mm/slab2.c	(revision cd8ad523401f883e29a5bd5c6ac5d359a1a1dc53)
@@ -151,9 +151,9 @@
 	
 	if (!sh_quiet)
-		printf("Starting thread #%llu...\n",THREAD->tid);
+		printf("Starting thread #%" PRIu64 "...\n", THREAD->tid);
 
 	/* Alloc all */
 	if (!sh_quiet)
-		printf("Thread #%llu allocating...\n", THREAD->tid);
+		printf("Thread #%" PRIu64 " allocating...\n", THREAD->tid);
 	
 	while (1) {
@@ -167,5 +167,5 @@
 	
 	if (!sh_quiet)
-		printf("Thread #%llu releasing...\n", THREAD->tid);
+		printf("Thread #%" PRIu64 " releasing...\n", THREAD->tid);
 	
 	while (data) {
@@ -177,5 +177,5 @@
 	
 	if (!sh_quiet)
-		printf("Thread #%llu allocating...\n", THREAD->tid);
+		printf("Thread #%" PRIu64 " allocating...\n", THREAD->tid);
 	
 	while (1) {
@@ -189,5 +189,5 @@
 	
 	if (!sh_quiet)
-		printf("Thread #%llu releasing...\n", THREAD->tid);
+		printf("Thread #%" PRIu64 " releasing...\n", THREAD->tid);
 	
 	while (data) {
@@ -199,5 +199,5 @@
 	
 	if (!sh_quiet)
-		printf("Thread #%llu finished\n", THREAD->tid);
+		printf("Thread #%" PRIu64 " finished\n", THREAD->tid);
 	
 	slab_print_list();
Index: kernel/test/print/print1.c
===================================================================
--- kernel/test/print/print1.c	(revision 6c441cf8f35799043d891a3a77032e1b0e49112b)
+++ kernel/test/print/print1.c	(revision cd8ad523401f883e29a5bd5c6ac5d359a1a1dc53)
@@ -45,10 +45,10 @@
 		printf(" very long text 8.10s %8.10s \n", "very long text");
 		
-		printf(" char: c '%c', 3.2c '%3.2c', -3.2c '%-3.2c', 2.3c '%2.3c', -2.3c '%-2.3c' \n",'a', 'b', 'c', 'd', 'e' );
-		printf(" int: d '%d', 3.2d '%3.2d', -3.2d '%-3.2d', 2.3d '%2.3d', -2.3d '%-2.3d' \n",1, 1, 1, 1, 1 );
-		printf(" -int: d '%d', 3.2d '%3.2d', -3.2d '%-3.2d', 2.3d '%2.3d', -2.3d '%-2.3d' \n",-1, -1, -1, -1, -1 );
-		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(" char: c '%c', 3.2c '%3.2c', -3.2c '%-3.2c', 2.3c '%2.3c', -2.3c '%-2.3c' \n", 'a', 'b', 'c', 'd', 'e');
+		printf(" int: d '%d', 3.2d '%3.2d', -3.2d '%-3.2d', 2.3d '%2.3d', -2.3d '%-2.3d' \n", 1, 1, 1, 1, 1);
+		printf(" -int: d '%d', 3.2d '%3.2d', -3.2d '%-3.2d', 2.3d '%2.3d', -2.3d '%-2.3d' \n", -1, -1, -1, -1, -1);
+		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, unative_t '%#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 '%#" PRIxn "'. '%#llx' 64bit and '%s' string.\n", 0x1234567887654321ll, 0x12345678, 0x12, 0x1234, nat, 0x1234567887654321ull, "Lovely string" );
 		
 		printf(" Print to NULL '%s'\n", NULL);
Index: kernel/test/synch/rwlock3.c
===================================================================
--- kernel/test/synch/rwlock3.c	(revision 6c441cf8f35799043d891a3a77032e1b0e49112b)
+++ kernel/test/synch/rwlock3.c	(revision cd8ad523401f883e29a5bd5c6ac5d359a1a1dc53)
@@ -46,5 +46,5 @@
 	
 	if (!sh_quiet)
-		printf("cpu%d, tid %llu: trying to lock rwlock for reading....\n", CPU->id, THREAD->tid);
+		printf("cpu%u, tid %" PRIu64 ": trying to lock rwlock for reading....\n", CPU->id, THREAD->tid);
 	
 	rwlock_read_lock(&rwlock);
@@ -52,6 +52,6 @@
 	
 	if (!sh_quiet) {
-		printf("cpu%d, tid %llu: success\n", CPU->id, THREAD->tid);    		
-		printf("cpu%d, tid %llu: trying to lock rwlock for writing....\n", CPU->id, THREAD->tid);    	
+		printf("cpu%u, tid %" PRIu64 ": success\n", CPU->id, THREAD->tid);    		
+		printf("cpu%u, tid %" PRIu64 ": trying to lock rwlock for writing....\n", CPU->id, THREAD->tid);    	
 	}
 
@@ -60,5 +60,5 @@
 	
 	if (!sh_quiet)
-		printf("cpu%d, tid %llu: success\n", CPU->id, THREAD->tid);
+		printf("cpu%u, tid %" PRIu64 ": success\n", CPU->id, THREAD->tid);
 	
 	atomic_dec(&thread_count);
@@ -89,5 +89,5 @@
 	while (atomic_get(&thread_count) > 0) {
 		if (!quiet)
-			printf("Threads left: %d\n", atomic_get(&thread_count));
+			printf("Threads left: %ld\n", atomic_get(&thread_count));
 		thread_sleep(1);
 	}
Index: kernel/test/synch/rwlock4.c
===================================================================
--- kernel/test/synch/rwlock4.c	(revision 6c441cf8f35799043d891a3a77032e1b0e49112b)
+++ kernel/test/synch/rwlock4.c	(revision cd8ad523401f883e29a5bd5c6ac5d359a1a1dc53)
@@ -75,10 +75,10 @@
 	
 	if (!sh_quiet)
-		printf("cpu%d, tid %llu w+ (%d)\n", CPU->id, THREAD->tid, to);
+		printf("cpu%u, tid %" PRIu64 " w+ (%d)\n", CPU->id, THREAD->tid, to);
 	
 	rc = rwlock_write_lock_timeout(&rwlock, to);
 	if (SYNCH_FAILED(rc)) {
 		if (!sh_quiet)
-			printf("cpu%d, tid %llu w!\n", CPU->id, THREAD->tid);
+			printf("cpu%u, tid %" PRIu64 " w!\n", CPU->id, THREAD->tid);
 		atomic_dec(&thread_count);
 		return;
@@ -86,5 +86,5 @@
 	
 	if (!sh_quiet)
-		printf("cpu%d, tid %llu w=\n", CPU->id, THREAD->tid);
+		printf("cpu%u, tid %" PRIu64 " w=\n", CPU->id, THREAD->tid);
 
 	if (rwlock.readers_in) {
@@ -107,5 +107,5 @@
 	
 	if (!sh_quiet)
-		printf("cpu%d, tid %llu w-\n", CPU->id, THREAD->tid);
+		printf("cpu%u, tid %" PRIu64 " w-\n", CPU->id, THREAD->tid);
 	atomic_dec(&thread_count);
 }
@@ -120,10 +120,10 @@
 	
 	if (!sh_quiet)
-		printf("cpu%d, tid %llu r+ (%d)\n", CPU->id, THREAD->tid, to);
+		printf("cpu%u, tid %" PRIu64 " r+ (%d)\n", CPU->id, THREAD->tid, to);
 	
 	rc = rwlock_read_lock_timeout(&rwlock, to);
 	if (SYNCH_FAILED(rc)) {
 		if (!sh_quiet)
-			printf("cpu%d, tid %llu r!\n", CPU->id, THREAD->tid);
+			printf("cpu%u, tid %" PRIu64 " r!\n", CPU->id, THREAD->tid);
 		atomic_dec(&thread_count);
 		return;
@@ -131,5 +131,5 @@
 	
 	if (!sh_quiet)
-		printf("cpu%d, tid %llu r=\n", CPU->id, THREAD->tid);
+		printf("cpu%u, tid %" PRIu64 " r=\n", CPU->id, THREAD->tid);
 	
 	thread_usleep(30000);
@@ -137,5 +137,5 @@
 	
 	if (!sh_quiet)
-		printf("cpu%d, tid %llu r-\n", CPU->id, THREAD->tid);
+		printf("cpu%u, tid %" PRIu64 " r-\n", CPU->id, THREAD->tid);
 	atomic_dec(&thread_count);
 }
@@ -160,6 +160,6 @@
 	context_save(&ctx);
 	if (!quiet) {
-		printf("sp=%#x, readers_in=%d\n", ctx.sp, rwlock.readers_in);
-		printf("Creating %d readers\n", rd);
+		printf("sp=%#x, readers_in=%" PRIc "\n", ctx.sp, rwlock.readers_in);
+		printf("Creating %" PRIu32 " readers\n", rd);
 	}
 	
@@ -169,9 +169,9 @@
 			thread_ready(thrd);
 		else if (!quiet)
-			printf("Could not create reader %d\n", i);
+			printf("Could not create reader %" PRIu32 "\n", i);
 	}
 
 	if (!quiet)
-		printf("Creating %d writers\n", wr);
+		printf("Creating %" PRIu32 " writers\n", wr);
 	
 	for (i = 0; i < wr; i++) {
@@ -180,5 +180,5 @@
 			thread_ready(thrd);
 		else if (!quiet)
-			printf("Could not create writer %d\n", i);
+			printf("Could not create writer %" PRIu32 "\n", i);
 	}
 	
@@ -188,5 +188,5 @@
 	while (atomic_get(&thread_count) > 0) {
 		if (!quiet)
-			printf("Threads left: %d\n", atomic_get(&thread_count));
+			printf("Threads left: %ld\n", atomic_get(&thread_count));
 		thread_sleep(1);
 	}
Index: kernel/test/synch/rwlock5.c
===================================================================
--- kernel/test/synch/rwlock5.c	(revision 6c441cf8f35799043d891a3a77032e1b0e49112b)
+++ kernel/test/synch/rwlock5.c	(revision cd8ad523401f883e29a5bd5c6ac5d359a1a1dc53)
@@ -109,5 +109,5 @@
 	
 		while ((items_read.count != readers) || (items_written.count != writers)) {
-			printf("%zd readers remaining, %zd writers remaining, readers_in=%zd\n", readers - items_read.count, writers - items_written.count, rwlock.readers_in);
+			printf("%d readers remaining, %d writers remaining, readers_in=%d\n", readers - items_read.count, writers - items_written.count, rwlock.readers_in);
 			thread_usleep(100000);
 		}
Index: kernel/test/synch/semaphore2.c
===================================================================
--- kernel/test/synch/semaphore2.c	(revision 6c441cf8f35799043d891a3a77032e1b0e49112b)
+++ kernel/test/synch/semaphore2.c	(revision cd8ad523401f883e29a5bd5c6ac5d359a1a1dc53)
@@ -68,16 +68,16 @@
 	
 	to = random(20000);
-	printf("cpu%d, tid %llu down+ (%d)\n", CPU->id, THREAD->tid, to);
+	printf("cpu%u, tid %" PRIu64 " down+ (%d)\n", CPU->id, THREAD->tid, to);
 	rc = semaphore_down_timeout(&sem, to);
 	if (SYNCH_FAILED(rc)) {
-		printf("cpu%d, tid %llu down!\n", CPU->id, THREAD->tid);
+		printf("cpu%u, tid %" PRIu64 " down!\n", CPU->id, THREAD->tid);
 		return;
 	}
 	
-	printf("cpu%d, tid %llu down=\n", CPU->id, THREAD->tid);	
+	printf("cpu%u, tid %" PRIu64 " down=\n", CPU->id, THREAD->tid);	
 	thread_usleep(random(30000));
 	
 	semaphore_up(&sem);
-	printf("cpu%d, tid %llu up\n", CPU->id, THREAD->tid);
+	printf("cpu%u, tid %" PRIu64 " up\n", CPU->id, THREAD->tid);
 }
 
@@ -92,5 +92,5 @@
 	
 	k = random(7) + 1;
-	printf("Creating %d consumers\n", k);
+	printf("Creating %" PRIu32 " consumers\n", k);
 	for (i = 0; i < k; i++) {
 		thrd = thread_create(consumer, NULL, TASK, 0, "consumer", false);
Index: kernel/test/test.h
===================================================================
--- kernel/test/test.h	(revision 6c441cf8f35799043d891a3a77032e1b0e49112b)
+++ kernel/test/test.h	(revision cd8ad523401f883e29a5bd5c6ac5d359a1a1dc53)
@@ -37,10 +37,11 @@
 
 #include <arch/types.h>
+#include <typedefs.h>
 
-typedef char * (* test_entry_t)(bool);
+typedef char *(*test_entry_t)(bool);
 
 typedef struct {
-	char * name;
-	char * desc;
+	char *name;
+	char *desc;
 	test_entry_t entry;
 	bool safe;
Index: kernel/test/thread/thread1.c
===================================================================
--- kernel/test/thread/thread1.c	(revision 6c441cf8f35799043d891a3a77032e1b0e49112b)
+++ kernel/test/thread/thread1.c	(revision cd8ad523401f883e29a5bd5c6ac5d359a1a1dc53)
@@ -49,5 +49,5 @@
 	while (atomic_get(&finish)) {
 		if (!sh_quiet)
-			printf("%llu ", THREAD->tid);
+			printf("%" PRIu64 " ", THREAD->tid);
 		thread_usleep(100000);
 	}
