Index: boot/arch/sparc64/loader/ofwarch.c
===================================================================
--- boot/arch/sparc64/loader/ofwarch.c	(revision a9ac978f3aba8259d5f8270ee59a08a41d15d94c)
+++ boot/arch/sparc64/loader/ofwarch.c	(revision 79f119b9e03afca087e6fef2c56a7fabb01c8cc1)
@@ -1,4 +1,5 @@
 /*
  * Copyright (C) 2005 Martin Decky
+ * Copyright (C) 2006 Jakub Jermar
  * All rights reserved.
  *
@@ -38,4 +39,5 @@
 #include <register.h>
 #include "main.h"
+#include "asm.h"
 
 void write(const char *str, const int len)
@@ -86,5 +88,7 @@
 					 * Start secondary processor.
 					 */
-					(void) ofw_call("SUNW,start-cpu", 3, 1, NULL, node, KERNEL_VIRTUAL_ADDRESS, 0);
+					(void) ofw_call("SUNW,start-cpu", 3, 1, NULL, node,
+						 KERNEL_VIRTUAL_ADDRESS,
+						 bootinfo.physmem_start | AP_PROCESSOR);
 				}
 			}
@@ -94,2 +98,21 @@
 	return cpus;
 }
+
+/** Get physical memory starting address.
+ *
+ * @param start Pointer to variable where the physical memory starting
+ * 		address will be stored.
+ *
+ * @return Non-zero on succes, zero on failure.
+ */
+int ofw_get_physmem_start(uintptr_t *start)
+{
+	uint32_t memreg[4];
+
+	if (ofw_get_property(ofw_memory, "reg", &memreg, sizeof(memreg)) <= 0)
+		return 0;
+
+	*start = (((uint64_t) memreg[0]) << 32) | memreg[1];
+	return 1;
+}
+
