Index: src/cpu/cpu.c
===================================================================
--- src/cpu/cpu.c	(revision a1a03f9e3adbf8f0bbd04bc9245f9da1e95f0535)
+++ src/cpu/cpu.c	(revision 76cec1e21a9510de8780a546f59799bc82003d87)
@@ -67,5 +67,5 @@
 		memsetb((__address) cpu_private_data, sizeof(cpu_private_data_t) * config.cpu_count, 0);
 		memsetb((__address) cpus, sizeof(cpu_t) * config.cpu_count, 0);
-    
+
 		for (i=0; i < config.cpu_count; i++) {
 			cpus[i].stack = (__u8 *) malloc(CPU_STACK_SIZE);
Index: src/main/kinit.c
===================================================================
--- src/main/kinit.c	(revision a1a03f9e3adbf8f0bbd04bc9245f9da1e95f0535)
+++ src/main/kinit.c	(revision 76cec1e21a9510de8780a546f59799bc82003d87)
@@ -95,5 +95,5 @@
 #ifdef __SMP__
 	if (config.cpu_count > 1) {
-	        /*
+		/*
 		 * For each CPU, create its load balancing thread.
 		 */
Index: src/mm/frame.c
===================================================================
--- src/mm/frame.c	(revision a1a03f9e3adbf8f0bbd04bc9245f9da1e95f0535)
+++ src/mm/frame.c	(revision 76cec1e21a9510de8780a546f59799bc82003d87)
@@ -55,21 +55,21 @@
 void frame_init(void)
 {
-        if (config.cpu_active == 1) {
+	if (config.cpu_active == 1) {
 
-                /*
-                 * The bootstrap processor will allocate all necessary memory for frame allocation.
-                 */
+		/*
+		 * The bootstrap processor will allocate all necessary memory for frame allocation.
+		 */
 
-                frames = config.memory_size / FRAME_SIZE;
-                frame_bitmap_octets = frames / 8 + (frames % 8 > 0);
-                frame_bitmap = (__u8 *) malloc(frame_bitmap_octets);
-                if (!frame_bitmap)
-                        panic("malloc/frame_bitmap\n");
+		frames = config.memory_size / FRAME_SIZE;
+		frame_bitmap_octets = frames / 8 + (frames % 8 > 0);
+		frame_bitmap = (__u8 *) malloc(frame_bitmap_octets);
+		if (!frame_bitmap)
+			panic("malloc/frame_bitmap\n");
 
-                /*
-                 * Mark all frames free.
-                 */
-                memsetb((__address) frame_bitmap, frame_bitmap_octets, 0);
-                frames_free = frames;
+		/*
+		 * Mark all frames free.
+		 */
+		memsetb((__address) frame_bitmap, frame_bitmap_octets, 0);
+		frames_free = frames;
 	}
 
@@ -81,8 +81,8 @@
 
 	if (config.cpu_active == 1) {
-                /*
-                 * Create the memory address space map. Marked frames and frame
-                 * regions cannot be used for allocation.
-                 */
+		/*
+		 * Create the memory address space map. Marked frames and frame
+		 * regions cannot be used for allocation.
+		 */
 		frame_region_not_free(config.base, config.base + config.kernel_size);
 	}
Index: src/mm/page.c
===================================================================
--- src/mm/page.c	(revision a1a03f9e3adbf8f0bbd04bc9245f9da1e95f0535)
+++ src/mm/page.c	(revision 76cec1e21a9510de8780a546f59799bc82003d87)
@@ -54,9 +54,9 @@
 
 	/* TODO: implement portable way of computing page address from address */
-        length = size + (s - (s & 0xfffff000));
-        cnt = length/PAGE_SIZE + (length%PAGE_SIZE>0);
+	length = size + (s - (s & 0xfffff000));
+	cnt = length/PAGE_SIZE + (length%PAGE_SIZE>0);
 
-        for (i = 0; i < cnt; i++)
-                map_page_to_frame(s + i*PAGE_SIZE, s + i*PAGE_SIZE, PAGE_NOT_CACHEABLE, 0);
+	for (i = 0; i < cnt; i++)
+		map_page_to_frame(s + i*PAGE_SIZE, s + i*PAGE_SIZE, PAGE_NOT_CACHEABLE, 0);
 
 }
@@ -74,37 +74,37 @@
 void map_page_to_frame(__address page, __address frame, int flags, __address root)
 {
-        pte_t *ptl0, *ptl1, *ptl2, *ptl3;
-        __address newpt;
+	pte_t *ptl0, *ptl1, *ptl2, *ptl3;
+	__address newpt;
 
-        ptl0 = (pte_t *) PA2KA(root ? root : (__address) GET_PTL0_ADDRESS());
+	ptl0 = (pte_t *) PA2KA(root ? root : (__address) GET_PTL0_ADDRESS());
 
-        if (GET_PTL1_FLAGS(ptl0, PTL0_INDEX(page)) & PAGE_NOT_PRESENT) {
-                newpt = frame_alloc(FRAME_KA);
-                memsetb(newpt, PAGE_SIZE, 0);
-                SET_PTL1_ADDRESS(ptl0, PTL0_INDEX(page), KA2PA(newpt));
-                SET_PTL1_FLAGS(ptl0, PTL0_INDEX(page), PAGE_PRESENT | PAGE_USER);
-        }
+	if (GET_PTL1_FLAGS(ptl0, PTL0_INDEX(page)) & PAGE_NOT_PRESENT) {
+		newpt = frame_alloc(FRAME_KA);
+		memsetb(newpt, PAGE_SIZE, 0);
+		SET_PTL1_ADDRESS(ptl0, PTL0_INDEX(page), KA2PA(newpt));
+		SET_PTL1_FLAGS(ptl0, PTL0_INDEX(page), PAGE_PRESENT | PAGE_USER);
+	}
 
-        ptl1 = (pte_t *) PA2KA(GET_PTL1_ADDRESS(ptl0, PTL0_INDEX(page)));
+	ptl1 = (pte_t *) PA2KA(GET_PTL1_ADDRESS(ptl0, PTL0_INDEX(page)));
 
-        if (GET_PTL2_FLAGS(ptl1, PTL1_INDEX(page)) & PAGE_NOT_PRESENT) {
-                newpt = frame_alloc(FRAME_KA);
-                memsetb(newpt, PAGE_SIZE, 0);
-                SET_PTL2_ADDRESS(ptl1, PTL1_INDEX(page), KA2PA(newpt));
-                SET_PTL2_FLAGS(ptl1, PTL1_INDEX(page), PAGE_PRESENT | PAGE_USER);
-        }
+	if (GET_PTL2_FLAGS(ptl1, PTL1_INDEX(page)) & PAGE_NOT_PRESENT) {
+		newpt = frame_alloc(FRAME_KA);
+		memsetb(newpt, PAGE_SIZE, 0);
+		SET_PTL2_ADDRESS(ptl1, PTL1_INDEX(page), KA2PA(newpt));
+		SET_PTL2_FLAGS(ptl1, PTL1_INDEX(page), PAGE_PRESENT | PAGE_USER);
+	}
 
-        ptl2 = (pte_t *) PA2KA(GET_PTL2_ADDRESS(ptl1, PTL1_INDEX(page)));
+	ptl2 = (pte_t *) PA2KA(GET_PTL2_ADDRESS(ptl1, PTL1_INDEX(page)));
 
-        if (GET_PTL3_FLAGS(ptl2, PTL2_INDEX(page)) & PAGE_NOT_PRESENT) {
-                newpt = frame_alloc(FRAME_KA);
-                memsetb(newpt, PAGE_SIZE, 0);
-                SET_PTL3_ADDRESS(ptl2, PTL2_INDEX(page), KA2PA(newpt));
-                SET_PTL3_FLAGS(ptl2, PTL2_INDEX(page), PAGE_PRESENT | PAGE_USER);
-        }
+	if (GET_PTL3_FLAGS(ptl2, PTL2_INDEX(page)) & PAGE_NOT_PRESENT) {
+		newpt = frame_alloc(FRAME_KA);
+		memsetb(newpt, PAGE_SIZE, 0);
+		SET_PTL3_ADDRESS(ptl2, PTL2_INDEX(page), KA2PA(newpt));
+		SET_PTL3_FLAGS(ptl2, PTL2_INDEX(page), PAGE_PRESENT | PAGE_USER);
+	}
 
-        ptl3 = (pte_t *) PA2KA(GET_PTL3_ADDRESS(ptl2, PTL2_INDEX(page)));
+	ptl3 = (pte_t *) PA2KA(GET_PTL3_ADDRESS(ptl2, PTL2_INDEX(page)));
 
-        SET_FRAME_ADDRESS(ptl3, PTL3_INDEX(page), frame);
-        SET_FRAME_FLAGS(ptl3, PTL3_INDEX(page), flags);
+	SET_FRAME_ADDRESS(ptl3, PTL3_INDEX(page), frame);
+	SET_FRAME_FLAGS(ptl3, PTL3_INDEX(page), flags);
 }
Index: src/proc/scheduler.c
===================================================================
--- src/proc/scheduler.c	(revision a1a03f9e3adbf8f0bbd04bc9245f9da1e95f0535)
+++ src/proc/scheduler.c	(revision 76cec1e21a9510de8780a546f59799bc82003d87)
@@ -103,5 +103,5 @@
 		 */
 		if (test_and_set(&CPU->kcpulbstarted) == 0) {
-    			waitq_wakeup(&CPU->kcpulb_wq, 0);
+			waitq_wakeup(&CPU->kcpulb_wq, 0);
 			goto loop;
 		}
@@ -239,5 +239,5 @@
 			 */
 			before_thread_runs();
-		    	spinlock_unlock(&THREAD->lock);
+			spinlock_unlock(&THREAD->lock);
 			cpu_priority_restore(THREAD->saved_context.pri);
 			return;
@@ -279,72 +279,71 @@
 		switch (THREAD->state) {
 		    case Running:
-			    THREAD->state = Ready;
-			    spinlock_unlock(&THREAD->lock);
-			    thread_ready(THREAD);
-			    break;
+			THREAD->state = Ready;
+			spinlock_unlock(&THREAD->lock);
+			thread_ready(THREAD);
+			break;
 
 		    case Exiting:
-			    frame_free((__address) THREAD->kstack);
-			    if (THREAD->ustack) {
-				    frame_free((__address) THREAD->ustack);
-			    }
-			    
-			    /*
-			     * Detach from the containing task.
-			     */
-			    spinlock_lock(&TASK->lock);
-			    list_remove(&THREAD->th_link);
-			    spinlock_unlock(&TASK->lock);
-
-			    spinlock_unlock(&THREAD->lock);
-			    
-			    spinlock_lock(&threads_lock);
-			    list_remove(&THREAD->threads_link);
-			    spinlock_unlock(&threads_lock);
-
-			    spinlock_lock(&CPU->lock);
-			    if(CPU->fpu_owner==THREAD) CPU->fpu_owner=NULL;
-			    spinlock_unlock(&CPU->lock);
-
-			    
-			    free(THREAD);
-			    
-			    break;
-			    
+			frame_free((__address) THREAD->kstack);
+			if (THREAD->ustack) {
+				frame_free((__address) THREAD->ustack);
+			}
+
+			/*
+			 * Detach from the containing task.
+			 */
+			spinlock_lock(&TASK->lock);
+			list_remove(&THREAD->th_link);
+			spinlock_unlock(&TASK->lock);
+
+			spinlock_unlock(&THREAD->lock);
+    
+			spinlock_lock(&threads_lock);
+			list_remove(&THREAD->threads_link);
+			spinlock_unlock(&threads_lock);
+
+			spinlock_lock(&CPU->lock);
+			if(CPU->fpu_owner==THREAD) CPU->fpu_owner=NULL;
+			spinlock_unlock(&CPU->lock);
+
+			free(THREAD);
+
+			break;
+    
 		    case Sleeping:
-			    /*
-			     * Prefer the thread after it's woken up.
-			     */
-			    THREAD->pri = -1;
-
-			    /*
-			     * We need to release wq->lock which we locked in waitq_sleep().
-			     * Address of wq->lock is kept in THREAD->sleep_queue.
-			     */
-			    spinlock_unlock(&THREAD->sleep_queue->lock);
-
-			    /*
-			     * Check for possible requests for out-of-context invocation.
-			     */
-			    if (THREAD->call_me) {
-				    THREAD->call_me(THREAD->call_me_with);
-				    THREAD->call_me = NULL;
-				    THREAD->call_me_with = NULL;
-			    }
-
-			    spinlock_unlock(&THREAD->lock);
-			    
-			    break;
+			/*
+			 * Prefer the thread after it's woken up.
+			 */
+			THREAD->pri = -1;
+
+			/*
+			 * We need to release wq->lock which we locked in waitq_sleep().
+			 * Address of wq->lock is kept in THREAD->sleep_queue.
+			 */
+			spinlock_unlock(&THREAD->sleep_queue->lock);
+
+			/*
+			 * Check for possible requests for out-of-context invocation.
+			 */
+			if (THREAD->call_me) {
+				THREAD->call_me(THREAD->call_me_with);
+				THREAD->call_me = NULL;
+				THREAD->call_me_with = NULL;
+			}
+
+			spinlock_unlock(&THREAD->lock);
+
+			break;
 
 		    default:
-			    /*
-			     * Entering state is unexpected.
-			     */
-			    panic("tid%d: unexpected state %s\n", THREAD->tid, thread_states[THREAD->state]);
-			    break;
+			/*
+			 * Entering state is unexpected.
+			 */
+			panic("tid%d: unexpected state %s\n", THREAD->tid, thread_states[THREAD->state]);
+			break;
 		}
 		THREAD = NULL;
 	}
-    
+
 	THREAD = find_best_thread();
 	
@@ -470,7 +469,7 @@
 				t = list_get_instance(l, thread_t, rq_link);
 				/*
-		    		 * We don't want to steal CPU-wired threads neither threads already stolen.
+				 * We don't want to steal CPU-wired threads neither threads already stolen.
 				 * The latter prevents threads from migrating between CPU's without ever being run.
-		        	 * We don't want to steal threads whose FPU context is still in CPU.
+				 * We don't want to steal threads whose FPU context is still in CPU.
 				 */
 				spinlock_lock(&t->lock);
@@ -498,5 +497,5 @@
 					atomic_dec(&nrdy);
 
-			    		r->n--;
+					r->n--;
 					list_remove(&t->rq_link);
 
@@ -528,5 +527,5 @@
 					
 				/*
-                    		 * We are not satisfied yet, focus on another CPU next time.
+				 * We are not satisfied yet, focus on another CPU next time.
 				 */
 				k++;
@@ -553,5 +552,5 @@
 		
 	goto not_satisfied;
-    
+
 satisfied:
 	/*
Index: src/proc/thread.c
===================================================================
--- src/proc/thread.c	(revision a1a03f9e3adbf8f0bbd04bc9245f9da1e95f0535)
+++ src/proc/thread.c	(revision 76cec1e21a9510de8780a546f59799bc82003d87)
@@ -147,5 +147,5 @@
 	}	
 	spinlock_unlock(&cpu->lock);
-    
+
 	cpu_priority_restore(pri);
 }
@@ -278,5 +278,5 @@
 void thread_sleep(__u32 sec)
 {
-        thread_usleep(sec*1000000);
+	thread_usleep(sec*1000000);
 }
 
Index: src/time/clock.c
===================================================================
--- src/time/clock.c	(revision a1a03f9e3adbf8f0bbd04bc9245f9da1e95f0535)
+++ src/time/clock.c	(revision 76cec1e21a9510de8780a546f59799bc82003d87)
@@ -90,5 +90,5 @@
 	
 		spinlock_lock(&THREAD->lock);
-    		if (!THREAD->ticks--) {
+		if (!THREAD->ticks--) {
 			spinlock_unlock(&THREAD->lock);
 			scheduler();
Index: src/time/timeout.c
===================================================================
--- src/time/timeout.c	(revision a1a03f9e3adbf8f0bbd04bc9245f9da1e95f0535)
+++ src/time/timeout.c	(revision 76cec1e21a9510de8780a546f59799bc82003d87)
@@ -106,5 +106,5 @@
 	spinlock_lock(&CPU->timeoutlock);
 	spinlock_lock(&t->lock);
-    
+
 	if (t->cpu)
 		panic("t->cpu != 0");
@@ -115,5 +115,5 @@
 	t->handler = f;
 	t->arg = arg;
-    
+
 	/*
 	 * Insert t into the active timeouts list according to t->ticks.
