Index: kernel/arch/amd64/include/debugger.h
===================================================================
--- kernel/arch/amd64/include/debugger.h	(revision d84319865c1131f37cbdba6ba952c5d38c735d0d)
+++ kernel/arch/amd64/include/debugger.h	(revision 7f043c0d4fa344ed23d99c9baa9f11cdac734176)
@@ -49,5 +49,5 @@
 
 extern void debugger_init(void);
-extern int breakpoint_add(void * where, int flags, int curidx);
+extern int breakpoint_add(const void *where, const int flags, int curidx);
 extern void breakpoint_del(int slot);
 
Index: kernel/arch/amd64/src/debugger.c
===================================================================
--- kernel/arch/amd64/src/debugger.c	(revision d84319865c1131f37cbdba6ba952c5d38c735d0d)
+++ kernel/arch/amd64/src/debugger.c	(revision 7f043c0d4fa344ed23d99c9baa9f11cdac734176)
@@ -103,5 +103,5 @@
 
 /** Print table of active breakpoints */
-int cmd_print_breakpoints(cmd_arg_t *argv)
+int cmd_print_breakpoints(cmd_arg_t *argv __attribute__((unused)))
 {
 	int i;
@@ -112,5 +112,5 @@
 		if (breakpoints[i].address) {
 			symbol = get_symtab_entry(breakpoints[i].address);
-			printf("%d. %p in %s\n",i,
+			printf("%d. %lx in %s\n", i,
 			       breakpoints[i].address, symbol);
 			printf("     Count(%d) ", breakpoints[i].counter);
@@ -174,10 +174,9 @@
 /** Enable hardware breakpoint
  *
- *
  * @param where Address of HW breakpoint
  * @param flags Type of breakpoint (EXECUTE, WRITE)
  * @return Debug slot on success, -1 - no available HW breakpoint
  */
-int breakpoint_add(void * where, int flags, int curidx)
+int breakpoint_add(const void *where, const int flags, int curidx)
 {
 	ipl_t ipl;
@@ -185,5 +184,5 @@
 	bpinfo_t *cur;
 
-	ASSERT( flags & (BKPOINT_INSTR | BKPOINT_WRITE | BKPOINT_READ_WRITE));
+	ASSERT(flags & (BKPOINT_INSTR | BKPOINT_WRITE | BKPOINT_READ_WRITE));
 
 	ipl = interrupts_disable();
@@ -192,5 +191,5 @@
 	if (curidx == -1) {
 		/* Find free space in slots */
-		for (i=0; i<BKPOINTS_MAX; i++)
+		for (i = 0; i < BKPOINTS_MAX; i++)
 			if (!breakpoints[i].address) {
 				curidx = i;
@@ -224,7 +223,7 @@
 
 #ifdef amd64
-# define getip(x)  ((x)->rip)
+#	define getip(x)	((x)->rip)
 #else
-# define getip(x)  ((x)->eip)
+#	define getip(x)	((x)->eip)
 #endif
 
@@ -238,12 +237,12 @@
 			if (*((unative_t *) breakpoints[slot].address) != 0)
 				return;
-			printf("**** Found ZERO on address %p ****\n",
-			       slot, breakpoints[slot].address);
+			printf("**** Found ZERO on address %lx (slot %d) ****\n",
+				breakpoints[slot].address, slot);
 		} else {
-			printf("Data watchpoint - new data: %p\n",
+			printf("Data watchpoint - new data: %lx\n",
 			       *((unative_t *) breakpoints[slot].address));
 		}
 	}
-	printf("Reached breakpoint %d:%p(%s)\n", slot, getip(istate),
+	printf("Reached breakpoint %d:%lx(%s)\n", slot, getip(istate),
 	       get_symtab_entry(getip(istate)));
 	printf("***Type 'exit' to exit kconsole.\n");
@@ -314,5 +313,5 @@
 #endif
 
-static void debug_exception(int n, istate_t *istate)
+static void debug_exception(int n __attribute__((unused)), istate_t *istate)
 {
 	unative_t dr6;
@@ -338,10 +337,10 @@
 
 #ifdef CONFIG_SMP
-static void debug_ipi(int n, istate_t *istate)
+static void debug_ipi(int n __attribute__((unused)), istate_t *istate __attribute__((unused)))
 {
 	int i;
 
 	spinlock_lock(&bkpoint_lock);
-	for (i=0; i < BKPOINTS_MAX; i++)
+	for (i = 0; i < BKPOINTS_MAX; i++)
 		setup_dr(i);
 	spinlock_unlock(&bkpoint_lock);
Index: kernel/arch/ia32/include/asm.h
===================================================================
--- kernel/arch/ia32/include/asm.h	(revision d84319865c1131f37cbdba6ba952c5d38c735d0d)
+++ kernel/arch/ia32/include/asm.h	(revision 7f043c0d4fa344ed23d99c9baa9f11cdac734176)
@@ -258,5 +258,9 @@
 	uintptr_t v;
 	
-	asm volatile ("andl %%esp, %0\n" : "=r" (v) : "0" (~(STACK_SIZE-1)));
+	asm volatile (
+		"andl %%esp, %0\n"
+		: "=r" (v)
+		: "0" (~(STACK_SIZE - 1))
+	);
 	
 	return v;
Index: kernel/arch/ia32/include/context.h
===================================================================
--- kernel/arch/ia32/include/context.h	(revision d84319865c1131f37cbdba6ba952c5d38c735d0d)
+++ kernel/arch/ia32/include/context.h	(revision 7f043c0d4fa344ed23d99c9baa9f11cdac734176)
@@ -46,5 +46,5 @@
  * One item is put onto stack to support get_stack_base().
  */
-#define SP_DELTA	(8+STACK_ITEM_SIZE)
+#define SP_DELTA	(8 + STACK_ITEM_SIZE)
 
 /*
Index: kernel/arch/ia32/include/mm/frame.h
===================================================================
--- kernel/arch/ia32/include/mm/frame.h	(revision d84319865c1131f37cbdba6ba952c5d38c735d0d)
+++ kernel/arch/ia32/include/mm/frame.h	(revision 7f043c0d4fa344ed23d99c9baa9f11cdac734176)
@@ -37,5 +37,5 @@
 
 #define FRAME_WIDTH	12	/* 4K */
-#define FRAME_SIZE	(1<<FRAME_WIDTH)
+#define FRAME_SIZE	(1 << FRAME_WIDTH)
 
 #ifdef KERNEL
Index: kernel/arch/ia32/include/smp/apic.h
===================================================================
--- kernel/arch/ia32/include/smp/apic.h	(revision d84319865c1131f37cbdba6ba952c5d38c735d0d)
+++ kernel/arch/ia32/include/smp/apic.h	(revision 7f043c0d4fa344ed23d99c9baa9f11cdac734176)
@@ -347,5 +347,5 @@
 extern uint32_t io_apic_read(uint8_t address);
 extern void io_apic_write(uint8_t address , uint32_t x);
-extern void io_apic_change_ioredtbl(int pin, int dest, uint8_t v, int flags);
+extern void io_apic_change_ioredtbl(uint8_t pin, uint8_t dest, uint8_t v, int flags);
 extern void io_apic_disable_irqs(uint16_t irqmask);
 extern void io_apic_enable_irqs(uint16_t irqmask);
Index: kernel/arch/ia32/src/ddi/ddi.c
===================================================================
--- kernel/arch/ia32/src/ddi/ddi.c	(revision d84319865c1131f37cbdba6ba952c5d38c735d0d)
+++ kernel/arch/ia32/src/ddi/ddi.c	(revision 7f043c0d4fa344ed23d99c9baa9f11cdac734176)
@@ -126,8 +126,9 @@
 	if ((bits = TASK->arch.iomap.bits)) {
 		bitmap_t iomap;
+		task_t *task = TASK;
 	
 		ASSERT(TASK->arch.iomap.map);
 		bitmap_initialize(&iomap, CPU->arch.tss->iomap, TSS_IOMAP_SIZE * 8);
-		bitmap_copy(&iomap, &TASK->arch.iomap, TASK->arch.iomap.bits);
+		bitmap_copy(&iomap, &task->arch.iomap, task->arch.iomap.bits);
 		/*
 		 * It is safe to set the trailing eight bits because of the extra
Index: kernel/arch/ia32/src/mm/page.c
===================================================================
--- kernel/arch/ia32/src/mm/page.c	(revision d84319865c1131f37cbdba6ba952c5d38c735d0d)
+++ kernel/arch/ia32/src/mm/page.c	(revision 7f043c0d4fa344ed23d99c9baa9f11cdac734176)
@@ -84,6 +84,8 @@
 	uintptr_t virtaddr = PA2KA(last_frame);
 	pfn_t i;
-	for (i = 0; i < ADDR2PFN(ALIGN_UP(size, PAGE_SIZE)); i++)
-		page_mapping_insert(AS_KERNEL, virtaddr + PFN2ADDR(i), physaddr + PFN2ADDR(i), PAGE_NOT_CACHEABLE | PAGE_WRITE);
+	for (i = 0; i < ADDR2PFN(ALIGN_UP(size, PAGE_SIZE)); i++) {
+		uintptr_t addr = PFN2ADDR(i);
+		page_mapping_insert(AS_KERNEL, virtaddr + addr, physaddr + addr, PAGE_NOT_CACHEABLE | PAGE_WRITE);
+	}
 	
 	last_frame = ALIGN_UP(last_frame + size, FRAME_SIZE);
@@ -92,5 +94,5 @@
 }
 
-void page_fault(int n, istate_t *istate)
+void page_fault(int n __attribute__((unused)), istate_t *istate)
 {
 	uintptr_t page;
@@ -111,5 +113,5 @@
 		
 		decode_istate(istate);
-		printf("page fault address: %#x\n", page);
+		printf("page fault address: %#lx\n", page);
 		panic("page fault\n");
 	}
Index: kernel/arch/ia32/src/proc/scheduler.c
===================================================================
--- kernel/arch/ia32/src/proc/scheduler.c	(revision d84319865c1131f37cbdba6ba952c5d38c735d0d)
+++ kernel/arch/ia32/src/proc/scheduler.c	(revision 7f043c0d4fa344ed23d99c9baa9f11cdac734176)
@@ -67,8 +67,9 @@
 #ifdef CONFIG_DEBUG_AS_WATCHPOINT
 	/* Set watchpoint on AS to ensure that nobody sets it to zero */
-	if (CPU->id < BKPOINTS_MAX)
-		breakpoint_add(&((the_t *) THREAD->kstack)->as, 
-			       BKPOINT_WRITE | BKPOINT_CHECK_ZERO,
-			       CPU->id);
+	if (CPU->id < BKPOINTS_MAX) {
+		the_t *the = THE;
+		breakpoint_add(&((the_t *) the->thread->kstack)->as, 
+			BKPOINT_WRITE | BKPOINT_CHECK_ZERO, the->cpu->id);
+	}
 #endif
 }
Index: kernel/arch/ia32/src/smp/apic.c
===================================================================
--- kernel/arch/ia32/src/smp/apic.c	(revision d84319865c1131f37cbdba6ba952c5d38c735d0d)
+++ kernel/arch/ia32/src/smp/apic.c	(revision 7f043c0d4fa344ed23d99c9baa9f11cdac734176)
@@ -126,8 +126,8 @@
  * @param istate Interrupted state.
  */
-static void apic_spurious(int n, istate_t *istate)
+static void apic_spurious(int n __attribute__((unused)), istate_t *istate __attribute__((unused)))
 {
 #ifdef CONFIG_DEBUG
-	printf("cpu%d: APIC spurious interrupt\n", CPU->id);
+	printf("cpu%u: APIC spurious interrupt\n", CPU->id);
 #endif
 }
@@ -138,5 +138,5 @@
 }
 
-static void l_apic_timer_irq_handler(irq_t *irq, void *arg, ...)
+static void l_apic_timer_irq_handler(irq_t *irq, void *arg __attribute__((unused)), ...)
 {
 	/*
@@ -154,6 +154,5 @@
 {
 	io_apic_id_t idreg;
-	unsigned int i;
-
+	
 	exc_register(VECTOR_APIC_SPUR, "apic_spurious", (iroutine) apic_spurious);
 
@@ -177,9 +176,10 @@
 	irq_register(&l_apic_timer_irq);
 	
+	uint8_t i;
 	for (i = 0; i < IRQ_COUNT; i++) {
 		int pin;
 	
 		if ((pin = smp_irq_to_pin(i)) != -1)
-			io_apic_change_ioredtbl(pin, DEST_ALL, IVT_IRQBASE + i, LOPRI);
+			io_apic_change_ioredtbl((uint8_t) pin, DEST_ALL, (uint8_t) (IVT_IRQBASE + i), LOPRI);
 	}
 	
@@ -329,5 +329,5 @@
 		for (i = 0; i<2; i++) {
 			icr.lo = l_apic[ICRlo];
-			icr.vector = ((uintptr_t) ap_boot) / 4096; /* calculate the reset vector */
+			icr.vector = (uint8_t) (((uintptr_t) ap_boot) >> 12); /* calculate the reset vector */
 			icr.delmod = DELMOD_STARTUP;
 			icr.destmod = DESTMOD_PHYS;
@@ -426,7 +426,7 @@
 	
 	/* Program Logical Destination Register. */
+	ASSERT(CPU->id < 8)
 	ldr.value = l_apic[LDR];
-	if (CPU->id < sizeof(CPU->id)*8)	/* size in bits */
-		ldr.id = (1<<CPU->id);
+	ldr.id = (uint8_t) (1 << CPU->id);
 	l_apic[LDR] = ldr.value;
 	
@@ -514,5 +514,5 @@
  * @param flags Flags.
  */
-void io_apic_change_ioredtbl(int pin, int dest, uint8_t v, int flags)
+void io_apic_change_ioredtbl(uint8_t pin, uint8_t dest, uint8_t v, int flags)
 {
 	io_redirection_reg_t reg;
@@ -522,6 +522,6 @@
 		dlvr = DELMOD_LOWPRI;
 
-	reg.lo = io_apic_read(IOREDTBL + pin*2);
-	reg.hi = io_apic_read(IOREDTBL + pin*2 + 1);
+	reg.lo = io_apic_read((uint8_t) (IOREDTBL + pin * 2));
+	reg.hi = io_apic_read((uint8_t) (IOREDTBL + pin * 2 + 1));
 	
 	reg.dest = dest;
@@ -532,6 +532,6 @@
 	reg.intvec = v;
 
-	io_apic_write(IOREDTBL + pin*2, reg.lo);
-	io_apic_write(IOREDTBL + pin*2 + 1, reg.hi);
+	io_apic_write((uint8_t) (IOREDTBL + pin * 2), reg.lo);
+	io_apic_write((uint8_t) (IOREDTBL + pin * 2 + 1), reg.hi);
 }
 
@@ -554,7 +554,7 @@
 			pin = smp_irq_to_pin(i);
 			if (pin != -1) {
-				reg.lo = io_apic_read(IOREDTBL + pin * 2);
+				reg.lo = io_apic_read((uint8_t) (IOREDTBL + pin * 2));
 				reg.masked = true;
-				io_apic_write(IOREDTBL + pin * 2, reg.lo);
+				io_apic_write((uint8_t) (IOREDTBL + pin * 2), reg.lo);
 			}
 			
@@ -573,5 +573,5 @@
 	io_redirection_reg_t reg;	
 	
-	for (i = 0;i < 16; i++) {
+	for (i = 0; i < 16; i++) {
 		if (irqmask & (1 << i)) {
 			/*
@@ -581,7 +581,7 @@
 			pin = smp_irq_to_pin(i);
 			if (pin != -1) {
-				reg.lo = io_apic_read(IOREDTBL + pin * 2);
+				reg.lo = io_apic_read((uint8_t) (IOREDTBL + pin * 2));
 				reg.masked = false;
-				io_apic_write(IOREDTBL + pin * 2, reg.lo);
+				io_apic_write((uint8_t) (IOREDTBL + pin * 2), reg.lo);
 			}
 			
Index: kernel/arch/ia32/src/smp/mps.c
===================================================================
--- kernel/arch/ia32/src/smp/mps.c	(revision d84319865c1131f37cbdba6ba952c5d38c735d0d)
+++ kernel/arch/ia32/src/smp/mps.c	(revision 7f043c0d4fa344ed23d99c9baa9f11cdac734176)
@@ -55,17 +55,17 @@
 #define CT_SIGNATURE 	0x504d4350
 
-int mps_fs_check(uint8_t *base);
-int mps_ct_check(void);
-
-int configure_via_ct(void);
-int configure_via_default(uint8_t n);
-
-int ct_processor_entry(struct __processor_entry *pr);
-void ct_bus_entry(struct __bus_entry *bus);
-void ct_io_apic_entry(struct __io_apic_entry *ioa);
-void ct_io_intr_entry(struct __io_intr_entry *iointr);
-void ct_l_intr_entry(struct __l_intr_entry *lintr);
-
-void ct_extended_entries(void);
+static int mps_fs_check(uint8_t *base);
+static int mps_ct_check(void);
+
+static int configure_via_ct(void);
+static int configure_via_default(uint8_t n);
+
+static int ct_processor_entry(struct __processor_entry *pr);
+static void ct_bus_entry(struct __bus_entry *bus);
+static void ct_io_apic_entry(struct __io_apic_entry *ioa);
+static void ct_io_intr_entry(struct __io_intr_entry *iointr);
+static void ct_l_intr_entry(struct __l_intr_entry *lintr);
+
+static void ct_extended_entries(void);
 
 static struct mps_fs *fs;
@@ -109,5 +109,5 @@
 {
 	ASSERT(i < processor_entry_cnt);
-	return processor_entries[i].cpu_flags & 0x1;
+	return (bool) ((processor_entries[i].cpu_flags & 0x01) == 0x01);
 }
 
@@ -115,5 +115,5 @@
 {
 	ASSERT(i < processor_entry_cnt);
-	return processor_entries[i].cpu_flags & 0x2;
+	return (bool) ((processor_entries[i].cpu_flags & 0x02) == 0x02);
 }
 
@@ -134,5 +134,5 @@
 	
 	for (i = 0, sum = 0; i < 16; i++)
-		sum += base[i];
+		sum = (uint8_t) (sum + base[i]);
 	
 	return !sum;
@@ -151,5 +151,5 @@
 	/* count the checksum for the base table */
 	for (i=0,sum=0; i < ct->base_table_length; i++)
-		sum += base[i];
+		sum = (uint8_t) (sum + base[i]);
 		
 	if (sum)
@@ -158,5 +158,5 @@
 	/* count the checksum for the extended table */
 	for (i=0,sum=0; i < ct->ext_table_length; i++)
-		sum += ext[i];
+		sum = (uint8_t) (sum + ext[i]);
 		
 	return sum == ct->ext_table_checksum;
@@ -287,5 +287,5 @@
 }
 
-int configure_via_default(uint8_t n)
+int configure_via_default(uint8_t n __attribute__((unused)))
 {
 	/*
@@ -297,5 +297,5 @@
 
 
-int ct_processor_entry(struct __processor_entry *pr)
+int ct_processor_entry(struct __processor_entry *pr __attribute__((unused)))
 {
 	/*
@@ -309,5 +309,5 @@
 }
 
-void ct_bus_entry(struct __bus_entry *bus)
+void ct_bus_entry(struct __bus_entry *bus __attribute__((unused)))
 {
 #ifdef MPSCT_VERBOSE
@@ -338,5 +338,5 @@
 
 //#define MPSCT_VERBOSE
-void ct_io_intr_entry(struct __io_intr_entry *iointr)
+void ct_io_intr_entry(struct __io_intr_entry *iointr __attribute__((unused)))
 {
 #ifdef MPSCT_VERBOSE
@@ -369,5 +369,5 @@
 }
 
-void ct_l_intr_entry(struct __l_intr_entry *lintr)
+void ct_l_intr_entry(struct __l_intr_entry *lintr __attribute__((unused)))
 {
 #ifdef MPSCT_VERBOSE
Index: kernel/arch/ia32/src/smp/smp.c
===================================================================
--- kernel/arch/ia32/src/smp/smp.c	(revision d84319865c1131f37cbdba6ba952c5d38c735d0d)
+++ kernel/arch/ia32/src/smp/smp.c	(revision 7f043c0d4fa344ed23d99c9baa9f11cdac734176)
@@ -99,5 +99,5 @@
  * as an initialization stack for each AP.)
  */
-void kmp(void *arg)
+void kmp(void *arg __attribute__((unused)))
 {
 	unsigned int i;
@@ -113,6 +113,6 @@
 	 * Set the warm-reset vector to the real-mode address of 4K-aligned ap_boot()
 	 */
-	*((uint16_t *) (PA2KA(0x467 + 0))) =  ((uintptr_t) ap_boot) >> 4;	/* segment */
-	*((uint16_t *) (PA2KA(0x467 + 2))) =  0;				/* offset */
+	*((uint16_t *) (PA2KA(0x467 + 0))) = (uint16_t) (((uintptr_t) ap_boot) >> 4);	/* segment */
+	*((uint16_t *) (PA2KA(0x467 + 2))) = 0;				/* offset */
 	
 	/*
@@ -125,4 +125,6 @@
 	pic_disable_irqs(0xffff);
 	apic_init();
+	
+	uint8_t apic = l_apic_id();
 
 	for (i = 0; i < ops->cpu_count(); i++) {
@@ -141,6 +143,6 @@
 			continue;
 
-		if (ops->cpu_apic_id(i) == l_apic_id()) {
-			printf("%s: bad processor entry #%d, will not send IPI to myself\n", __FUNCTION__, i);
+		if (ops->cpu_apic_id(i) == apic) {
+			printf("%s: bad processor entry #%u, will not send IPI to myself\n", __FUNCTION__, i);
 			continue;
 		}
@@ -149,5 +151,5 @@
 		 * Prepare new GDT for CPU in question.
 		 */
-		if (!(gdt_new = (struct descriptor *) malloc(GDT_ITEMS*sizeof(struct descriptor), FRAME_ATOMIC)))
+		if (!(gdt_new = (struct descriptor *) malloc(GDT_ITEMS * sizeof(struct descriptor), FRAME_ATOMIC)))
 			panic("couldn't allocate memory for GDT\n");
 
@@ -164,6 +166,8 @@
 			 * supposed to wake us up.
 			 */
-			if (waitq_sleep_timeout(&ap_completion_wq, 1000000, SYNCH_FLAGS_NONE) == ESYNCH_TIMEOUT)
-				printf("%s: waiting for cpu%d (APIC ID = %d) timed out\n", __FUNCTION__, config.cpu_active > i ? config.cpu_active : i, ops->cpu_apic_id(i));
+			if (waitq_sleep_timeout(&ap_completion_wq, 1000000, SYNCH_FLAGS_NONE) == ESYNCH_TIMEOUT) {
+				unsigned int cpu = (config.cpu_active > i) ? config.cpu_active : i;
+				printf("%s: waiting for cpu%u (APIC ID = %d) timed out\n", __FUNCTION__, cpu, ops->cpu_apic_id(i));
+			}
 		} else
 			printf("INIT IPI for l_apic%d failed\n", ops->cpu_apic_id(i));
Index: kernel/genarch/src/acpi/acpi.c
===================================================================
--- kernel/genarch/src/acpi/acpi.c	(revision d84319865c1131f37cbdba6ba952c5d38c735d0d)
+++ kernel/genarch/src/acpi/acpi.c	(revision 7f043c0d4fa344ed23d99c9baa9f11cdac734176)
@@ -60,5 +60,5 @@
 	
 	for (i = 0; i < 20; i++)
-		sum += rsdp[i];
+		sum = (uint8_t) (sum + rsdp[i]);
 		
 	if (sum)	
@@ -69,5 +69,5 @@
 		
 	for (; i < r->length; i++)
-		sum += rsdp[i];
+		sum = (uint8_t) (sum + rsdp[i]);
 		
 	return !sum;
@@ -82,5 +82,5 @@
 
 	for (i = 0; i < h->length; i++)
-		sum += sdt[i];
+		sum = (uint8_t) (sum + sdt[i]);
 		
 	return !sum;
@@ -106,5 +106,5 @@
 					goto next;
 				*signature_map[j].sdt_ptr = h;
-				printf("%#zx: ACPI %s\n", *signature_map[j].sdt_ptr, signature_map[j].description);
+				printf("%#zp: ACPI %s\n", *signature_map[j].sdt_ptr, signature_map[j].description);
 			}
 		}
@@ -127,5 +127,5 @@
 					goto next;
 				*signature_map[j].sdt_ptr = h;
-				printf("%#zx: ACPI %s\n", *signature_map[j].sdt_ptr, signature_map[j].description);
+				printf("%#zp: ACPI %s\n", *signature_map[j].sdt_ptr, signature_map[j].description);
 			}
 		}
@@ -161,5 +161,5 @@
 
 rsdp_found:
-	printf("%#zx: ACPI Root System Description Pointer\n", acpi_rsdp);
+	printf("%#zp: ACPI Root System Description Pointer\n", acpi_rsdp);
 
 	acpi_rsdt = (struct acpi_rsdt *) (unative_t) acpi_rsdp->rsdt_address;
Index: kernel/generic/include/interrupt.h
===================================================================
--- kernel/generic/include/interrupt.h	(revision d84319865c1131f37cbdba6ba952c5d38c735d0d)
+++ kernel/generic/include/interrupt.h	(revision 7f043c0d4fa344ed23d99c9baa9f11cdac734176)
@@ -49,7 +49,8 @@
 { \
 	if (istate_from_uspace(istate)) { \
-		klog_printf("Task %llu killed due to an exception at %p.", TASK->taskid, istate_get_pc(istate)); \
+		task_t *task = TASK; \
+		klog_printf("Task %llu killed due to an exception at %p.", task->taskid, istate_get_pc(istate)); \
 		klog_printf("  " cmd, ##__VA_ARGS__); \
-		task_kill(TASK->taskid); \
+		task_kill(task->taskid); \
 		thread_exit(); \
 	} \
Index: kernel/generic/src/printf/printf_core.c
===================================================================
--- kernel/generic/src/printf/printf_core.c	(revision d84319865c1131f37cbdba6ba952c5d38c735d0d)
+++ kernel/generic/src/printf/printf_core.c	(revision 7f043c0d4fa344ed23d99c9baa9f11cdac734176)
@@ -419,8 +419,8 @@
  * TYPE:@n
  * 	- "hh"	Signed or unsigned char.@n
- * 	- "h"	Signed or usigned short.@n
- * 	- ""	Signed or usigned int (default value).@n
- * 	- "l"	Signed or usigned long int.@n
- * 	- "ll"	Signed or usigned long long int.@n
+ * 	- "h"	Signed or unsigned short.@n
+ * 	- ""	Signed or unsigned int (default value).@n
+ * 	- "l"	Signed or unsigned long int.@n
+ * 	- "ll"	Signed or unsigned long long int.@n
  * 	- "z"	unative_t (non-standard extension).@n
  * 
@@ -434,5 +434,5 @@
  * 
  * 	- P, p	Print value of a pointer. Void * value is expected and it is printed in hexadecimal notation with prefix
- * 	(as with \%#X or \%#x for 32bit or \%#X / \%#x for 64bit long pointers).
+ * 	(as with \%#X / \%#x for 32bit or \%#X / \%#x for 64bit long pointers).
  *
  * 	- b	Print value as unsigned binary number. Prefix is not printed by default. (Nonstandard extension.)
