Index: kernel/arch/arm32/include/arch.h
===================================================================
--- kernel/arch/arm32/include/arch.h	(revision 556f9892d2e10c220ff5474d54af02f68faf6925)
+++ kernel/arch/arm32/include/arch.h	(revision 2afb650952fa50390d07e579422af9f1607b9ad6)
@@ -45,11 +45,11 @@
 
 typedef struct {
-	uintptr_t addr;
-	uint32_t size;
+	void *addr;
+	size_t size;
 	char name[BOOTINFO_TASK_NAME_BUFLEN];
 } utask_t;
 
 typedef struct {
-	uint32_t cnt;
+	size_t cnt;
 	utask_t tasks[TASKMAP_MAX_RECORDS];
 } bootinfo_t;
Index: kernel/arch/arm32/include/mm/frame.h
===================================================================
--- kernel/arch/arm32/include/mm/frame.h	(revision 556f9892d2e10c220ff5474d54af02f68faf6925)
+++ kernel/arch/arm32/include/mm/frame.h	(revision 2afb650952fa50390d07e579422af9f1607b9ad6)
@@ -46,5 +46,5 @@
 
 #define BOOT_PAGE_TABLE_SIZE     0x4000
-#define BOOT_PAGE_TABLE_ADDRESS  0x4000
+#define BOOT_PAGE_TABLE_ADDRESS  0x8000
 
 #define BOOT_PAGE_TABLE_START_FRAME     (BOOT_PAGE_TABLE_ADDRESS >> FRAME_WIDTH)
