[OpenBIOS] [PATCH] next-property

Artyom Tarasenko atar4qemu at gmail.com
Mon Feb 3 15:21:16 CET 2014


On Sat, Feb 1, 2014 at 9:54 PM, Olivier Danet <odanet at caramail.com> wrote:
> obp_nextprop(node,name) calls the Forth word "next-property" then pops the
> result. "next-property" should therefore always return something :
>  * A string when the property provided is not the last one of the node.
>  * Zero when the property provided is the last one of the node.
>  * Zero when the property provided does not exist in the current node.
>
> Previously, next-property returned nothing when the property didn't exist.
>
> "next-property" behavior with last and nonexistant properties differs
> between implementations of OF.

Right. As discussed before, the current behavior matches the OBP behavior on
sun4u machines.

It would be nice to keep the comatibility with OBP. Can the C function
obp_nextprop(node,name) be modified instead?

Artyom

> This problem was found with NetBSD on Sparc32. It ennumerates peripherals
> when starting X11 and asks for the "name" and "device_type" property of many
> nodes, including some which have neither "name" nor "device_type"
> properties.
>
> Signed-off-by: Olivier Danet <odanet at caramail.com>
> ===================================================================
> --- forth/device/property.fs    (révision 1257)
> +++ forth/device/property.fs    (copie de travail)
> @@ -70,7 +70,7 @@
>      2drop r> >dn.properties @
>    else
>      r> find-property dup if @ then
> -    ?dup if >prop.next @ then
> +    dup if >prop.next @ then
>    then
>
>    ?dup if
> ===================================================================
>
> --
> OpenBIOS                 http://openbios.org/
> Mailinglist:  http://lists.openbios.org/mailman/listinfo
> Free your System - May the Forth be with you



-- 
Regards,
Artyom Tarasenko

linux/sparc and solaris/sparc under qemu blog:
http://tyom.blogspot.com/search/label/qemu



More information about the OpenBIOS mailing list