svn commit: r214691 - stable/7/sys/boot/sparc64/loader
Marius Strobl
marius at FreeBSD.org
Tue Nov 2 22:12:13 UTC 2010
Author: marius
Date: Tue Nov 2 22:12:12 2010
New Revision: 214691
URL: http://svn.freebsd.org/changeset/base/214691
Log:
MFC: r214526
Partially revert r203829 (MFC'ed to stable/7 in r205921); 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:
stable/7/sys/boot/sparc64/loader/main.c
Directory Properties:
stable/7/sys/ (props changed)
stable/7/sys/cddl/contrib/opensolaris/ (props changed)
stable/7/sys/contrib/dev/acpica/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
Modified: stable/7/sys/boot/sparc64/loader/main.c
==============================================================================
--- stable/7/sys/boot/sparc64/loader/main.c Tue Nov 2 22:12:06 2010 (r214690)
+++ stable/7/sys/boot/sparc64/loader/main.c Tue Nov 2 22:12:12 2010 (r214691)
@@ -812,15 +812,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));
More information about the svn-src-stable-7
mailing list