Index: kernel/arch/amd64/src/debugger.c
===================================================================
--- kernel/arch/amd64/src/debugger.c	(revision b63f856913cad6bf9a61c703c32a10ba508f18a2)
+++ kernel/arch/amd64/src/debugger.c	(revision d51db079aa01ad329ce298e255b1840cd48189bb)
@@ -107,23 +107,29 @@
 	unsigned int i;
 	char *symbol;
-	
-	if (sizeof(void *) == 4) {
-		printf("#  Count Address    In symbol\n");
-		printf("-- ----- ---------- ---------\n");
-	} else {
-		printf("#  Count Address            In symbol\n");
-		printf("-- ----- ------------------ ---------\n");
-	}
+
+#ifdef __32_BITS__	
+	printf("#  Count Address    In symbol\n");
+	printf("-- ----- ---------- ---------\n");
+#endif
+
+#ifdef __64_BITS__
+	printf("#  Count Address            In symbol\n");
+	printf("-- ----- ------------------ ---------\n");
+#endif
 	
 	for (i = 0; i < BKPOINTS_MAX; i++)
 		if (breakpoints[i].address) {
 			symbol = get_symtab_entry(breakpoints[i].address);
-			
-			if (sizeof(void *) == 4)
-				printf("%-2u %-5d %#10zx %s\n", i, breakpoints[i].counter,
-					breakpoints[i].address, symbol);
-			else
-				printf("%-2u %-5d %#18zx %s\n", i, breakpoints[i].counter,
-					breakpoints[i].address, symbol);
+
+#ifdef __32_BITS__
+			printf("%-2u %-5d %#10zx %s\n", i, breakpoints[i].counter,
+				breakpoints[i].address, symbol);
+#endif
+
+#ifdef __64_BITS__
+			printf("%-2u %-5d %#18zx %s\n", i, breakpoints[i].counter,
+				breakpoints[i].address, symbol);
+#endif
+
 		}
 	return 1;
@@ -163,13 +169,17 @@
 			;
 		} else {
-			if (sizeof(int) == 4)
-				dr7 |= ((unative_t) 0x3) << (18 + 4*curidx);
-			else /* 8 */
-				dr7 |= ((unative_t) 0x2) << (18 + 4*curidx);
+		
+#ifdef __32_BITS__
+			dr7 |= ((unative_t) 0x3) << (18 + 4 * curidx);
+#endif
+
+#ifdef __64_BITS__
+			dr7 |= ((unative_t) 0x2) << (18 + 4 * curidx);
+#endif
 			
 			if ((flags & BKPOINT_WRITE))
-				dr7 |= ((unative_t) 0x1) << (16 + 4*curidx);
+				dr7 |= ((unative_t) 0x1) << (16 + 4 * curidx);
 			else if ((flags & BKPOINT_READ_WRITE))
-				dr7 |= ((unative_t) 0x3) << (16 + 4*curidx);
+				dr7 |= ((unative_t) 0x3) << (16 + 4 * curidx);
 		}
 
Index: kernel/arch/amd64/src/proc/thread.c
===================================================================
--- kernel/arch/amd64/src/proc/thread.c	(revision b63f856913cad6bf9a61c703c32a10ba508f18a2)
+++ kernel/arch/amd64/src/proc/thread.c	(revision d51db079aa01ad329ce298e255b1840cd48189bb)
@@ -47,5 +47,5 @@
 	 */
 	t->arch.syscall_rsp[SYSCALL_KSTACK_RSP] =
-	    (uintptr_t)&t->kstack[PAGE_SIZE - sizeof(uint64_t)];
+	    (uintptr_t) &t->kstack[PAGE_SIZE - sizeof(uint64_t)];
 }
 
Index: kernel/arch/ia32/include/mm/page.h
===================================================================
--- kernel/arch/ia32/include/mm/page.h	(revision b63f856913cad6bf9a61c703c32a10ba508f18a2)
+++ kernel/arch/ia32/include/mm/page.h	(revision d51db079aa01ad329ce298e255b1840cd48189bb)
@@ -129,4 +129,6 @@
 #include <mm/mm.h>
 #include <arch/interrupt.h>
+#include <arch/types.h>
+#include <typedefs.h>
 
 /* Page fault error codes. */
Index: kernel/arch/ia32/include/smp/apic.h
===================================================================
--- kernel/arch/ia32/include/smp/apic.h	(revision b63f856913cad6bf9a61c703c32a10ba508f18a2)
+++ kernel/arch/ia32/include/smp/apic.h	(revision d51db079aa01ad329ce298e255b1840cd48189bb)
@@ -106,6 +106,6 @@
 
 /** Interrupt Command Register. */
