Index: kernel/test/synch/rwlock1.c
===================================================================
--- kernel/test/synch/rwlock1.c	(revision 53634f9294eaa723f35916cf5364f8cd4ab720f8)
+++ kernel/test/synch/rwlock1.c	(revision a85aebde1fe7aa2a70f30bb24c64dade39325a93)
@@ -36,24 +36,24 @@
 #include <synch/rwlock.h>
 
-#define READERS		50
-#define WRITERS		50
+#define READERS  50
+#define WRITERS  50
 
 static rwlock_t rwlock;
 
-char * test_rwlock1(bool quiet)
+char *test_rwlock1(void)
 {
 	rwlock_initialize(&rwlock);
-
+	
 	rwlock_write_lock(&rwlock);
-	rwlock_write_unlock(&rwlock);	
-
-	rwlock_read_lock(&rwlock);
-	rwlock_read_lock(&rwlock);	
+	rwlock_write_unlock(&rwlock);
+	
 	rwlock_read_lock(&rwlock);
 	rwlock_read_lock(&rwlock);
 	rwlock_read_lock(&rwlock);
-
+	rwlock_read_lock(&rwlock);
+	rwlock_read_lock(&rwlock);
+	
 	rwlock_read_unlock(&rwlock);
-	rwlock_read_unlock(&rwlock);	
+	rwlock_read_unlock(&rwlock);
 	rwlock_read_unlock(&rwlock);
 	rwlock_read_unlock(&rwlock);
@@ -61,12 +61,12 @@
 	
 	rwlock_write_lock(&rwlock);
-	rwlock_write_unlock(&rwlock);	
-
+	rwlock_write_unlock(&rwlock);
+	
 	rwlock_read_lock(&rwlock);
 	rwlock_read_unlock(&rwlock);
-
+	
 	rwlock_write_lock(&rwlock);
-	rwlock_write_unlock(&rwlock);	
-
+	rwlock_write_unlock(&rwlock);
+	
 	rwlock_read_lock(&rwlock);
 	rwlock_read_unlock(&rwlock);
Index: kernel/test/synch/rwlock2.c
===================================================================
--- kernel/test/synch/rwlock2.c	(revision 53634f9294eaa723f35916cf5364f8cd4ab720f8)
+++ kernel/test/synch/rwlock2.c	(revision a85aebde1fe7aa2a70f30bb24c64dade39325a93)
@@ -35,36 +35,32 @@
 #include <synch/rwlock.h>
 
-#define READERS		50
-#define WRITERS		50
+#define READERS  50
+#define WRITERS  50
 
 static rwlock_t rwlock;
-static bool sh_quiet;
 
 static void writer(void *arg)
 {
-	if (!sh_quiet)
-		printf("Trying to lock rwlock for writing....\n");
+	TPRINTF("Trying to lock rwlock for writing....\n");
 	
 	rwlock_write_lock(&rwlock);
 	rwlock_write_unlock(&rwlock);
 	
-	if (!sh_quiet)
-		printf("Trying to lock rwlock for reading....\n");
+	TPRINTF("Trying to lock rwlock for reading....\n");
 	
 	rwlock_read_lock(&rwlock);
-	rwlock_read_unlock(&rwlock);	
+	rwlock_read_unlock(&rwlock);
 }
 
-char * test_rwlock2(bool quiet)
+char *test_rwlock2(void)
 {
 	thread_t *thrd;
-	sh_quiet = quiet;
 	
 	rwlock_initialize(&rwlock);
-
+	
 	rwlock_read_lock(&rwlock);
 	rwlock_read_lock(&rwlock);
 	rwlock_read_lock(&rwlock);
-	rwlock_read_lock(&rwlock);	
+	rwlock_read_lock(&rwlock);
 	
 	thrd = thread_create(writer, NULL, TASK, 0, "writer", false);
@@ -73,5 +69,5 @@
 	else
 		return "Could not create thread";
-
+	
 	thread_sleep(1);
 	
Index: kernel/test/synch/rwlock3.c
===================================================================
--- kernel/test/synch/rwlock3.c	(revision 53634f9294eaa723f35916cf5364f8cd4ab720f8)
+++ kernel/test/synch/rwlock3.c	(revision a85aebde1fe7aa2a70f30bb24c64dade39325a93)
@@ -35,9 +35,8 @@
 #include <synch/rwlock.h>
 
-#define THREADS	4
+#define THREADS  4
 
 static atomic_t thread_count;
 static rwlock_t rwlock;
-static bool sh_quiet;
 
 static void reader(void *arg)
@@ -45,29 +44,24 @@
 	thread_detach(THREAD);
 	
-	if (!sh_quiet)
-		printf("cpu%u, tid %" PRIu64 ": trying to lock rwlock for reading....\n", CPU->id, THREAD->tid);
+	TPRINTF("cpu%u, tid %" PRIu64 ": trying to lock rwlock for reading....\n", CPU->id, THREAD->tid);
 	
 	rwlock_read_lock(&rwlock);
 	rwlock_read_unlock(&rwlock);
 	
-	if (!sh_quiet) {
-		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);    	
-	}
-
+	TPRINTF("cpu%u, tid %" PRIu64 ": success\n", CPU->id, THREAD->tid);
+	TPRINTF("cpu%u, tid %" PRIu64 ": trying to lock rwlock for writing....\n", CPU->id, THREAD->tid);
+	
 	rwlock_write_lock(&rwlock);
 	rwlock_write_unlock(&rwlock);
 	
-	if (!sh_quiet)
-		printf("cpu%u, tid %" PRIu64 ": success\n", CPU->id, THREAD->tid);
+	TPRINTF("cpu%u, tid %" PRIu64 ": success\n", CPU->id, THREAD->tid);
 	
 	atomic_dec(&thread_count);
 }
 
