Index: boot/arch/sparc32/Makefile.inc
===================================================================
--- boot/arch/sparc32/Makefile.inc	(revision a73ebf016708434a4b64269b2fd926ebc892e96c)
+++ boot/arch/sparc32/Makefile.inc	(revision f6f22cdb8c1b90a7f75b678cb2f8f6bf158be493)
@@ -40,5 +40,5 @@
 
 BITS = 32
-ENDIANESS = LE
+ENDIANESS = BE
 
 SOURCES = \
Index: boot/arch/sparc32/_link.ld.in
===================================================================
--- boot/arch/sparc32/_link.ld.in	(revision a73ebf016708434a4b64269b2fd926ebc892e96c)
+++ boot/arch/sparc32/_link.ld.in	(revision f6f22cdb8c1b90a7f75b678cb2f8f6bf158be493)
@@ -26,5 +26,5 @@
 	}
 	bdata_end = .;
-
+	
 	/DISCARD/ : {
 		*(.gnu.*);
Index: boot/arch/sparc32/include/ambapp.h
===================================================================
--- boot/arch/sparc32/include/ambapp.h	(revision a73ebf016708434a4b64269b2fd926ebc892e96c)
+++ boot/arch/sparc32/include/ambapp.h	(revision f6f22cdb8c1b90a7f75b678cb2f8f6bf158be493)
@@ -37,48 +37,48 @@
 #define BOOT_sparc32_AMBAPP_H
 
-#define	AMBAPP_MAX_DEVICES	64
-#define	AMBAPP_AHBMASTER_AREA	0xfffff000
-#define	AMBAPP_AHBSLAVE_AREA	0xfffff800
-#define	AMBAPP_CONF_AREA	0xff000
+#define AMBAPP_MAX_DEVICES     64
+#define AMBAPP_AHBMASTER_AREA  0xfffff000
+#define AMBAPP_AHBSLAVE_AREA   0xfffff800
+#define AMBAPP_CONF_AREA       0xff000
 
 typedef enum {
-	GAISLER			= 1,
-	ESA			= 4
+	GAISLER = 1,
+	ESA = 4
 } amba_vendor_id_t;
 
 typedef enum {
-	GAISLER_LEON3    	= 0x003,
-	GAISLER_LEON3DSU 	= 0x004,
-	GAISLER_ETHAHB   	= 0x005,
-	GAISLER_APBMST   	= 0x006,
-	GAISLER_AHBUART  	= 0x007,
-	GAISLER_SRCTRL   	= 0x008,
-	GAISLER_SDCTRL   	= 0x009,
-	GAISLER_APBUART  	= 0x00C,
-	GAISLER_IRQMP    	= 0x00D,
-	GAISLER_AHBRAM   	= 0x00E,
-	GAISLER_GPTIMER  	= 0x011,
-	GAISLER_PCITRG   	= 0x012,
-	GAISLER_PCISBRG  	= 0x013,
-	GAISLER_PCIFBRG  	= 0x014,
-	GAISLER_PCITRACE 	= 0x015,
-	GAISLER_PCIDMA   	= 0x016,
-	GAISLER_AHBTRACE 	= 0x017,
-	GAISLER_ETHDSU   	= 0x018,
-	GAISLER_PIOPORT  	= 0x01A,
-	GAISLER_AHBJTAG  	= 0x01c,
-	GAISLER_SPW      	= 0x01f,
-	GAISLER_ATACTRL  	= 0x024,
-	GAISLER_VGA      	= 0x061,
-	GAISLER_KBD      	= 0x060,
-	GAISLER_ETHMAC   	= 0x01D,
-	GAISLER_DDRSPA   	= 0x025,
-	GAISLER_EHCI     	= 0x026,
-	GAISLER_UHCI     	= 0x027,
-	GAISLER_SPW2     	= 0x029,
-	GAISLER_DDR2SPA  	= 0x02E,
-	GAISLER_AHBSTAT  	= 0x052,
-	GAISLER_FTMCTRL  	= 0x054,
-	ESA_MCTRL		= 0x00F,
+	GAISLER_LEON3    = 0x003,
+	GAISLER_LEON3DSU = 0x004,
+	GAISLER_ETHAHB   = 0x005,
+	GAISLER_APBMST   = 0x006,
+	GAISLER_AHBUART  = 0x007,
+	GAISLER_SRCTRL   = 0x008,
+	GAISLER_SDCTRL   = 0x009,
+	GAISLER_APBUART  = 0x00c,
+	GAISLER_IRQMP    = 0x00d,
+	GAISLER_AHBRAM   = 0x00e,
+	GAISLER_GPTIMER  = 0x011,
+	GAISLER_PCITRG   = 0x012,
+	GAISLER_PCISBRG  = 0x013,
+	GAISLER_PCIFBRG  = 0x014,
+	GAISLER_PCITRACE = 0x015,
+	GAISLER_PCIDMA   = 0x016,
+	GAISLER_AHBTRACE = 0x017,
+	GAISLER_ETHDSU   = 0x018,
+	GAISLER_PIOPORT  = 0x01a,
+	GAISLER_AHBJTAG  = 0x01c,
+	GAISLER_SPW      = 0x01f,
+	GAISLER_ATACTRL  = 0x024,
+	GAISLER_VGA      = 0x061,
+	GAISLER_KBD      = 0x060,
+	GAISLER_ETHMAC   = 0x01d,
+	GAISLER_DDRSPA   = 0x025,
+	GAISLER_EHCI     = 0x026,
+	GAISLER_UHCI     = 0x027,
+	GAISLER_SPW2     = 0x029,
+	GAISLER_DDR2SPA  = 0x02e,
+	GAISLER_AHBSTAT  = 0x052,
+	GAISLER_FTMCTRL  = 0x054,
+	ESA_MCTRL        = 0x00f,
 } amba_device_id_t;
 
@@ -109,18 +109,18 @@
 
 typedef struct {
-	unsigned int addr: 12;
-	unsigned int reserved: 2;
-	unsigned int prefetchable: 1;
-	unsigned int cacheable: 1;
-	unsigned int mask: 12;
-	unsigned int type: 4;
+	unsigned int addr : 12;
+	unsigned int reserved : 2;
+	unsigned int prefetchable : 1;
+	unsigned int cacheable : 1;
+	unsigned int mask : 12;
+	unsigned int type : 4;
 } __attribute__((packed)) ambapp_bar_t;
 
 typedef struct {
-	unsigned int vendor_id: 8;
-	unsigned int device_id: 24;
-	unsigned int reserved: 2;
-	unsigned int version: 5;
-	unsigned int irq: 5;
+	unsigned int vendor_id : 8;
+	unsigned int device_id : 24;
+	unsigned int reserved : 2;
+	unsigned int version : 5;
+	unsigned int irq : 5;
 	uint32_t user_defined[3];
 	ambapp_bar_t bar[4];
@@ -128,36 +128,36 @@
 
 typedef struct {
-	unsigned int ram_read_ws: 1;
-	unsigned int ram_write_ws: 1;
-	unsigned int ram_width: 2;
-	unsigned int rmw: 1;
-	unsigned int rbrdy: 1;
+	unsigned int ram_read_ws : 1;
+	unsigned int ram_write_ws : 1;
+	unsigned int ram_width : 2;
+	unsigned int rmw : 1;
+	unsigned int rbrdy : 1;
 	unsigned int : 1;
-	unsigned int bank_size: 4;
-	unsigned int si: 1;
-	unsigned int se: 1;
+	unsigned int bank_size : 4;
+	unsigned int si : 1;
+	unsigned int se : 1;
 	unsigned int : 1;
-	unsigned int ms: 1;
+	unsigned int ms : 1;
 	unsigned int : 1;
-	unsigned int d64: 1;
-	unsigned int sdram_cmd: 2;
-	unsigned int sdram_colsz: 2;
-	unsigned int sdram_banksz: 3;
-	unsigned int tcas: 1;
-	unsigned int trfc: 3;
-	unsigned int trp: 1;
-	unsigned int sdrf: 1;
+	unsigned int d64 : 1;
+	unsigned int sdram_cmd : 2;
+	unsigned int sdram_colsz : 2;
+	unsigned int sdram_banksz : 3;
+	unsigned int tcas : 1;
+	unsigned int trfc : 3;
+	unsigned int trp : 1;
+	unsigned int sdrf : 1;
 } __attribute__((packed)) mctrl_mcfg2_t;
 
-amba_device_t amba_devices[AMBAPP_MAX_DEVICES];
-int amba_devices_found;
-bool amba_fake;
-uintptr_t amba_uart_base;
+extern amba_device_t amba_devices[AMBAPP_MAX_DEVICES];
+extern int amba_devices_found;
+extern bool amba_fake;
+extern uintptr_t amba_uart_base;
 
-void ambapp_scan(void);
-bool ambapp_fake(void);
-void ambapp_qemu_fake_scan(void);
-void ambapp_print_devices(void);
-amba_device_t *ambapp_lookup_first(amba_vendor_id_t, amba_device_id_t);
+extern void ambapp_scan(void);
+extern bool ambapp_fake(void);
+extern void ambapp_qemu_fake_scan(void);
+extern void ambapp_print_devices(void);
+extern amba_device_t *ambapp_lookup_first(amba_vendor_id_t, amba_device_id_t);
 
 #endif
Index: boot/arch/sparc32/include/arch.h
===================================================================
--- boot/arch/sparc32/include/arch.h	(revision a73ebf016708434a4b64269b2fd926ebc892e96c)
+++ boot/arch/sparc32/include/arch.h	(revision f6f22cdb8c1b90a7f75b678cb2f8f6bf158be493)
@@ -30,23 +30,24 @@
 #define BOOT_sparc32_ARCH_H
 
-#define	PTL0_ENTRIES	256
-#define	PTL0_SHIFT	24
-#define	PTL0_SIZE	(1 << 24)
-#define	PTL0_ENTRY_SIZE	4
+#define PTL0_ENTRIES     256
+#define PTL0_SHIFT       24
+#define PTL0_SIZE        (1 << 24)
+#define PTL0_ENTRY_SIZE  4
 
 /* ASI assignments: */
-#define	ASI_CACHEMISS	0x01
-#define	ASI_CACHECTRL	0x02
-#define	ASI_MMUREGS	0x19
-#define	ASI_MMUBYPASS	0x1c
+#define ASI_CACHEMISS  0x01
+#define ASI_CACHECTRL  0x02
+#define ASI_MMUREGS    0x19
+#define ASI_MMUBYPASS  0x1c
 
 /*
- * Address where the boot stage image starts (beginning of usable physical
- * memory).
+ * Address where the boot stage image starts
+ * (beginning of usable physical memory).
  */
-#define BOOT_BASE	0x40000000
-#define BOOT_OFFSET	(BOOT_BASE + 0xa00000)
 
-#define PA_OFFSET 0x40000000
+#define BOOT_BASE   0x40000000
+#define BOOT_OFFSET (BOOT_BASE + 0xa00000)
+
+#define PA_OFFSET  0x40000000
 
 #ifndef __ASM__
@@ -56,5 +57,4 @@
 #endif
 
-
 #endif
 
Index: boot/arch/sparc32/include/asm.h
===================================================================
--- boot/arch/sparc32/include/asm.h	(revision a73ebf016708434a4b64269b2fd926ebc892e96c)
+++ boot/arch/sparc32/include/asm.h	(revision f6f22cdb8c1b90a7f75b678cb2f8f6bf158be493)
@@ -32,13 +32,15 @@
 #include <typedefs.h>
 
-static inline uint32_t asi_u32_read(int asi, uintptr_t va)
+extern uintptr_t boot_ctx_table;
+
+static inline uint32_t asi_u32_read(unsigned int asi, uintptr_t va)
 {
 	uint32_t v;
-
+	
 	asm volatile (
 		"lda [%[va]] %[asi], %[v]\n"
 		: [v] "=r" (v)
 		: [va] "r" (va),
-		  [asi] "i" ((unsigned int) asi)
+		  [asi] "i" (asi)
 	);
 	
@@ -46,5 +48,5 @@
 }
 
-static inline void asi_u32_write(int asi, uintptr_t va, uint32_t v)
+static inline void asi_u32_write(unsigned int asi, uintptr_t va, uint32_t v)
 {
 	asm volatile (
@@ -52,10 +54,10 @@
 		:: [v] "r" (v),
 		   [va] "r" (va),
-		   [asi] "i" ((unsigned int) asi)
+		   [asi] "i" (asi)
 		: "memory"
 	);
 }
 
-extern void jump_to_kernel(void *entry, bootinfo_t *bootinfo);
+extern void jump_to_kernel(void *, bootinfo_t *);
 
 #endif
Index: boot/arch/sparc32/include/main.h
===================================================================
--- boot/arch/sparc32/include/main.h	(revision a73ebf016708434a4b64269b2fd926ebc892e96c)
+++ boot/arch/sparc32/include/main.h	(revision f6f22cdb8c1b90a7f75b678cb2f8f6bf158be493)
@@ -35,9 +35,9 @@
 
 #ifndef BOOT_sparc32_MAIN_H
-#define BOOT_sparc2_MAIN_H
+#define BOOT_sparc32_MAIN_H
 
 /** Address where characters to be printed are expected. */
-#define	APBUART_SCONS_THR	0x80000100
-#define	APBUART_SCONS_THR_MMU	0xb0000100
+#define APBUART_SCONS_THR      0x80000100
+#define APBUART_SCONS_THR_MMU  0xb0000100
 
 extern void bootstrap(void);
Index: boot/arch/sparc32/include/mm.h
===================================================================
--- boot/arch/sparc32/include/mm.h	(revision a73ebf016708434a4b64269b2fd926ebc892e96c)
+++ boot/arch/sparc32/include/mm.h	(revision f6f22cdb8c1b90a7f75b678cb2f8f6bf158be493)
@@ -39,10 +39,10 @@
  */
 
-#ifndef BOOT_sparc32__MM_H
-#define BOOT_sparc32__MM_H
+#ifndef BOOT_sparc32_MM_H
+#define BOOT_sparc32_MM_H
 
 #include <typedefs.h>
 
-#define	PAGE_SIZE	(1 << 12)
+#define PAGE_SIZE  (1 << 12)
 
 typedef struct {
@@ -54,20 +54,20 @@
 
 typedef struct {
-	unsigned int ppn: 24;
-	unsigned int cacheable: 1;
-	unsigned int modified: 1;
-	unsigned int referenced: 1;
-	unsigned int acc: 3;
-	unsigned int et: 2;
+	unsigned int ppn : 24;
+	unsigned int cacheable : 1;
+	unsigned int modified : 1;
+	unsigned int referenced : 1;
+	unsigned int acc : 3;
+	unsigned int et : 2;
 } __attribute__((packed)) pte_t;
 
 extern pte_t boot_pt[PTL0_ENTRIES];
 
-void mmu_init(void);
+extern void mmu_init(void);
 
-#define	PTE_ET_DESCRIPTOR	1
-#define	PTE_ET_ENTRY		2
-#define	PTE_ACC_RWX		3
-#define	MMU_CONTROL_EN		(1 << 0)
+#define PTE_ET_DESCRIPTOR  1
+#define PTE_ET_ENTRY       2
+#define PTE_ACC_RWX        3
+#define MMU_CONTROL_EN     (1 << 0)
 
 #endif
Index: boot/arch/sparc32/src/ambapp.c
===================================================================
--- boot/arch/sparc32/src/ambapp.c	(revision a73ebf016708434a4b64269b2fd926ebc892e96c)
+++ boot/arch/sparc32/src/ambapp.c	(revision f6f22cdb8c1b90a7f75b678cb2f8f6bf158be493)
@@ -50,19 +50,19 @@
 #include <errno.h>
 
-static void ambapp_scan_area(uintptr_t, int);
+static void ambapp_scan_area(uintptr_t, unsigned int);
 
 void ambapp_scan()
 {
 	amba_fake = false;
-
+	
 	/* Scan for AHB masters & slaves */
 	ambapp_scan_area(AMBAPP_AHBMASTER_AREA, 64);
 	ambapp_scan_area(AMBAPP_AHBSLAVE_AREA, 63);
-
+	
 	/* Scan for APB slaves on APBMST */
 	amba_device_t *apbmst = ambapp_lookup_first(GAISLER, GAISLER_APBMST);
 	if (apbmst != NULL)
 		ambapp_scan_area(apbmst->bars[0].start, 16);
-
+	
 	/* If we found nothing, fake device entries */
 	if (amba_devices_found == 0)
@@ -70,28 +70,28 @@
 }
 
-static void ambapp_scan_area(uintptr_t master_bar, int max_entries)
+static void ambapp_scan_area(uintptr_t master_bar, unsigned int max_entries)
 {
 	ambapp_entry_t *entry = (ambapp_entry_t *) (master_bar | AMBAPP_CONF_AREA);
-
-	for (int i = 0; i < max_entries; i++) {
+	
+	for (unsigned int i = 0; i < max_entries; i++) {
 		if (amba_devices_found == AMBAPP_MAX_DEVICES)
 			return;
-
+		
 		if (entry->vendor_id == 0xff)
 			continue;
-
+		
 		amba_device_t *device = &amba_devices[amba_devices_found];
-		device->vendor_id = (amba_vendor_id_t)entry->vendor_id;
-	device->device_id = (amba_device_id_t)entry->device_id;
+		device->vendor_id = (amba_vendor_id_t) entry->vendor_id;
+		device->device_id = (amba_device_id_t) entry->device_id;
 		device->version = entry->version;
 		device->irq = entry->irq;
-	
-		for (int bar = 0; bar < 4; bar++) {
+		
+		for (unsigned int bar = 0; bar < 4; bar++) {
 			device->bars[bar].start = entry->bar[bar].addr << 20;
 			device->bars[bar].size = entry->bar[bar].mask;
-			device->bars[bar].prefetchable = (bool)entry->bar[bar].prefetchable;
-			device->bars[bar].cacheable = (bool)entry->bar[bar].cacheable;
+			device->bars[bar].prefetchable = (bool) entry->bar[bar].prefetchable;
+			device->bars[bar].cacheable = (bool) entry->bar[bar].cacheable;
 		}
-
+		
 		amba_devices_found++;
 	}
@@ -107,5 +107,5 @@
 	amba_devices[0].bars[0].start = 0x80000100;
 	amba_devices[0].bars[0].size = 0x100;
-
+	
 	/* IRQMP */
 	amba_devices[1].vendor_id = GAISLER;
@@ -115,5 +115,5 @@
 	amba_devices[1].bars[0].start = 0x80000200;
 	amba_devices[1].bars[0].size = 0x100;
-
+	
 	/* GPTIMER */
 	amba_devices[2].vendor_id = GAISLER;
@@ -123,5 +123,5 @@
 	amba_devices[2].bars[0].start = 0x80000300;
 	amba_devices[2].bars[0].size = 0x100;
-
+	
 	amba_fake = true;
 	amba_devices_found = 3;
@@ -136,8 +136,11 @@
 {
 	printf("ABMA devices:\n");
-
-	for (int i = 0; i < amba_devices_found; i++) {
+	
+	for (unsigned int i = 0; i < amba_devices_found; i++) {
 		amba_device_t *dev = &amba_devices[i];
-		printf("<%1x:%03x> at 0x%08x ", dev->vendor_id, dev->device_id, dev->bars[0].start);
+		
+		printf("<%1x:%03x> at 0x%08x ", dev->vendor_id, dev->device_id,
+		    dev->bars[0].start);
+		
 		if (dev->irq == -1)
 			printf("\n");
@@ -147,12 +150,13 @@
 }
 
-amba_device_t *ambapp_lookup_first(amba_vendor_id_t vendor, amba_device_id_t device)
+amba_device_t *ambapp_lookup_first(amba_vendor_id_t vendor,
+    amba_device_id_t device)
 {
-	for (int i = 0; i < amba_devices_found; i++) {
-		if (amba_devices[i].vendor_id == vendor &&
-		    amba_devices[i].device_id == device)
+	for (unsigned int i = 0; i < amba_devices_found; i++) {
+		if ((amba_devices[i].vendor_id == vendor) &&
+		    (amba_devices[i].device_id == device))
 			return &amba_devices[i];
 	}
-
+	
 	return NULL;
 }
Index: boot/arch/sparc32/src/main.c
===================================================================
--- boot/arch/sparc32/src/main.c	(revision a73ebf016708434a4b64269b2fd926ebc892e96c)
+++ boot/arch/sparc32/src/main.c	(revision f6f22cdb8c1b90a7f75b678cb2f8f6bf158be493)
@@ -52,4 +52,5 @@
 
 #define TOP2ADDR(top)  (((void *) PA2KA(BOOT_OFFSET)) + (top))
+
 static bootinfo_t bootinfo;
 
@@ -58,32 +59,32 @@
 	/* Initialize AMBA P&P device list */
 	ambapp_scan();
-
-	/* Look up for UART */
+	
+	/* Look for UART */
 	amba_device_t *uart = ambapp_lookup_first(GAISLER, GAISLER_APBUART);
 	amba_uart_base = uart->bars[0].start;
 	bootinfo.uart_base = amba_uart_base;
 	bootinfo.uart_irq = uart->irq;
-
-	/* Look up for IRQMP */
+	
+	/* Look for IRQMP */
 	amba_device_t *irqmp = ambapp_lookup_first(GAISLER, GAISLER_IRQMP);
 	bootinfo.intc_base = irqmp->bars[0].start;
-
-	/* Look up for timer */
+	
+	/* Look for timer */
 	amba_device_t *timer = ambapp_lookup_first(GAISLER, GAISLER_GPTIMER);
 	bootinfo.timer_base = timer->bars[0].start;
 	bootinfo.timer_irq = timer->irq;
 	
-	/* Lookp up for memory controller and obtain memory size */
-	if (ambapp_fake()) {
-		bootinfo.memsize = 64 * 1024 * 1024; // 64MB
-	} else {
+	/* Look for memory controller and obtain memory size */
+	if (!ambapp_fake()) {
 		amba_device_t *mctrl = ambapp_lookup_first(ESA, ESA_MCTRL);
-		volatile mctrl_mcfg2_t *mcfg2 = (volatile mctrl_mcfg2_t *)(mctrl->bars[0].start + 0x4);
+		volatile mctrl_mcfg2_t *mcfg2 = (volatile mctrl_mcfg2_t *)
+		    (mctrl->bars[0].start + 0x4);
 		bootinfo.memsize = (1 << (13 + mcfg2->bank_size));
-	}
+	} else
+		bootinfo.memsize = 64 * 1024 * 1024;
 	
 	/* Standard output is now initialized */
 	version_print();
-
+	
 	for (size_t i = 0; i < COMPONENTS; i++) {
 		printf(" %p|%p: %s image (%u/%u bytes)\n", components[i].start,
@@ -91,11 +92,11 @@
 		    components[i].size);
 	}
-
+	
 	ambapp_print_devices();
-
-	printf("Memory size: %dMB\n", bootinfo.memsize >> 20);
-
+	
+	printf("Memory size: %u MB\n", bootinfo.memsize >> 20);
+	
 	mmu_init();
-
+	
 	void *dest[COMPONENTS];
 	size_t top = 0;
@@ -116,5 +117,5 @@
 		
 		dest[i] = TOP2ADDR(top);
-
+		
 		top += components[i].inflated;
 		cnt++;
@@ -128,5 +129,5 @@
 			printf("\n%s: Image too large to fit (%p >= %p), halting.\n",
 			    components[i].name, tail, dest[i - 1]);
-			for (;;);
+			halt();
 		}
 		
@@ -137,8 +138,8 @@
 		if (err != EOK) {
 			printf("\n%s: Inflating error %d\n", components[i - 1].name, err);
-			for (;;);
+			halt();
 		}
 	}
-
+	
 	printf("Booting the kernel ... \n");
 	jump_to_kernel((void *) PA2KA(BOOT_OFFSET), &bootinfo);
Index: boot/arch/sparc32/src/mm.c
===================================================================
--- boot/arch/sparc32/src/mm.c	(revision a73ebf016708434a4b64269b2fd926ebc892e96c)
+++ boot/arch/sparc32/src/mm.c	(revision f6f22cdb8c1b90a7f75b678cb2f8f6bf158be493)
@@ -50,6 +50,6 @@
 #include <inflate.h>
 
-#define	OFF2SEC(_addr)	((_addr) >> PTL0_SHIFT)
-#define	SEC2OFF(_sec)	((_sec) << PTL0_SHIFT)
+#define OFF2SEC(_addr)  ((_addr) >> PTL0_SHIFT)
+#define SEC2OFF(_sec)   ((_sec) << PTL0_SHIFT)
 
 static section_mapping_t mappings[] = {
@@ -60,16 +60,14 @@
 };
 
-extern uintptr_t boot_ctx_table;
-
-static void mmu_enable()
+static void mmu_enable(void)
 {
-	boot_ctx_table = ((uintptr_t)&boot_pt[0] >> 4) | PTE_ET_DESCRIPTOR;
-
+	boot_ctx_table = ((uintptr_t) &boot_pt[0] >> 4) | PTE_ET_DESCRIPTOR;
+	
 	/* Set Context Table Pointer register */
-	asi_u32_write(ASI_MMUREGS, 0x100, ((uint32_t)&boot_ctx_table) >> 4);
-
+	asi_u32_write(ASI_MMUREGS, 0x100, ((uint32_t) &boot_ctx_table) >> 4);
+	
 	/* Select context 0 */
 	asi_u32_write(ASI_MMUREGS, 0x200, 0);
-
+	
 	/* Enable MMU */
 	uint32_t cr = asi_u32_read(ASI_MMUREGS, 0x000);
@@ -85,13 +83,13 @@
 }
 
-void mmu_init()
+void mmu_init(void)
 {
 	mmu_disable();
-
-	for (int i = 0; mappings[i].size != 0; i++) {
-		int ptr = 0;
-		for (uint32_t sec = OFF2SEC(mappings[i].va); 
-		     sec < OFF2SEC(mappings[i].va + mappings[i].size);
-		     sec++) {
+	
+	for (unsigned int i = 0; mappings[i].size != 0; i++) {
+		unsigned int ptr = 0;
+		for (uint32_t sec = OFF2SEC(mappings[i].va);
+		    sec < OFF2SEC(mappings[i].va + mappings[i].size);
+		    sec++) {
 			boot_pt[sec].ppn = ((mappings[i].pa + SEC2OFF(ptr++)) >> 12) & 0xffffff;
 			boot_pt[sec].cacheable = mappings[i].cacheable;
@@ -100,5 +98,5 @@
 		}
 	}
-
+	
 	mmu_enable();
 }
Index: boot/arch/sparc32/src/putchar.c
===================================================================
--- boot/arch/sparc32/src/putchar.c	(revision a73ebf016708434a4b64269b2fd926ebc892e96c)
+++ boot/arch/sparc32/src/putchar.c	(revision f6f22cdb8c1b90a7f75b678cb2f8f6bf158be493)
@@ -47,5 +47,6 @@
 /** Send a byte to the LEON3 serial console.
  *
- * @param byte		Byte to send.
+ * @param byte Byte to send.
+ *
  */
 static void scons_sendb(uint8_t byte)
@@ -56,5 +57,6 @@
 /** Display a character
  *
- * @param ch	Character to display
+ * @param ch Character to display
+ *
  */
 void putchar(const wchar_t ch)
@@ -62,5 +64,5 @@
 	if (ch == '\n')
 		scons_sendb('\r');
-
+	
 	if (ascii_check(ch))
 		scons_sendb((uint8_t) ch);