-#define ICRlo		(0x300/sizeof(uint32_t))
-#define ICRhi		(0x310/sizeof(uint32_t))
+#define ICRlo		(0x300 / sizeof(uint32_t))
+#define ICRhi		(0x310 / sizeof(uint32_t))
 typedef struct {
 	union {
@@ -134,8 +134,8 @@
 
 /* End Of Interrupt. */
-#define EOI		(0x0b0/sizeof(uint32_t))
+#define EOI		(0x0b0 / sizeof(uint32_t))
 
 /** Error Status Register. */
-#define ESR		(0x280/sizeof(uint32_t))
+#define ESR		(0x280 / sizeof(uint32_t))
 typedef union {
 	uint32_t value;
@@ -155,5 +155,5 @@
 
 /* Task Priority Register */
-#define TPR		(0x080/sizeof(uint32_t))
+#define TPR		(0x080 / sizeof(uint32_t))
 typedef union {
 	uint32_t value;
@@ -165,5 +165,5 @@
 
 /** Spurious-Interrupt Vector Register. */
-#define SVR		(0x0f0/sizeof(uint32_t))
+#define SVR		(0x0f0 / sizeof(uint32_t))
 typedef union {
 	uint32_t value;
@@ -177,5 +177,5 @@
 
 /** Time Divide Configuration Register. */
-#define TDCR		(0x3e0/sizeof(uint32_t))
+#define TDCR		(0x3e0 / sizeof(uint32_t))
 typedef union {
 	uint32_t value;
@@ -187,11 +187,11 @@
 
 /* Initial Count Register for Timer */
-#define ICRT		(0x380/sizeof(uint32_t))
+#define ICRT		(0x380 / sizeof(uint32_t))
 
 /* Current Count Register for Timer */
-#define CCRT		(0x390/sizeof(uint32_t))
+#define CCRT		(0x390 / sizeof(uint32_t))
 
 /** LVT Timer register. */
-#define LVT_Tm		(0x320/sizeof(uint32_t))
+#define LVT_Tm		(0x320 / sizeof(uint32_t))
 typedef union {
 	uint32_t value;
@@ -208,6 +208,6 @@
 
 /** LVT LINT registers. */
-#define LVT_LINT0	(0x350/sizeof(uint32_t))
-#define LVT_LINT1	(0x360/sizeof(uint32_t))
+#define LVT_LINT0	(0x350 / sizeof(uint32_t))
+#define LVT_LINT1	(0x360 / sizeof(uint32_t))
 typedef union {
 	uint32_t value;
@@ -226,5 +226,5 @@
 
 /** LVT Error register. */
-#define LVT_Err		(0x370/sizeof(uint32_t))
+#define LVT_Err		(0x370 / sizeof(uint32_t))
 typedef union {
 	uint32_t value;
@@ -240,5 +240,5 @@
 
 /** Local APIC ID Register. */
-#define L_APIC_ID	(0x020/sizeof(uint32_t))
+#define L_APIC_ID	(0x020 / sizeof(uint32_t))
 typedef union {
 	uint32_t value;
@@ -250,12 +250,12 @@
 
 /** Local APIC Version Register */
-#define LAVR		(0x030/sizeof(uint32_t))
+#define LAVR		(0x030 / sizeof(uint32_t))
 #define LAVR_Mask	0xff
-#define is_local_apic(x)	(((x)&LAVR_Mask&0xf0)==0x1)
-#define is_82489DX_apic(x)	((((x)&LAVR_Mask&0xf0)==0x0))
-#define is_local_xapic(x)	(((x)&LAVR_Mask)==0x14)
+#define is_local_apic(x)	(((x) & LAVR_Mask & 0xf0) == 0x1)
+#define is_82489DX_apic(x)	((((x) & LAVR_Mask & 0xf0) == 0x0))
+#define is_local_xapic(x)	(((x) & LAVR_Mask) == 0x14)
 
 /** Logical Destination Register. */
-#define  LDR		(0x0d0/sizeof(uint32_t))
+#define  LDR		(0x0d0 / sizeof(uint32_t))
 typedef union {
 	uint32_t value;
@@ -267,5 +267,5 @@
 
 /** Destination Format Register. */
-#define DFR		(0x0e0/sizeof(uint32_t))
+#define DFR		(0x0e0 / sizeof(uint32_t))
 typedef union {
 	uint32_t value;
@@ -277,6 +277,6 @@
 
 /* IO APIC */
-#define IOREGSEL	(0x00/sizeof(uint32_t))
-#define IOWIN		(0x10/sizeof(uint32_t))
+#define IOREGSEL	(0x00 / sizeof(uint32_t))
+#define IOWIN		(0x10 / sizeof(uint32_t))
 
 #define IOAPICID	0x00
Index: kernel/arch/ia32/src/debug/panic.s
===================================================================
--- kernel/arch/ia32/src/debug/panic.s	(revision b63f856913cad6bf9a61c703c32a10ba508f18a2)
+++ kernel/arch/ia32/src/debug/panic.s	(revision d51db079aa01ad329ce298e255b1840cd48189bb)
@@ -31,4 +31,4 @@
 
 panic_printf:
-	movl $halt,(%esp)	# fake stack to make printf return to halt
+	movl $halt, (%esp)	# fake stack to make printf return to halt
 	jmp printf
Index: kernel/arch/ia32xen/src/smp/smp.c
===================================================================
--- kernel/arch/ia32xen/src/smp/smp.c	(revision b63f856913cad6bf9a61c703c32a10ba508f18a2)
+++ kernel/arch/ia32xen/src/smp/smp.c	(revision d51db079aa01ad329ce298e255b1840cd48189bb)
@@ -143,5 +143,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");
 
Index: kernel/arch/mips32/src/debugger.c
===================================================================
--- kernel/arch/mips32/src/debugger.c	(revision b63f856913cad6bf9a61c703c32a10ba508f18a2)
+++ kernel/arch/mips32/src/debugger.c	(revision d51db079aa01ad329ce298e255b1840cd48189bb)
@@ -153,5 +153,5 @@
 
 	/* Check, that the breakpoints do not conflict */
-	for (i=0; i<BKPOINTS_MAX; i++) {
+	for (i = 0; i < BKPOINTS_MAX; i++) {
 		if (breakpoints[i].address == (uintptr_t)argv->intval) {
 			printf("Duplicate breakpoint %d.\n", i);
@@ -315,5 +315,5 @@
 		/* Reinst only breakpoint */
 		if ((breakpoints[i].flags & BKPOINT_REINST) \
-		    && (fireaddr ==breakpoints[i].address+sizeof(unative_t))) {
+		    && (fireaddr == breakpoints[i].address + sizeof(unative_t))) {
 			cur = &breakpoints[i];
 			break;
Index: kernel/arch/mips32/src/exception.c
===================================================================
--- kernel/arch/mips32/src/exception.c	(revision b63f856913cad6bf9a61c703c32a10ba508f18a2)
+++ kernel/arch/mips32/src/exception.c	(revision d51db079aa01ad329ce298e255b1840cd48189bb)
@@ -162,5 +162,5 @@
 				 */
 #ifdef CONFIG_DEBUG
-				printf("cpu%d: spurious interrupt (inum=%d)\n", CPU->id, i);
+				printf("cpu%u: spurious interrupt (inum=%d)\n", CPU->id, i);
 #endif
 			}
Index: kernel/arch/ppc32/include/boot/boot.h
===================================================================
--- kernel/arch/ppc32/include/boot/boot.h	(revision b63f856913cad6bf9a61c703c32a10ba508f18a2)
+++ kernel/arch/ppc32/include/boot/boot.h	(revision d51db079aa01ad329ce298e255b1840cd48189bb)
@@ -39,5 +39,5 @@
 
 /* Temporary stack size for boot process */
-#define TEMP_STACK_SIZE 0x100
+#define TEMP_STACK_SIZE 0x1000
 
 #define TASKMAP_MAX_RECORDS 32
Index: kernel/arch/ppc32/include/drivers/cuda.h
===================================================================
--- kernel/arch/ppc32/include/drivers/cuda.h	(revision b63f856913cad6bf9a61c703c32a10ba508f18a2)
+++ kernel/arch/ppc32/include/drivers/cuda.h	(revision d51db079aa01ad329ce298e255b1840cd48189bb)
@@ -37,4 +37,5 @@
 
 #include <arch/types.h>
+#include <typedefs.h>
 
 extern void cuda_init(devno_t devno, uintptr_t base, size_t size);
Index: kernel/arch/ppc32/include/exception.h
===================================================================
--- kernel/arch/ppc32/include/exception.h	(revision b63f856913cad6bf9a61c703c32a10ba508f18a2)
+++ kernel/arch/ppc32/include/exception.h	(revision d51db079aa01ad329ce298e255b1840cd48189bb)
@@ -83,4 +83,5 @@
 	istate->pc = retaddr;
 }
+
 /** Return true if exception happened while in userspace */
 #include <panic.h>
@@ -90,4 +91,5 @@
 	return 0;
 }
+
 static inline unative_t istate_get_pc(istate_t *istate)
 {
Index: kernel/arch/ppc32/include/mm/tlb.h
===================================================================
--- kernel/arch/ppc32/include/mm/tlb.h	(revision b63f856913cad6bf9a61c703c32a10ba508f18a2)
+++ kernel/arch/ppc32/include/mm/tlb.h	(revision d51db079aa01ad329ce298e255b1840cd48189bb)
@@ -37,4 +37,6 @@
 
 #include <arch/interrupt.h>
+#include <arch/types.h>
+#include <typedefs.h>
 
 typedef struct {
Index: kernel/arch/ppc32/src/interrupt.c
===================================================================
--- kernel/arch/ppc32/src/interrupt.c	(revision b63f856913cad6bf9a61c703c32a10ba508f18a2)
+++ kernel/arch/ppc32/src/interrupt.c	(revision d51db079aa01ad329ce298e255b1840cd48189bb)
@@ -81,5 +81,5 @@
 			 */
 #ifdef CONFIG_DEBUG
-			printf("cpu%d: spurious interrupt (inum=%d)\n", CPU->id, inum);
+			printf("cpu%u: spurious interrupt (inum=%d)\n", CPU->id, inum);
 #endif
 		}
Index: kernel/arch/ppc32/src/mm/page.c
===================================================================
--- kernel/arch/ppc32/src/mm/page.c	(revision b63f856913cad6bf9a61c703c32a10ba508f18a2)
+++ kernel/arch/ppc32/src/mm/page.c	(revision d51db079aa01ad329ce298e255b1840cd48189bb)
@@ -49,5 +49,5 @@
 {
 	if (last_frame + ALIGN_UP(size, PAGE_SIZE) > KA2PA(KERNEL_ADDRESS_SPACE_END_ARCH))
-		panic("Unable to map physical memory %p (%d bytes)", physaddr, size)
+		panic("Unable to map physical memory %p (%" PRIs " bytes)", physaddr, size)
 	
 	uintptr_t virtaddr = PA2KA(last_frame);
Index: kernel/arch/ppc64/include/exception.h
===================================================================
--- kernel/arch/ppc64/include/exception.h	(revision b63f856913cad6bf9a61c703c32a10ba508f18a2)
+++ kernel/arch/ppc64/include/exception.h	(revision d51db079aa01ad329ce298e255b1840cd48189bb)
@@ -83,4 +83,5 @@
 	istate->pc = retaddr;
 }
+
 /** Return true if exception happened while in userspace */
 #include <panic.h>
@@ -90,4 +91,5 @@
 	return 0;
 }
+
 static inline unative_t istate_get_pc(istate_t *istate)
 {
Index: kernel/arch/ppc64/src/cpu/cpu.c
===================================================================
--- kernel/arch/ppc64/src/cpu/cpu.c	(revision b63f856913cad6bf9a61c703c32a10ba508f18a2)
+++ kernel/arch/ppc64/src/cpu/cpu.c	(revision d51db079aa01ad329ce298e255b1840cd48189bb)
@@ -54,5 +54,5 @@
 void cpu_print_report(cpu_t *m)
 {
-	printf("cpu%d: version=%d, revision=%d\n", m->id, m->arch.version, m->arch.revision);
+	printf("cpu%u: version=%d, revision=%d\n", m->id, m->arch.version, m->arch.revision);
 }
 
Index: kernel/arch/ppc64/src/interrupt.c
===================================================================
--- kernel/arch/ppc64/src/interrupt.c	(revision b63f856913cad6bf9a61c703c32a10ba508f18a2)
+++ kernel/arch/ppc64/src/interrupt.c	(revision d51db079aa01ad329ce298e255b1840cd48189bb)
@@ -81,5 +81,5 @@
 			 */
 #ifdef CONFIG_DEBUG
-			printf("cpu%d: spurious interrupt (inum=%d)\n", CPU->id, inum);
+			printf("cpu%u: spurious interrupt (inum=%d)\n", CPU->id, inum);
 #endif
 		}
Index: kernel/arch/ppc64/src/mm/page.c
===================================================================
--- kernel/arch/ppc64/src/mm/page.c	(revision b63f856913cad6bf9a61c703c32a10ba508f18a2)
+++ kernel/arch/ppc64/src/mm/page.c	(revision d51db079aa01ad329ce298e255b1840cd48189bb)
@@ -290,5 +290,5 @@
 {
 	if (last_frame + ALIGN_UP(size, PAGE_SIZE) > KA2PA(KERNEL_ADDRESS_SPACE_END_ARCH))
-		panic("Unable to map physical memory %p (%d bytes)", physaddr, size)
+		panic("Unable to map physical memory %p (%" PRIs " bytes)", physaddr, size)
 	
 	uintptr_t virtaddr = PA2KA(last_frame);
Index: kernel/arch/sparc64/include/asm.h
===================================================================
--- kernel/arch/sparc64/include/asm.h	(revision b63f856913cad6bf9a61c703c32a10ba508f18a2)
+++ kernel/arch/sparc64/include/asm.h	(revision d51db079aa01ad329ce298e255b1840cd48189bb)
@@ -38,4 +38,5 @@
 #include <arch/arch.h>
 #include <arch/types.h>
+#include <typedefs.h>
 #include <align.h>
 #include <arch/register.h>
Index: kernel/arch/sparc64/include/cpu.h
===================================================================
--- kernel/arch/sparc64/include/cpu.h	(revision b63f856913cad6bf9a61c703c32a10ba508f18a2)
+++ kernel/arch/sparc64/include/cpu.h	(revision d51db079aa01ad329ce298e255b1840cd48189bb)
@@ -37,4 +37,5 @@
 
 #include <arch/types.h>
+#include <typedefs.h>
 #include <arch/register.h>
 #include <arch/asm.h>
Index: kernel/arch/sparc64/src/cpu/cpu.c
===================================================================
--- kernel/arch/sparc64/src/cpu/cpu.c	(revision b63f856913cad6bf9a61c703c32a10ba508f18a2)
+++ kernel/arch/sparc64/src/cpu/cpu.c	(revision d51db079aa01ad329ce298e255b1840cd48189bb)
@@ -136,5 +136,5 @@
 	}
 
-	printf("cpu%d: manuf=%s, impl=%s, mask=%d (%dMHz)\n", m->id, manuf,
+	printf("cpu%d: manuf=%s, impl=%s, mask=%d (%d MHz)\n", m->id, manuf,
 		impl, m->arch.ver.mask, m->arch.clock_frequency / 1000000);
 }
Index: kernel/arch/sparc64/src/smp/smp.c
===================================================================
--- kernel/arch/sparc64/src/smp/smp.c	(revision b63f856913cad6bf9a61c703c32a10ba508f18a2)
+++ kernel/arch/sparc64/src/smp/smp.c	(revision d51db079aa01ad329ce298e255b1840cd48189bb)
@@ -100,5 +100,5 @@
 		
 		if (waitq_sleep_timeout(&ap_completion_wq, 1000000, SYNCH_FLAGS_NONE) == ESYNCH_TIMEOUT)
-			printf("%s: waiting for processor (mid = %d) timed out\n",
+			printf("%s: waiting for processor (mid = %" PRIu32 ") timed out\n",
 			    __func__, mid);
 	}
Index: kernel/arch/sparc64/src/trap/exception.c
===================================================================
--- kernel/arch/sparc64/src/trap/exception.c	(revision b63f856913cad6bf9a61c703c32a10ba508f18a2)
+++ kernel/arch/sparc64/src/trap/exception.c	(revision d51db079aa01ad329ce298e255b1840cd48189bb)
@@ -46,7 +46,7 @@
 void dump_istate(istate_t *istate)
 {
-	printf("TSTATE=%#llx\n", istate->tstate);
-	printf("TPC=%#llx (%s)\n", istate->tpc, get_symtab_entry(istate->tpc));
-	printf("TNPC=%#llx (%s)\n", istate->tnpc, get_symtab_entry(istate->tnpc));
+	printf("TSTATE=%#" PRIx64 "\n", istate->tstate);
+	printf("TPC=%#" PRIx64 " (%s)\n", istate->tpc, get_symtab_entry(istate->tpc));
+	printf("TNPC=%#" PRIx64 " (%s)\n", istate->tnpc, get_symtab_entry(istate->tnpc));
 }
 
Index: kernel/arch/sparc64/src/trap/interrupt.c
===================================================================
--- kernel/arch/sparc64/src/trap/interrupt.c	(revision b63f856913cad6bf9a61c703c32a10ba508f18a2)
+++ kernel/arch/sparc64/src/trap/interrupt.c	(revision d51db079aa01ad329ce298e255b1840cd48189bb)
@@ -98,6 +98,6 @@
 		 */
 #ifdef CONFIG_DEBUG
-		printf("cpu%d: spurious interrupt (intrcv=%#llx, "
-			"data0=%#llx)\n", CPU->id, intrcv, data0);
+		printf("cpu%u: spurious interrupt (intrcv=%#" PRIx64
+			", data0=%#" PRIx64 ")\n", CPU->id, intrcv, data0);
 #endif
 	}
