Index: kernel/test/fpu/fpu1.c
===================================================================
--- kernel/test/fpu/fpu1.c	(revision 2a98e584c41f86d1802d062b56836bf310529c13)
+++ kernel/test/fpu/fpu1.c	(revision 7cb567cd74caf371a5b1b053095a12b9bd1704a6)
@@ -127,5 +127,5 @@
 		if ((int) (100000000 * e) != E_10e8) {
 			if (!sh_quiet)
-				printf("tid%d: e*10e8=%zd should be %zd\n", THREAD->tid, (unative_t) (100000000 * e), (unative_t) E_10e8);
+				printf("tid%llu: e*10e8=%zd should be %zd\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%d: pi*10e8=%zd should be %zd\n", THREAD->tid, (unative_t) (1000000 * pi), (unative_t) (PI_10e8 / 100));
+				printf("tid%llu: pi*10e8=%zd should be %zd\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%d: pi*10e8=%zd should be %zd\n", THREAD->tid, (unative_t) (100000000 * pi), (unative_t) PI_10e8);
+				printf("tid%llu: pi*10e8=%zd should be %zd\n", THREAD->tid, (unative_t) (100000000 * pi), (unative_t) PI_10e8);
 			atomic_inc(&threads_fault);
 			break;
Index: kernel/test/fpu/mips2.c
===================================================================
--- kernel/test/fpu/mips2.c	(revision 2a98e584c41f86d1802d062b56836bf310529c13)
+++ kernel/test/fpu/mips2.c	(revision 7cb567cd74caf371a5b1b053095a12b9bd1704a6)
@@ -73,5 +73,5 @@
 		if (arg != after_arg) {
 			if (!sh_quiet)
-				printf("General reg tid%d: arg(%d) != %d\n", THREAD->tid, arg, after_arg);
+				printf("General reg tid%llu: 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%d: arg(%d) != %d\n", THREAD->tid, arg, after_arg);
+				printf("General reg tid%llu: arg(%d) != %d\n", THREAD->tid, arg, after_arg);
 			atomic_inc(&threads_fault);
 			break;
Index: kernel/test/fpu/sse1.c
===================================================================
--- kernel/test/fpu/sse1.c	(revision 2a98e584c41f86d1802d062b56836bf310529c13)
+++ kernel/test/fpu/sse1.c	(revision 7cb567cd74caf371a5b1b053095a12b9bd1704a6)
@@ -73,5 +73,5 @@
 		if (arg != after_arg) {
 			if (!sh_quiet)
-				printf("tid%d: arg(%d) != %d\n", THREAD->tid, arg, after_arg);
+				printf("tid%llu: 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%d: arg(%d) != %d\n", THREAD->tid, arg, after_arg);
+				printf("tid%llu: arg(%d) != %d\n", THREAD->tid, arg, after_arg);
 			atomic_inc(&threads_fault);
 			break;
Index: kernel/test/mm/falloc2.c
===================================================================
--- kernel/test/mm/falloc2.c	(revision 2a98e584c41f86d1802d062b56836bf310529c13)
+++ kernel/test/mm/falloc2.c	(revision 7cb567cd74caf371a5b1b053095a12b9bd1704a6)
@@ -59,5 +59,5 @@
 	if (frames == NULL) {
 		if (!sh_quiet)
-			printf("Thread #%d (cpu%d): Unable to allocate frames\n", THREAD->tid, CPU->id);
+			printf("Thread #%llu (cpu%d): 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 #%d (cpu%d): Allocating %d frames blocks ... \n", THREAD->tid, CPU->id, 1 << order);
+				printf("Thread #%llu (cpu%d): Allocating %d frames blocks ... \n", THREAD->tid, CPU->id, 1 << order);
 			
 			allocated = 0;
@@ -83,8 +83,8 @@
 			
 			if (!sh_quiet)
-				printf("Thread #%d (cpu%d): %d blocks allocated.\n", THREAD->tid, CPU->id, allocated);
+				printf("Thread #%llu (cpu%d): %d blocks allocated.\n", THREAD->tid, CPU->id, allocated);
 			
 			if (!sh_quiet)
-				printf("Thread #%d (cpu%d): Deallocating ... \n", THREAD->tid, CPU->id);
+				printf("Thread #%llu (cpu%d): 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 #%d (cpu%d): Unexpected data (%d) in block %p offset %#zx\n", THREAD->tid, CPU->id, ((char *) frames[i])[k], frames[i], k);
+							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);
 						atomic_inc(&thread_fail);
 						goto cleanup;
@@ -101,5 +101,5 @@
 			
 			if (!sh_quiet)
-				printf("Thread #%d (cpu%d): Finished run.\n", THREAD->tid, CPU->id);
+				printf("Thread #%llu (cpu%d): Finished run.\n", THREAD->tid, CPU->id);
 		}
 	}
@@ -109,5 +109,5 @@
 	
 	if (!sh_quiet)
-		printf("Thread #%d (cpu%d): Exiting\n", THREAD->tid, CPU->id);
+		printf("Thread #%llu (cpu%d): Exiting\n", THREAD->tid, CPU->id);
 	atomic_dec(&thread_count);
 }