-char * test_rwlock3(bool quiet)
+char *test_rwlock3(void)
 {
 	int i;
 	thread_t *thrd;
-	sh_quiet = quiet;
 	
 	atomic_set(&thread_count, THREADS);
@@ -80,14 +74,13 @@
 		if (thrd)
 			thread_ready(thrd);
-		else if (!quiet)
-			printf("Could not create reader %d\n", i);
+		else
+			TPRINTF("Could not create reader %d\n", i);
 	}
-
+	
 	thread_sleep(1);
 	rwlock_write_unlock(&rwlock);
 	
 	while (atomic_get(&thread_count) > 0) {
-		if (!quiet)
-			printf("Threads left: %ld\n", atomic_get(&thread_count));
+		TPRINTF("Threads left: %ld\n", atomic_get(&thread_count));
 		thread_sleep(1);
 	}
Index: kernel/test/synch/rwlock4.c
===================================================================
--- kernel/test/synch/rwlock4.c	(revision 53634f9294eaa723f35916cf5364f8cd4ab720f8)
+++ kernel/test/synch/rwlock4.c	(revision a85aebde1fe7aa2a70f30bb24c64dade39325a93)
@@ -41,11 +41,10 @@
 #include <synch/spinlock.h>
 
-#define READERS		50
-#define WRITERS		50
+#define READERS  50
+#define WRITERS  50
 
 static atomic_t thread_count;
 static rwlock_t rwlock;
 static atomic_t threads_fault;
-static bool sh_quiet;
 
 SPINLOCK_INITIALIZE(rw_lock);
@@ -58,6 +57,6 @@
 {
 	uint32_t rc;
-
-	spinlock_lock(&rw_lock);	
+	
+	spinlock_lock(&rw_lock);
 	rc = seed % max;
 	seed = (((seed << 2) ^ (seed >> 2)) * 487) + rc;
@@ -71,41 +70,37 @@
 	thread_detach(THREAD);
 	waitq_sleep(&can_start);
-
+	
 	to = random(40000);
 	
-	if (!sh_quiet)
-		printf("cpu%u, tid %" PRIu64 " w+ (%d)\n", CPU->id, THREAD->tid, to);
+	TPRINTF("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%u, tid %" PRIu64 " w!\n", CPU->id, THREAD->tid);
+		TPRINTF("cpu%u, tid %" PRIu64 " w!\n", CPU->id, THREAD->tid);
 		atomic_dec(&thread_count);
 		return;
 	}
 	
