Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Oct 2010 20:42:02 +0000 (UTC)
From:      Marius Strobl <marius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r214526 - head/sys/boot/sparc64/loader
Message-ID:  <201010292042.o9TKg2HM056206@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marius
Date: Fri Oct 29 20:42:02 2010
New Revision: 214526
URL: http://svn.freebsd.org/changeset/base/214526

Log:
  Partially revert r203829; as it turns out what the PowerPC OFW loader did
  was incorrect as further down the road cons_probe() calls malloc() so the
  former can't be called before init_heap() has succeed. Instead just exit
  to the firmware in case init_heap() fails like OF_init() does when hitting
  a problem as we're then likely running in a very broken environment where
  hardly anything can be trusted to work.

Modified:
  head/sys/boot/sparc64/loader/main.c

Modified: head/sys/boot/sparc64/loader/main.c
==============================================================================
--- head/sys/boot/sparc64/loader/main.c	Fri Oct 29 20:23:41 2010	(r214525)
+++ head/sys/boot/sparc64/loader/main.c	Fri Oct 29 20:42:02 2010	(r214526)
@@ -811,15 +811,15 @@ main(int (*openfirm)(void *))
 	archsw.arch_autoload = sparc64_autoload;
 	archsw.arch_maphint = sparc64_maphint;
 
+	if (init_heap() == (vm_offset_t)-1)
+		OF_exit();
+	setheap((void *)heapva, (void *)(heapva + HEAPSZ));
+
 	/*
 	 * Probe for a console.
 	 */
 	cons_probe();
 
-	if (init_heap() == (vm_offset_t)-1)
-		panic("%s: can't claim heap", __func__);
-	setheap((void *)heapva, (void *)(heapva + HEAPSZ));
-
 	if ((root = OF_peer(0)) == -1)
 		panic("%s: can't get root phandle", __func__);
 	OF_getprop(root, "compatible", compatible, sizeof(compatible));



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201010292042.o9TKg2HM056206>