Index: kernel/arch/arm32/src/arm32.c
===================================================================
--- kernel/arch/arm32/src/arm32.c	(revision 556f9892d2e10c220ff5474d54af02f68faf6925)
+++ kernel/arch/arm32/src/arm32.c	(revision 2afb650952fa50390d07e579422af9f1607b9ad6)
@@ -62,10 +62,9 @@
 void arch_pre_main(void *entry __attribute__((unused)), bootinfo_t *bootinfo)
 {
-	unsigned int i;
+	init.cnt = min3(bootinfo->cnt, TASKMAP_MAX_RECORDS, CONFIG_INIT_TASKS);
 	
-	init.cnt = bootinfo->cnt;
-	
-	for (i = 0; i < min3(bootinfo->cnt, TASKMAP_MAX_RECORDS, CONFIG_INIT_TASKS); ++i) {
-		init.tasks[i].addr = bootinfo->tasks[i].addr;
+	size_t i;
+	for (i = 0; i < init.cnt; i++) {
+		init.tasks[i].addr = (uintptr_t) bootinfo->tasks[i].addr;
 		init.tasks[i].size = bootinfo->tasks[i].size;
 		str_cpy(init.tasks[i].name, CONFIG_TASK_NAME_BUFLEN,
Index: kernel/arch/ia64/include/bootinfo.h
===================================================================
--- kernel/arch/ia64/include/bootinfo.h	(revision 556f9892d2e10c220ff5474d54af02f68faf6925)
+++ kernel/arch/ia64/include/bootinfo.h	(revision 2afb650952fa50390d07e579422af9f1607b9ad6)
@@ -32,5 +32,5 @@
 #define BOOTINFO_ADDRESS 0x4401000
 
-#define CONFIG_INIT_TASKS	32
+#define TASKMAP_MAX_RECORDS  32
 
 #define MEMMAP_ITEMS 128
@@ -44,12 +44,12 @@
 
 typedef struct {
-	void *addr; 
-	unsigned long size;
+	void *addr;
+	size_t size;
 	char name[BOOTINFO_TASK_NAME_BUFLEN];
 } binit_task_t;
 	
 typedef struct {
-	unsigned long count;
-	binit_task_t tasks[CONFIG_INIT_TASKS];
+	size_t cnt;
+	binit_task_t tasks[TASKMAP_MAX_RECORDS];
 } binit_t;
 
@@ -58,13 +58,12 @@
 	unsigned long base;
 	unsigned long size;
-}efi_memmap_item_t;
-
+} efi_memmap_item_t;
 
 typedef struct {
 	binit_t taskmap;
-
+	
 	efi_memmap_item_t memmap[MEMMAP_ITEMS];
 	unsigned int memmap_items;
-
+	
 	unative_t *sapic;
 	unsigned long sys_freq;
Index: kernel/arch/ia64/src/ia64.c
===================================================================
--- kernel/arch/ia64/src/ia64.c	(revision 556f9892d2e10c220ff5474d54af02f68faf6925)
+++ kernel/arch/ia64/src/ia64.c	(revision 2afb650952fa50390d07e579422af9f1607b9ad6)
@@ -47,4 +47,5 @@
 #include <mm/as.h>
 #include <config.h>
+#include <macros.h>
 #include <userspace.h>
 #include <console/console.h>
@@ -78,10 +79,6 @@
 void arch_pre_main(void)
 {
-	/* Setup usermode init tasks. */
-
-	unsigned int i;
-	
-	init.cnt = bootinfo->taskmap.count;
-	
+	init.cnt = min3(bootinfo->taskmap.cnt, TASKMAP_MAX_RECORDS, CONFIG_INIT_TASKS);
+	size_t i;
 	for (i = 0; i < init.cnt; i++) {
 		init.tasks[i].addr =
Index: kernel/arch/mips32/include/arch.h
===================================================================
--- kernel/arch/mips32/include/arch.h	(revision 556f9892d2e10c220ff5474d54af02f68faf6925)
+++ kernel/arch/mips32/include/arch.h	(revision 2afb650952fa50390d07e579422af9f1607b9ad6)
@@ -45,5 +45,5 @@
 
 typedef struct {
-	uintptr_t addr;
+	void *addr;
 	size_t size;
 	char name[BOOTINFO_TASK_NAME_BUFLEN];
Index: kernel/arch/mips32/src/mips32.c
===================================================================
--- kernel/arch/mips32/src/mips32.c	(revision 556f9892d2e10c220ff5474d54af02f68faf6925)
+++ kernel/arch/mips32/src/mips32.c	(revision 2afb650952fa50390d07e579422af9f1607b9ad6)
@@ -83,10 +83,9 @@
 void arch_pre_main(void *entry __attribute__((unused)), bootinfo_t *bootinfo)
 {
-	/* Setup usermode */
-	init.cnt = bootinfo->cnt;
+	init.cnt = min3(bootinfo->cnt, TASKMAP_MAX_RECORDS, CONFIG_INIT_TASKS);
 	
 	size_t i;
-	for (i = 0; i < min3(bootinfo->cnt, TASKMAP_MAX_RECORDS, CONFIG_INIT_TASKS); i++) {
-		init.tasks[i].addr = bootinfo->tasks[i].addr;
+	for (i = 0; i < init.cnt; i++) {
+		init.tasks[i].addr = (uintptr_t) bootinfo->tasks[i].addr;
 		init.tasks[i].size = bootinfo->tasks[i].size;
 		str_cpy(init.tasks[i].name, CONFIG_TASK_NAME_BUFLEN,
Index: kernel/arch/ppc32/include/arch.h
===================================================================
--- kernel/arch/ppc32/include/arch.h	(revision 556f9892d2e10c220ff5474d54af02f68faf6925)
+++ kernel/arch/ppc32/include/arch.h	(revision 2afb650952fa50390d07e579422af9f1607b9ad6)
@@ -36,5 +36,7 @@
 #define KERN_ppc32_ARCH_H_
 
-extern void arch_pre_main(void);
+#include <arch/boot/boot.h>
+
+extern void arch_pre_main(bootinfo_t *);
 
 #endif
Index: kernel/arch/ppc32/include/boot/boot.h
===================================================================
--- kernel/arch/ppc32/include/boot/boot.h	(revision 556f9892d2e10c220ff5474d54af02f68faf6925)
+++ kernel/arch/ppc32/include/boot/boot.h	(revision 2afb650952fa50390d07e579422af9f1607b9ad6)
@@ -52,22 +52,22 @@
 
 typedef struct {
-	uintptr_t addr;
-	uint32_t size;
+	void *addr;
+	size_t size;
 	char name[BOOTINFO_TASK_NAME_BUFLEN];
 } utask_t;
 
 typedef struct {
-	uint32_t count;
+	size_t cnt;
 	utask_t tasks[TASKMAP_MAX_RECORDS];
 } taskmap_t;
 
 typedef struct {
-	uintptr_t start;
-	uint32_t size;
+	void *start;
+	size_t size;
 } memzone_t;
 
 typedef struct {
-	uint32_t total;
-	uint32_t count;
+	uint64_t total;
+	size_t cnt;
 	memzone_t zones[MEMMAP_MAX_RECORDS];
 } memmap_t;
@@ -80,5 +80,5 @@
 } bootinfo_t;
 
-extern bootinfo_t bootinfo;
+extern memmap_t memmap;
 
 #endif
Index: kernel/arch/ppc32/src/boot/boot.S
===================================================================
--- kernel/arch/ppc32/src/boot/boot.S	(revision 556f9892d2e10c220ff5474d54af02f68faf6925)
+++ kernel/arch/ppc32/src/boot/boot.S	(revision 2afb650952fa50390d07e579422af9f1607b9ad6)
@@ -47,28 +47,6 @@
 	
 	# r3 contains physical address of bootinfo_t
-	# r4 contains size of bootinfo_t
-	
-	cmpwi r4, 0
-	beq bootinfo_end
 	
 	addis r3, r3, 0x8000
-	
-	lis r31, bootinfo@ha
-	addi r31, r31, bootinfo@l  # r31 = bootinfo
-	
-	bootinfo_loop:
-		
-		lwz r30, 0(r3)
-		stw r30, 0(r31)
-		
-		addi r3, r3, 4
-		addi r31, r31, 4
-		subi r4, r4, 4
-		
-		cmpwi r4, 0
-		bgt bootinfo_loop
-		
-	bootinfo_end:
-	
 	bl arch_pre_main
 	b main_bsp
Index: kernel/arch/ppc32/src/mm/frame.c
===================================================================
--- kernel/arch/ppc32/src/mm/frame.c	(revision 556f9892d2e10c220ff5474d54af02f68faf6925)
+++ kernel/arch/ppc32/src/mm/frame.c	(revision 2afb650952fa50390d07e579422af9f1607b9ad6)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup ppc32mm	
+/** @addtogroup ppc32mm
  * @{
  */
@@ -41,4 +41,5 @@
 
 uintptr_t last_frame = 0;
+memmap_t memmap;
 
 void physmem_print(void)
@@ -49,7 +50,7 @@
 	printf("---------- ----------\n");
 		
-	for (i = 0; i < bootinfo.memmap.count; i++) {
-		printf("%#10x %#10x\n", bootinfo.memmap.zones[i].start,
-			bootinfo.memmap.zones[i].size);
+	for (i = 0; i < memmap.cnt; i++) {
+		printf("%#10x %#10x\n", memmap.zones[i].start,
+			memmap.zones[i].size);
 	}
 }
@@ -62,7 +63,7 @@
 	size_t size;
 	
-	for (i = 0; i < bootinfo.memmap.count; i++) {
-		start = ADDR2PFN(ALIGN_UP(bootinfo.memmap.zones[i].start, FRAME_SIZE));
-		size = SIZE2FRAMES(ALIGN_DOWN(bootinfo.memmap.zones[i].size, FRAME_SIZE));
+	for (i = 0; i < memmap.cnt; i++) {
+		start = ADDR2PFN(ALIGN_UP((uintptr_t) memmap.zones[i].start, FRAME_SIZE));
+		size = SIZE2FRAMES(ALIGN_DOWN(memmap.zones[i].size, FRAME_SIZE));
 		
 		if ((minconf < start) || (minconf >= start + size))
@@ -72,6 +73,6 @@
 		
 		zone_create(start, size, conf, 0);
-		if (last_frame < ALIGN_UP(bootinfo.memmap.zones[i].start + bootinfo.memmap.zones[i].size, FRAME_SIZE))
-			last_frame = ALIGN_UP(bootinfo.memmap.zones[i].start + bootinfo.memmap.zones[i].size, FRAME_SIZE);
+		if (last_frame < ALIGN_UP((uintptr_t) memmap.zones[i].start + memmap.zones[i].size, FRAME_SIZE))
+			last_frame = ALIGN_UP((uintptr_t) memmap.zones[i].start + memmap.zones[i].size, FRAME_SIZE);
 	}
 	
Index: kernel/arch/ppc32/src/mm/page.c
===================================================================
--- kernel/arch/ppc32/src/mm/page.c	(revision 556f9892d2e10c220ff5474d54af02f68faf6925)
+++ kernel/arch/ppc32/src/mm/page.c	(revision 2afb650952fa50390d07e579422af9f1607b9ad6)
@@ -45,5 +45,4 @@
 }
 
-
 uintptr_t hw_map(uintptr_t physaddr, size_t size)
 {
Index: kernel/arch/ppc32/src/ppc32.c
===================================================================
--- kernel/arch/ppc32/src/ppc32.c	(revision 556f9892d2e10c220ff5474d54af02f68faf6925)
+++ kernel/arch/ppc32/src/ppc32.c	(revision 2afb650952fa50390d07e579422af9f1607b9ad6)
@@ -65,22 +65,30 @@
 
 /** Performs ppc32-specific initialization before main_bsp() is called. */
-void arch_pre_main(void)
-{
-	init.cnt = bootinfo.taskmap.count;
-	
-	uint32_t i;
-	
-	for (i = 0; i < min3(bootinfo.taskmap.count, TASKMAP_MAX_RECORDS, CONFIG_INIT_TASKS); i++) {
-		init.tasks[i].addr = bootinfo.taskmap.tasks[i].addr;
-		init.tasks[i].size = bootinfo.taskmap.tasks[i].size;
+void arch_pre_main(bootinfo_t *bootinfo)
+{
+	/* Copy tasks map. */
+	init.cnt = min3(bootinfo->taskmap.cnt, TASKMAP_MAX_RECORDS, CONFIG_INIT_TASKS);
+	size_t i;
+	for (i = 0; i < init.cnt; i++) {
+		init.tasks[i].addr = (uintptr_t) bootinfo->taskmap.tasks[i].addr;
+		init.tasks[i].size = bootinfo->taskmap.tasks[i].size;
 		str_cpy(init.tasks[i].name, CONFIG_TASK_NAME_BUFLEN,
-		    bootinfo.taskmap.tasks[i].name);
+		    bootinfo->taskmap.tasks[i].name);
+	}
+	
+	/* Copy physical memory map. */
+	memmap.total = bootinfo->memmap.total;
+	memmap.cnt = min(bootinfo->memmap.cnt, MEMMAP_MAX_RECORDS);
+	for (i = 0; i < memmap.cnt; i++) {
+		memmap.zones[i].start = bootinfo->memmap.zones[i].start;
+		memmap.zones[i].size = bootinfo->memmap.zones[i].size;
 	}
 	
 	/* Copy boot allocations info. */
-	ballocs.base = bootinfo.ballocs.base;
-	ballocs.size = bootinfo.ballocs.size;
-	
-	ofw_tree_init(bootinfo.ofw_root);
+	ballocs.base = bootinfo->ballocs.base;
+	ballocs.size = bootinfo->ballocs.size;
+	
+	/* Copy OFW tree. */
+	ofw_tree_init(bootinfo->ofw_root);
 }
 
Index: kernel/arch/sparc64/include/arch.h
===================================================================
--- kernel/arch/sparc64/include/arch.h	(revision 556f9892d2e10c220ff5474d54af02f68faf6925)
+++ kernel/arch/sparc64/include/arch.h	(revision 2afb650952fa50390d07e579422af9f1607b9ad6)
@@ -27,14 +27,16 @@
  */
 
-/** @addtogroup sparc64	
+/** @addtogroup sparc64
  * @{
  */
 /**
  * @file
- * @brief	Various sparc64-specific macros.
+ * @brief Various sparc64-specific macros.
  */
 
 #ifndef KERN_sparc64_ARCH_H_
 #define KERN_sparc64_ARCH_H_
+
+#include <arch/boot/boot.h>
 
 #if defined (SUN4U)
@@ -44,15 +46,14 @@
 #endif
 
-#define ASI_AIUP		0x10	/** Access to primary context with user privileges. */
-#define ASI_AIUS		0x11	/** Access to secondary context with user privileges. */
+#define ASI_AIUP  0x10  /** Access to primary context with user privileges. */
+#define ASI_AIUS  0x11  /** Access to secondary context with user privileges. */
 
-#define NWINDOWS		8	/** Number of register window sets. */
+#define NWINDOWS  8  /** Number of register window sets. */
 
 #ifndef __ASM__
 
-extern void arch_pre_main(void);
+extern void arch_pre_main(bootinfo_t *);
 
 #endif /* __ASM__ */
-
 
 #endif
Index: kernel/arch/sparc64/include/boot/boot.h
===================================================================
--- kernel/arch/sparc64/include/boot/boot.h	(revision 556f9892d2e10c220ff5474d54af02f68faf6925)
+++ kernel/arch/sparc64/include/boot/boot.h	(revision 2afb650952fa50390d07e579422af9f1607b9ad6)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup sparc64	
+/** @addtogroup sparc64
  * @{
  */
@@ -36,6 +36,6 @@
 #define KERN_sparc64_BOOT_H_
 
-#define VMA			0x400000
-#define LMA			VMA
+#define VMA  0x400000
+#define LMA  VMA
 
 #ifndef __ASM__
@@ -46,28 +46,28 @@
 #include <genarch/ofw/ofw_tree.h>
 
-#define TASKMAP_MAX_RECORDS	32
-#define MEMMAP_MAX_RECORDS	32
+#define TASKMAP_MAX_RECORDS  32
+#define MEMMAP_MAX_RECORDS   32
 
-#define BOOTINFO_TASK_NAME_BUFLEN 32
+#define BOOTINFO_TASK_NAME_BUFLEN  32
 
 typedef struct {
-	void * addr;
-	uint32_t size;
+	void *addr;
+	size_t size;
 	char name[BOOTINFO_TASK_NAME_BUFLEN];
 } utask_t;
 
 typedef struct {
-	uint32_t count;
+	size_t cnt;
 	utask_t tasks[TASKMAP_MAX_RECORDS];
 } taskmap_t;
 
 typedef struct {
-	uintptr_t start;
-	uint32_t size;
+	void *start;
+	size_t size;
 } memzone_t;
 
 typedef struct {
-	uint32_t total;
-	uint32_t count;
+	uint64_t total;
+	size_t cnt;
 	memzone_t zones[MEMMAP_MAX_RECORDS];
 } memmap_t;
@@ -76,4 +76,5 @@
  *
  * Must be in sync with bootinfo structure used by the boot loader.
+ *
  */
 typedef struct {
@@ -85,5 +86,6 @@
 } bootinfo_t;
 
-extern bootinfo_t bootinfo;
+extern memmap_t memmap;
+extern uintptr_t physmem_start;
 
 #endif
Index: kernel/arch/sparc64/src/mm/sun4u/frame.c
===================================================================
--- kernel/arch/sparc64/src/mm/sun4u/frame.c	(revision 556f9892d2e10c220ff5474d54af02f68faf6925)
+++ kernel/arch/sparc64/src/mm/sun4u/frame.c	(revision 2afb650952fa50390d07e579422af9f1607b9ad6)
@@ -43,7 +43,7 @@
 uintptr_t last_frame = NULL;
 
-/** Create memory zones according to information stored in bootinfo.
+/** Create memory zones according to information stored in memmap.
  *
- * Walk the bootinfo memory map and create frame zones according to it.
+ * Walk the memory map and create frame zones according to it.
  */
 void frame_arch_init(void)
@@ -53,7 +53,7 @@
 
 	if (config.cpu_active == 1) {
-		for (i = 0; i < bootinfo.memmap.count; i++) {
-			uintptr_t start = bootinfo.memmap.zones[i].start;
-			size_t size = bootinfo.memmap.zones[i].size;
+		for (i = 0; i < memmap.cnt; i++) {
+			uintptr_t start = (uintptr_t) memmap.zones[i].start;
+			size_t size = memmap.zones[i].size;
 
 			/*
Index: kernel/arch/sparc64/src/mm/sun4v/frame.c
===================================================================
--- kernel/arch/sparc64/src/mm/sun4v/frame.c	(revision 556f9892d2e10c220ff5474d54af02f68faf6925)
+++ kernel/arch/sparc64/src/mm/sun4v/frame.c	(revision 2afb650952fa50390d07e579422af9f1607b9ad6)
@@ -41,7 +41,7 @@
 #include <macros.h>
 
-/** Create memory zones according to information stored in bootinfo.
+/** Create memory zones according to information stored in memmap.
  *
- * Walk the bootinfo memory map and create frame zones according to it.
+ * Walk the memory map and create frame zones according to it.
  */
 void frame_arch_init(void)
@@ -51,7 +51,7 @@
 
 	if (config.cpu_active == 1) {
-		for (i = 0; i < bootinfo.memmap.count; i++) {
-			uintptr_t start = bootinfo.memmap.zones[i].start;
-			size_t size = bootinfo.memmap.zones[i].size;
+		for (i = 0; i < memmap->count; i++) {
+			uintptr_t start = (uintptr_t) memmap.zones[i].start;
+			size_t size = memmap.zones[i].size;
 
 			/*
Index: kernel/arch/sparc64/src/smp/sun4v/smp.c
===================================================================
--- kernel/arch/sparc64/src/smp/sun4v/smp.c	(revision 556f9892d2e10c220ff5474d54af02f68faf6925)
+++ kernel/arch/sparc64/src/smp/sun4v/smp.c	(revision 2afb650952fa50390d07e579422af9f1607b9ad6)
@@ -417,5 +417,4 @@
 static bool wake_cpu(uint64_t cpuid)
 {
-
 #ifdef CONFIG_SIMICS_SMP_HACK
 	ipi_unicast_to((void (*)(void)) 1234, cpuid);
@@ -424,28 +423,23 @@
 	if (__hypercall_fast1(CPU_STOP, cpuid) != EOK)
 		return false;
-
+	
 	/* wait for the CPU to stop */
 	uint64_t state;
-	__hypercall_fast_ret1(cpuid, 0, 0, 0, 0,
-		CPU_STATE, &state);
-	while (state == CPU_STATE_RUNNING) {
-		__hypercall_fast_ret1(cpuid, 0, 0, 0, 0,
-			CPU_STATE, &state);
-	}
-
+	__hypercall_fast_ret1(cpuid, 0, 0, 0, 0, CPU_STATE, &state);
+	while (state == CPU_STATE_RUNNING)
+		__hypercall_fast_ret1(cpuid, 0, 0, 0, 0, CPU_STATE, &state);
+	
 	/* make the CPU run again and execute HelenOS code */
-	if (__hypercall_fast4(
-		CPU_START, cpuid,
-		(uint64_t) KA2PA(kernel_image_start),
-		KA2PA(trap_table), bootinfo.physmem_start			
-		) != EOK)
-			return false;
+	if (__hypercall_fast4(CPU_START, cpuid,
+	    (uint64_t) KA2PA(kernel_image_start), KA2PA(trap_table),
+	    physmem_start) != EOK)
+		return false;
 #endif
-
+	
 	if (waitq_sleep_timeout(&ap_completion_wq, 10000000, SYNCH_FLAGS_NONE) ==
-			ESYNCH_TIMEOUT)
-		printf("%s: waiting for processor (cpuid = %" PRIu32
-		") timed out\n", __func__, cpuid);
-
+	    ESYNCH_TIMEOUT)
+		printf("%s: waiting for processor (cpuid = %" PRIu32 ") timed out\n",
+		    __func__, cpuid);
+	
 	return true;
 }
Index: kernel/arch/sparc64/src/sun4u/sparc64.c
===================================================================
--- kernel/arch/sparc64/src/sun4u/sparc64.c	(revision 556f9892d2e10c220ff5474d54af02f68faf6925)
+++ kernel/arch/sparc64/src/sun4u/sparc64.c	(revision 2afb650952fa50390d07e579422af9f1607b9ad6)
@@ -36,4 +36,5 @@
 #include <debug.h>
 #include <config.h>
+#include <macros.h>
 #include <arch/trap/trap.h>
 #include <arch/console.h>
@@ -50,26 +51,33 @@
 #include <str.h>
 
-bootinfo_t bootinfo;
+memmap_t memmap;
 
 /** Perform sparc64-specific initialization before main_bsp() is called. */
-void arch_pre_main(void)
+void arch_pre_main(bootinfo_t *bootinfo)
 {
 	/* Copy init task info. */
-	init.cnt = bootinfo.taskmap.count;
+	init.cnt = min3(bootinfo->taskmap.cnt, TASKMAP_MAX_RECORDS, CONFIG_INIT_TASKS);
 	
-	uint32_t i;
-
-	for (i = 0; i < bootinfo.taskmap.count; i++) {
-		init.tasks[i].addr = (uintptr_t) bootinfo.taskmap.tasks[i].addr;
-		init.tasks[i].size = bootinfo.taskmap.tasks[i].size;
+	size_t i;
+	for (i = 0; i < init.cnt; i++) {
+		init.tasks[i].addr = (uintptr_t) bootinfo->taskmap.tasks[i].addr;
+		init.tasks[i].size = bootinfo->taskmap.tasks[i].size;
 		str_cpy(init.tasks[i].name, CONFIG_TASK_NAME_BUFLEN,
-		    bootinfo.taskmap.tasks[i].name);
+		    bootinfo->taskmap.tasks[i].name);
+	}
+	
+	/* Copy physical memory map. */
+	memmap.total = bootinfo->memmap.total;
+	memmap.cnt = min(bootinfo->memmap.cnt, MEMMAP_MAX_RECORDS);
+	for (i = 0; i < memmap.cnt; i++) {
+		memmap.zones[i].start = bootinfo->memmap.zones[i].start;
+		memmap.zones[i].size = bootinfo->memmap.zones[i].size;
 	}
 	
 	/* Copy boot allocations info. */
-	ballocs.base = bootinfo.ballocs.base;
-	ballocs.size = bootinfo.ballocs.size;
+	ballocs.base = bootinfo->ballocs.base;
+	ballocs.size = bootinfo->ballocs.size;
 	
-	ofw_tree_init(bootinfo.ofw_root);
+	ofw_tree_init(bootinfo->ofw_root);
 }
 
Index: kernel/arch/sparc64/src/sun4u/start.S
===================================================================
--- kernel/arch/sparc64/src/sun4u/start.S	(revision 556f9892d2e10c220ff5474d54af02f68faf6925)
+++ kernel/arch/sparc64/src/sun4u/start.S	(revision 2afb650952fa50390d07e579422af9f1607b9ad6)
@@ -60,15 +60,16 @@
 /*
  * Here is where the kernel is passed control from the boot loader.
- * 
+ *
  * The registers are expected to be in this state:
- * - %o0 starting address of physical memory + bootstrap processor flag
- * 	bits 63...1:	physical memory starting address / 2
- *	bit 0:		non-zero on BSP processor, zero on AP processors
- * - %o1 bootinfo structure address (BSP only)
- * - %o2 bootinfo structure size (BSP only)
+ *  - %o0 bootinfo structure address (BSP only)
+ *  - %o1 starting address of physical memory
+ *        + bootstrap processor flag
+ *          bits 63...1: physical memory starting address / 2
+ *          bit 0:       non-zero on BSP processor, zero on AP processors
  *
  * Moreover, we depend on boot having established the following environment:
- * - TLBs are on
- * - identity mapping for the kernel image
+ *  - TLBs are on
+ *  - identity mapping for the kernel image
+ *
  */
 
@@ -76,6 +77,6 @@
 kernel_image_start:
 	mov BSP_FLAG, %l0
-	and %o0, %l0, %l7			! l7 <= bootstrap processor?
-	andn %o0, %l0, %l6			! l6 <= start of physical memory
+	and %o1, %l0, %l7			! l7 <= bootstrap processor?
+	andn %o1, %l0, %l6			! l6 <= start of physical memory
 
 	! Get bits (PHYSMEM_ADDR_SIZE - 1):13 of physmem_base.
@@ -282,8 +283,4 @@
 	sub %sp, STACK_BIAS, %sp
 
-	sethi %hi(bootinfo), %o0
-	call memcpy				! copy bootinfo
-	or %o0, %lo(bootinfo), %o0
-
 	call arch_pre_main
 	nop
Index: kernel/arch/sparc64/src/sun4v/sparc64.c
===================================================================
--- kernel/arch/sparc64/src/sun4v/sparc64.c	(revision 556f9892d2e10c220ff5474d54af02f68faf6925)
+++ kernel/arch/sparc64/src/sun4v/sparc64.c	(revision 2afb650952fa50390d07e579422af9f1607b9ad6)
@@ -36,4 +36,5 @@
 #include <debug.h>
 #include <config.h>
+#include <macros.h>
 #include <arch/trap/trap.h>
 #include <arch/console.h>
@@ -52,21 +53,28 @@
 #include <arch/drivers/niagara.h>
 
-bootinfo_t bootinfo;
+memmap_t memmap;
 
 /** Perform sparc64-specific initialization before main_bsp() is called. */
-void arch_pre_main(void)
+void arch_pre_main(bootinfo_t *bootinfo)
 {
 	/* Copy init task info. */
-	init.cnt = bootinfo.taskmap.count;
+	init.cnt = min3(bootinfo->taskmap.cnt, TASKMAP_MAX_RECORDS, CONFIG_INIT_TASKS);
 	
-	uint32_t i;
-
-	for (i = 0; i < bootinfo.taskmap.count; i++) {
-		init.tasks[i].addr = (uintptr_t) bootinfo.taskmap.tasks[i].addr;
-		init.tasks[i].size = bootinfo.taskmap.tasks[i].size;
+	size_t i;
+	for (i = 0; i < init.cnt; i++) {
+		init.tasks[i].addr = (uintptr_t) bootinfo->taskmap.tasks[i].addr;
+		init.tasks[i].size = bootinfo->taskmap.tasks[i].size;
 		str_cpy(init.tasks[i].name, CONFIG_TASK_NAME_BUFLEN,
-		    bootinfo.taskmap.tasks[i].name);
+		    bootinfo->taskmap.tasks[i].name);
 	}
-
+	
+	/* Copy physical memory map. */
+	memmap.total = bootinfo->memmap.total;
+	memmap.cnt = min(bootinfo->memmap.cnt, MEMMAP_MAX_RECORDS);
+	for (i = 0; i < memmap.cnt; i++) {
+		memmap.zones[i].start = bootinfo->memmap.zones[i].start;
+		memmap.zones[i].size = bootinfo->memmap.zones[i].size;
+	}
+	
 	md_init();
 }
Index: kernel/arch/sparc64/src/sun4v/start.S
===================================================================
--- kernel/arch/sparc64/src/sun4v/start.S	(revision 556f9892d2e10c220ff5474d54af02f68faf6925)
+++ kernel/arch/sparc64/src/sun4v/start.S	(revision 2afb650952fa50390d07e579422af9f1607b9ad6)
@@ -75,10 +75,11 @@
  *
  * parameters:
- * 	addr:			virtual address to be mapped
- *	rphysmem_start:		register containing the starting address of the
- *				physical memory
- *	rtmp1:			a register to be used as temporary
- *	rtmp2:			a register to be used as temporary
- *	rd:			register where the result will be saved
+ *  addr:           virtual address to be mapped
+ *  rphysmem_start: register containing the starting address
+ *                  of the physical memory
+ *  rtmp1:          a register to be used as temporary
+ *  rtmp2:          a register to be used as temporary
+ *  rd:             register where the result will be saved
+ *
  */
 #define TTE_DATA(addr, rphysmem_start, rtmp1, rtmp2, rd) \
@@ -90,23 +91,23 @@
 /*
  * Here is where the kernel is passed control from the boot loader.
- * 
+ *
  * The registers are expected to be in this state:
- * - %o0 starting address of physical memory + bootstrap processor flag
- * 	bits 63...1:	physical memory starting address / 2
- *	bit 0:		non-zero on BSP processor, zero on AP processors
- * - %o1 bootinfo structure address (BSP only)
- * - %o2 bootinfo structure size (BSP only)
+ *  - %o0 bootinfo structure address (BSP only)
+ *  - %o1 starting address of physical memory
+ *        + bootstrap processor flag
+ *          bits 63...1: physical memory starting address / 2
+ *          bit 0:       non-zero on BSP processor, zero on AP processors
  *
  * Moreover, we depend on boot having established the following environment:
- * - TLBs are on
- * - identity mapping for the kernel image
+ *  - TLBs are on
+ *  - identity mapping for the kernel image
+ *
  */
 .global kernel_image_start
 kernel_image_start:
 	mov BSP_FLAG, %l0
-	and %o0, %l0, %l7			! l7 <= bootstrap processor?
-	andn %o0, %l0, %l6			! l6 <= start of physical memory
-	or %o1, %g0, %l1
-	or %o2, %g0, %l2
+	and %o1, %l0, %l7			! l7 <= bootstrap processor?
+	andn %o1, %l0, %l6			! l6 <= start of physical memory
+	or %o0, %g0, %l0
 
 	! Get bits (PHYSMEM_ADDR_SIZE - 1):13 of physmem_base.
@@ -245,10 +246,5 @@
 	sub %sp, STACK_BIAS, %sp
 
-	or %l1, %g0, %o1
-	or %l2, %g0, %o2
-	sethi %hi(bootinfo), %o0
-	call memcpy				! copy bootinfo
-	or %o0, %lo(bootinfo), %o0
-
+	or %l0, %g0, %o0
 	call arch_pre_main
 	nop