-	if (!sh_quiet)
-		printf("cpu%u, tid %" PRIu64 " w=\n", CPU->id, THREAD->tid);
-
+	TPRINTF("cpu%u, tid %" PRIu64 " w=\n", CPU->id, THREAD->tid);
+	
 	if (rwlock.readers_in) {
-		if (!sh_quiet)
-			printf("Oops.");
+		TPRINTF("Oops.\n");
 		atomic_inc(&threads_fault);
 		atomic_dec(&thread_count);
 		return;
 	}
+	
 	thread_usleep(random(1000000));
+	
 	if (rwlock.readers_in) {
-		if (!sh_quiet)
-			printf("Oops.");	
+		TPRINTF("Oops.\n");
 		atomic_inc(&threads_fault);
 		atomic_dec(&thread_count);
 		return;
 	}
-
+	
 	rwlock_write_unlock(&rwlock);
 	
-	if (!sh_quiet)
-		printf("cpu%u, tid %" PRIu64 " w-\n", CPU->id, THREAD->tid);
+	TPRINTF("cpu%u, tid %" PRIu64 " w-\n", CPU->id, THREAD->tid);
 	atomic_dec(&thread_count);
 }
@@ -119,31 +114,26 @@
 	to = random(2000);
 	
-	if (!sh_quiet)
-		printf("cpu%u, tid %" PRIu64 " r+ (%d)\n", CPU->id, THREAD->tid, to);
+	TPRINTF("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%u, tid %" PRIu64 " r!\n", CPU->id, THREAD->tid);
+		TPRINTF("cpu%u, tid %" PRIu64 " r!\n", CPU->id, THREAD->tid);
 		atomic_dec(&thread_count);
 		return;
 	}
 	
-	if (!sh_quiet)
-		printf("cpu%u, tid %" PRIu64 " r=\n", CPU->id, THREAD->tid);
+	TPRINTF("cpu%u, tid %" PRIu64 " r=\n", CPU->id, THREAD->tid);
 	
 	thread_usleep(30000);
 	rwlock_read_unlock(&rwlock);
 	
-	if (!sh_quiet)
-		printf("cpu%u, tid %" PRIu64 " r-\n", CPU->id, THREAD->tid);
+	TPRINTF("cpu%u, tid %" PRIu64 " r-\n", CPU->id, THREAD->tid);
 	atomic_dec(&thread_count);
 }
 
