[OpenBIOS] [PATCH] Adds filll (3 l's) to dictionary

Mark Cave-Ayland mark.cave-ayland at ilande.co.uk
Mon Dec 3 21:54:32 CET 2012


On 03/12/12 20:24, Programmingkid wrote:

> The filll word fills memory addresses with a value. It's different from fill (2 l's) because filll fills the specified memory addresses with 32-bit values.

First up, this is a much better version of the patch. Comments included 
inline below:

> Index: trunk/openbios-devel/arch/ppc/qemu/init.c
> ===================================================================
> --- trunk/openbios-devel/arch/ppc/qemu/init.c	(revision 1075)
> +++ trunk/openbios-devel/arch/ppc/qemu/init.c	(working copy)
> @@ -613,6 +613,25 @@
>       fword("finish-device");
>   }
>
> +
> +// filll  ( addr len num -- )
> +// Fills an address in memory with 32-bit values

OpenBIOS uses C /* ... */ comments rather than C++ // comments.

> +static void filll(void)
> +{
> +   u32 * location;
> +   u32 length, fillNumber, x;
> +
> +   fillNumber = POP();
> +   length = POP();
> +   location = (u32 *) cell2pointer(POP());
> +
> +   for(x = 0; x<= length; x++)
> +   {
> +      location[x] = fillNumber;
> +   }

Compare the formatting of your for() statement above with the others in 
the file - you should use the existing style in your patch.

Also as per my comment on your last version of the patch, you need to 
use target_long() as per the existing code in lstore.

> +}
> +
> +
>   void
>   arch_of_init(void)
>   {
> @@ -879,4 +898,5 @@
>
>       bind_func("platform-boot", boot);
>       bind_func("(go)", go);
> +    bind_func("filll", filll);
>   }

ATB,

Mark.



More information about the OpenBIOS mailing list