Index: kernel/test/mm/slab1.c
===================================================================
--- kernel/test/mm/slab1.c	(revision 2a98e584c41f86d1802d062b56836bf310529c13)
+++ kernel/test/mm/slab1.c	(revision 7cb567cd74caf371a5b1b053095a12b9bd1704a6)
@@ -138,5 +138,5 @@
 	
 	if (!sh_quiet)
-		printf("Starting thread #%d...\n", THREAD->tid);
+		printf("Starting thread #%llu...\n", THREAD->tid);
 	
 	for (j = 0; j < 10; j++) {
@@ -152,5 +152,5 @@
 	
 	if (!sh_quiet)
-		printf("Thread #%d finished\n", THREAD->tid);
+		printf("Thread #%llu finished\n", THREAD->tid);
 	
 	semaphore_up(&thr_sem);
Index: kernel/test/mm/slab2.c
===================================================================
--- kernel/test/mm/slab2.c	(revision 2a98e584c41f86d1802d062b56836bf310529c13)
+++ kernel/test/mm/slab2.c	(revision 7cb567cd74caf371a5b1b053095a12b9bd1704a6)
@@ -151,9 +151,9 @@
 	
 	if (!sh_quiet)
-		printf("Starting thread #%d...\n",THREAD->tid);
+		printf("Starting thread #%llu...\n",THREAD->tid);
 
 	/* Alloc all */
 	if (!sh_quiet)
-		printf("Thread #%d allocating...\n", THREAD->tid);
+		printf("Thread #%llu allocating...\n", THREAD->tid);
 	
 	while (1) {
@@ -167,5 +167,5 @@
 	
 	if (!sh_quiet)
-		printf("Thread #%d releasing...\n", THREAD->tid);
+		printf("Thread #%llu releasing...\n", THREAD->tid);
 	
 	while (data) {
@@ -177,5 +177,5 @@
 	
 	if (!sh_quiet)
-		printf("Thread #%d allocating...\n", THREAD->tid);
+		printf("Thread #%llu allocating...\n", THREAD->tid);
 	
 	while (1) {
@@ -189,5 +189,5 @@
 	
 	if (!sh_quiet)
-		printf("Thread #%d releasing...\n", THREAD->tid);
+		printf("Thread #%llu releasing...\n", THREAD->tid);
 	
 	while (data) {
@@ -199,5 +199,5 @@
 	
 	if (!sh_quiet)
-		printf("Thread #%d finished\n", THREAD->tid);
+		printf("Thread #%llu finished\n", THREAD->tid);
 	
 	slab_print_list();
Index: kernel/test/synch/rwlock3.c
===================================================================
--- kernel/test/synch/rwlock3.c	(revision 2a98e584c41f86d1802d062b56836bf310529c13)
+++ kernel/test/synch/rwlock3.c	(revision 7cb567cd74caf371a5b1b053095a12b9bd1704a6)
@@ -46,5 +46,5 @@
 	
 	if (!sh_quiet)
-		printf("cpu%d, tid %d: trying to lock rwlock for reading....\n", CPU->id, THREAD->tid);
+		printf("cpu%d, tid %llu: 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 %d: success\n", CPU->id, THREAD->tid);    		
-		printf("cpu%d, tid %d: trying to lock rwlock for writing....\n", CPU->id, THREAD->tid);    	
+		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);    	
 	}
 
@@ -60,5 +60,5 @@
 	
 	if (!sh_quiet)
-		printf("cpu%d, tid %d: success\n", CPU->id, THREAD->tid);
+		printf("cpu%d, tid %llu: success\n", CPU->id, THREAD->tid);
 	
 	atomic_dec(&thread_count);
Index: kernel/test/synch/rwlock4.c
===================================================================
--- kernel/test/synch/rwlock4.c	(revision 2a98e584c41f86d1802d062b56836bf310529c13)
+++ kernel/test/synch/rwlock4.c	(revision 7cb567cd74caf371a5b1b053095a12b9bd1704a6)
@@ -75,10 +75,10 @@
 	
 	if (!sh_quiet)
-		printf("cpu%d, tid %d w+ (%d)\n", CPU->id, THREAD->tid, to);
+		printf("cpu%d, tid %llu 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 %d w!\n", CPU->id, THREAD->tid);
+			printf("cpu%d, tid %llu w!\n", CPU->id, THREAD->tid);
 		atomic_dec(&thread_count);
 		return;
@@ -86,5 +86,5 @@
 	
 	if (!sh_quiet)
-		printf("cpu%d, tid %d w=\n", CPU->id, THREAD->tid);
+		printf("cpu%d, tid %llu w=\n", CPU->id, THREAD->tid);
 
 	if (rwlock.readers_in) {
@@ -107,5 +107,5 @@
 	
 	if (!sh_quiet)
-		printf("cpu%d, tid %d w-\n", CPU->id, THREAD->tid);
+		printf("cpu%d, tid %llu w-\n", CPU->id, THREAD->tid);
 	atomic_dec(&thread_count);
 }
@@ -120,10 +120,10 @@
 	
 	if (!sh_quiet)
-		printf("cpu%d, tid %d r+ (%d)\n", CPU->id, THREAD->tid, to);
+		printf("cpu%d, tid %llu 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 %d r!\n", CPU->id, THREAD->tid);
+			printf("cpu%d, tid %llu r!\n", CPU->id, THREAD->tid);
 		atomic_dec(&thread_count);
 		return;
@@ -131,5 +131,5 @@
 	
 	if (!sh_quiet)
-		printf("cpu%d, tid %d r=\n", CPU->id, THREAD->tid);
+		printf("cpu%d, tid %llu r=\n", CPU->id, THREAD->tid);
 	
 	thread_usleep(30000);
@@ -137,5 +137,5 @@
 	
 	if (!sh_quiet)
-		printf("cpu%d, tid %d r-\n", CPU->id, THREAD->tid);
+		printf("cpu%d, tid %llu r-\n", CPU->id, THREAD->tid);
 	atomic_dec(&thread_count);
 }
Index: kernel/test/synch/semaphore2.c
===================================================================
--- kernel/test/synch/semaphore2.c	(revision 2a98e584c41f86d1802d062b56836bf310529c13)
+++ kernel/test/synch/semaphore2.c	(revision 7cb567cd74caf371a5b1b053095a12b9bd1704a6)
@@ -68,16 +68,16 @@
 	
 	to = random(20000);
-	printf("cpu%d, tid %d down+ (%d)\n", CPU->id, THREAD->tid, to);
+	printf("cpu%d, tid %llu down+ (%d)\n", CPU->id, THREAD->tid, to);
 	rc = semaphore_down_timeout(&sem, to);
 	if (SYNCH_FAILED(rc)) {
-		printf("cpu%d, tid %d down!\n", CPU->id, THREAD->tid);
+		printf("cpu%d, tid %llu down!\n", CPU->id, THREAD->tid);
 		return;
 	}
 	
-	printf("cpu%d, tid %d down=\n", CPU->id, THREAD->tid);	
+	printf("cpu%d, tid %llu down=\n", CPU->id, THREAD->tid);	
 	thread_usleep(random(30000));
 	
 	semaphore_up(&sem);
-	printf("cpu%d, tid %d up\n", CPU->id, THREAD->tid);
+	printf("cpu%d, tid %llu up\n", CPU->id, THREAD->tid);
 }
 
Index: kernel/test/thread/thread1.c
===================================================================
--- kernel/test/thread/thread1.c	(revision 2a98e584c41f86d1802d062b56836bf310529c13)
+++ kernel/test/thread/thread1.c	(revision 7cb567cd74caf371a5b1b053095a12b9bd1704a6)
@@ -49,5 +49,5 @@
 	while (atomic_get(&finish)) {
 		if (!sh_quiet)
-			printf("%d ", (int) (THREAD->tid));
+			printf("%llu ", THREAD->tid);
 		thread_usleep(100000);
 	}