-char * test_rwlock4(bool quiet)
+char *test_rwlock4(void)
 {
 	context_t ctx;
 	uint32_t i;
-	sh_quiet = quiet;
 	
 	waitq_initialize(&can_start);
@@ -159,8 +149,6 @@
 	
 	context_save(&ctx);
-	if (!quiet) {
-		printf("sp=%#x, readers_in=%" PRIc "\n", ctx.sp, rwlock.readers_in);
-		printf("Creating %" PRIu32 " readers\n", rd);
-	}
+	TPRINTF("sp=%#x, readers_in=%" PRIc "\n", ctx.sp, rwlock.readers_in);
+	TPRINTF("Creating %" PRIu32 " readers\n", rd);
 	
 	for (i = 0; i < rd; i++) {
@@ -168,10 +156,9 @@
 		if (thrd)
 			thread_ready(thrd);
-		else if (!quiet)
-			printf("Could not create reader %" PRIu32 "\n", i);
+		else
+			TPRINTF("Could not create reader %" PRIu32 "\n", i);
 	}
-
-	if (!quiet)
-		printf("Creating %" PRIu32 " writers\n", wr);
+	
+	TPRINTF("Creating %" PRIu32 " writers\n", wr);
 	
 	for (i = 0; i < wr; i++) {
@@ -179,6 +166,6 @@
 		if (thrd)
 			thread_ready(thrd);
-		else if (!quiet)
-			printf("Could not create writer %" PRIu32 "\n", i);
+		else
+			TPRINTF("Could not create writer %" PRIu32 "\n", i);
 	}
 	
@@ -187,6 +174,5 @@
 	
 	while (atomic_get(&thread_count) > 0) {
-		if (!quiet)
-			printf("Threads left: %ld\n", atomic_get(&thread_count));
+		TPRINTF("Threads left: %ld\n", atomic_get(&thread_count));
 		thread_sleep(1);
 	}
Index: kernel/test/synch/rwlock5.c
===================================================================
--- kernel/test/synch/rwlock5.c	(revision 53634f9294eaa723f35916cf5364f8cd4ab720f8)
+++ kernel/test/synch/rwlock5.c	(revision a85aebde1fe7aa2a70f30bb24c64dade39325a93)
@@ -36,6 +36,6 @@
 #include <synch/rwlock.h>
 
-#define READERS		50
-#define WRITERS		50
+#define READERS  50
+#define WRITERS  50
 
 static rwlock_t rwlock;
@@ -48,7 +48,7 @@
 {
 	thread_detach(THREAD);
-
+	
 	waitq_sleep(&can_start);
-
+	
 	rwlock_write_lock(&rwlock);
 	atomic_inc(&items_written);
@@ -59,5 +59,5 @@
 {
 	thread_detach(THREAD);
-
+	
 	waitq_sleep(&can_start);
 	
@@ -67,5 +67,5 @@
 }
 
-char * test_rwlock5(bool quiet)
+char *test_rwlock5(void)
 {
 	int i, j, k;
@@ -77,12 +77,12 @@
 	for (i = 1; i <= 3; i++) {
 		thread_t *thrd;
-
+		
 		atomic_set(&items_read, 0);
 		atomic_set(&items_written, 0);
-
+		
 		readers = i * READERS;
 		writers = (4 - i) * WRITERS;
-
-		printf("Creating %ld readers and %ld writers...", readers, writers);
+		
+		TPRINTF("Creating %ld readers and %ld writers...", readers, writers);
 		
 		for (j = 0; j < (READERS + WRITERS) / 2; j++) {
@@ -92,5 +92,5 @@
 					thread_ready(thrd);
 				else
-					printf("Could not create reader %d\n", k);
+					TPRINTF("Could not create reader %d\n", k);
 			}
 			for (k = 0; k < (4 - i); k++) {
@@ -99,15 +99,15 @@
 					thread_ready(thrd);
 				else
-					printf("Could not create writer %d\n", k);
+					TPRINTF("Could not create writer %d\n", k);
 			}
 		}
-
-		printf("ok\n");
-
+		
+		TPRINTF("ok\n");
+		
 		thread_sleep(1);
 		waitq_wakeup(&can_start, WAKEUP_ALL);
-	
+		
 		while ((items_read.count != readers) || (items_written.count != writers)) {
-			printf("%d readers remaining, %d writers remaining, readers_in=%d\n", readers - items_read.count, writers - items_written.count, rwlock.readers_in);
+			TPRINTF("%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/semaphore1.c
===================================================================
--- kernel/test/synch/semaphore1.c	(revision 53634f9294eaa723f35916cf5364f8cd4ab720f8)
+++ kernel/test/synch/semaphore1.c	(revision a85aebde1fe7aa2a70f30bb24c64dade39325a93)
@@ -36,7 +36,7 @@
 #include <synch/semaphore.h>
 
-#define AT_ONCE			3
-#define PRODUCERS		50
-#define CONSUMERS		50
+#define AT_ONCE    3
+#define PRODUCERS  50
+#define CONSUMERS  50
 
 static semaphore_t sem;
@@ -48,8 +48,8 @@
 static void producer(void *arg)
 {
-	thread_detach(THREAD);	
-
+	thread_detach(THREAD);
+	
 	waitq_sleep(&can_start);
-	    
+	
 	semaphore_down(&sem);
 	atomic_inc(&items_produced);
@@ -60,5 +60,5 @@
 static void consumer(void *arg)
 {
-	thread_detach(THREAD);	
+	thread_detach(THREAD);
 	
 	waitq_sleep(&can_start);
@@ -70,5 +70,5 @@
 }
 
-char * test_semaphore1(bool quiet)
+char *test_semaphore1(void)
 {
 	int i, j, k;
@@ -77,8 +77,8 @@
 	waitq_initialize(&can_start);
 	semaphore_initialize(&sem, AT_ONCE);
-
+	
 	for (i = 1; i <= 3; i++) {
 		thread_t *thrd;
-
+		
 		atomic_set(&items_produced, 0);
 		atomic_set(&items_consumed, 0);
@@ -87,6 +87,6 @@
 		producers = (4 - i) * PRODUCERS;
 		
-		printf("Creating %d consumers and %d producers...", consumers, producers);
-	
+		TPRINTF("Creating %d consumers and %d producers...", consumers, producers);
+		
 		for (j = 0; j < (CONSUMERS + PRODUCERS) / 2; j++) {
 			for (k = 0; k < i; k++) {
@@ -95,5 +95,5 @@
 					thread_ready(thrd);
 				else
-					printf("could not create consumer %d\n", i);
+					TPRINTF("could not create consumer %d\n", i);
 			}
 			for (k = 0; k < (4 - i); k++) {
@@ -102,15 +102,15 @@
 					thread_ready(thrd);
 				else
-					printf("could not create producer %d\n", i);
+					TPRINTF("could not create producer %d\n", i);
 			}
 		}
-
-		printf("ok\n");
-
+		
+		TPRINTF("ok\n");
+		
 		thread_sleep(1);
 		waitq_wakeup(&can_start, WAKEUP_ALL);
-	
+		
 		while ((items_consumed.count != consumers) || (items_produced.count != producers)) {
-			printf("%d consumers remaining, %d producers remaining\n", consumers - items_consumed.count, producers - items_produced.count);
+			TPRINTF("%d consumers remaining, %d producers remaining\n", consumers - items_consumed.count, producers - items_produced.count);
 			thread_sleep(1);
 		}
Index: kernel/test/synch/semaphore2.c
===================================================================
--- kernel/test/synch/semaphore2.c	(revision 53634f9294eaa723f35916cf5364f8cd4ab720f8)
+++ kernel/test/synch/semaphore2.c	(revision a85aebde1fe7aa2a70f30bb24c64dade39325a93)
@@ -51,6 +51,6 @@
 {
 	uint32_t rc;
-
-	spinlock_lock(&sem_lock);	
+	
+	spinlock_lock(&sem_lock);
 	rc = seed % max;
 	seed = (((seed << 2) ^ (seed >> 2)) * 487) + rc;
@@ -68,19 +68,19 @@
 	
 	to = random(20000);
-	printf("cpu%u, tid %" PRIu64 " down+ (%d)\n", CPU->id, THREAD->tid, to);
+	TPRINTF("cpu%u, tid %" PRIu64 " down+ (%d)\n", CPU->id, THREAD->tid, to);
 	rc = semaphore_down_timeout(&sem, to);
 	if (SYNCH_FAILED(rc)) {
-		printf("cpu%u, tid %" PRIu64 " down!\n", CPU->id, THREAD->tid);
+		TPRINTF("cpu%u, tid %" PRIu64 " down!\n", CPU->id, THREAD->tid);
 		return;
 	}
 	
-	printf("cpu%u, tid %" PRIu64 " down=\n", CPU->id, THREAD->tid);	
+	TPRINTF("cpu%u, tid %" PRIu64 " down=\n", CPU->id, THREAD->tid);	
 	thread_usleep(random(30000));
 	
 	semaphore_up(&sem);
-	printf("cpu%u, tid %" PRIu64 " up\n", CPU->id, THREAD->tid);
+	TPRINTF("cpu%u, tid %" PRIu64 " up\n", CPU->id, THREAD->tid);
 }
 
-char * test_semaphore2(bool quiet)
+char *test_semaphore2(void)
 {
 	uint32_t i, k;
@@ -92,5 +92,5 @@
 	
 	k = random(7) + 1;
-	printf("Creating %" PRIu32 " consumers\n", k);
+	TPRINTF("Creating %" PRIu32 " consumers\n", k);
 	for (i = 0; i < k; i++) {
 		thrd = thread_create(consumer, NULL, TASK, 0, "consumer", false);
@@ -98,5 +98,5 @@
 			thread_ready(thrd);
 		else
-			printf("Error creating thread\n");
+			TPRINTF("Error creating thread\n");
 	}
 	
