On Sun, Nov 23, 2014 at 4:29 PM, Mark Cave-Ayland
Solaris 9 relies on an undocumented feature that
calling "child" with
a NULL phandle is equivalent to using the phandle of the device tree
Make sure that we emulate the same behaviour to avoid a crash when
dereferencing a NULL pointer.
This patch fixes Solaris 9 boot on SPARC32 and is based upon a
proof-of-concept patch submitted by Artyom Tarasenko <atar4qemu(a)gmail.com>om>.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland(a)ilande.co.uk>
Tested it, works as good as the PoC patch, but is implemented in a
much more beautiful way, so
Acked-by: Artyom Tarasenko <atar4qemu(a)gmail.com>
openbios-devel/forth/device/package.fs | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/openbios-devel/forth/device/package.fs
index eb17551..d5b52c3 100644
@@ -49,6 +49,10 @@
: child ( phandle.parent -- phandle.child )
+ \ Assume phandle == 0 indicates root node (not documented but similar
+ \ behaviour to "peer"). Used by some versions of Solaris (e.g. 9).
+ ?dup if else device-tree @ then
SPARC and PPC PReP under qemu blog: http://tyom.blogspot.com/search/label/qemu