Index: kernel/arch/sparc64/src/mm/sun4u/frame.c
===================================================================
--- kernel/arch/sparc64/src/mm/sun4u/frame.c	(revision 5cbb170bf59645e36db43f56cfde6eb73e70c204)
+++ kernel/arch/sparc64/src/mm/sun4u/frame.c	(revision 5bf91e29e5b50c60ec9b3bef1e27b57e00ec953a)
@@ -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 5cbb170bf59645e36db43f56cfde6eb73e70c204)
+++ kernel/arch/sparc64/src/mm/sun4v/frame.c	(revision 5bf91e29e5b50c60ec9b3bef1e27b57e00ec953a)
@@ -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 5cbb170bf59645e36db43f56cfde6eb73e70c204)
+++ kernel/arch/sparc64/src/smp/sun4v/smp.c	(revision 5bf91e29e5b50c60ec9b3bef1e27b57e00ec953a)
@@ -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 5cbb170bf59645e36db43f56cfde6eb73e70c204)
+++ kernel/arch/sparc64/src/sun4u/sparc64.c	(revision 5bf91e29e5b50c60ec9b3bef1e27b57e00ec953a)
@@ -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 5cbb170bf59645e36db43f56cfde6eb73e70c204)
+++ kernel/arch/sparc64/src/sun4u/start.S	(revision 5bf91e29e5b50c60ec9b3bef1e27b57e00ec953a)
@@ -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 5cbb170bf59645e36db43f56cfde6eb73e70c204)
+++ kernel/arch/sparc64/src/sun4v/sparc64.c	(revision 5bf91e29e5b50c60ec9b3bef1e27b57e00ec953a)
@@ -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 5cbb170bf59645e36db43f56cfde6eb73e70c204)
+++ kernel/arch/sparc64/src/sun4v/start.S	(revision 5bf91e29e5b50c60ec9b3bef1e27b57e00ec953a)
@@ -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
