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);
