[OpenBIOS] [PATCH 10/10] Adding filll Forth primitive

Mark Cave-Ayland mark.cave-ayland at siriusit.co.uk
Wed Aug 10 13:01:02 CEST 2011


On 09/08/11 22:55, William Hahne wrote:

> This is a forth primitive that is required by BootX. It just fills some
> specified memory address and length with longs.
>
>
> Index: kernel/forth.c
> ===================================================================
> --- kernel/forth.c (revision 1041)
> +++ kernel/forth.c (working copy)
> @@ -1610,6 +1616,20 @@
> memset(src, value, count);
>   }
> +/*
> + *  filll       ( addr len byte -- )
> + */
> +static void filll(void)
> +{
> +    ucell value = POP();
> + ucell count = POP();
> + ucell *dest = (ucell *)cell2pointer(POP());
> +
> + int i;
> + for (i = 0; i <= count / 4; i++) {
> +    dest[i] = value;
> + }
> +}
>   /*
>    *  unaligned-w@  ( addr -- w )
> @@ -1963,4 +1983,5 @@
>       do_encode_file,         /* $encode-file */
>       do_debug_xt,            /* (debug  */
>       do_debug_off,           /* (debug-off) */
> +    filll                   /* filll */
>   };
> Index: kernel/bootstrap.c
> ===================================================================
> --- kernel/bootstrap.c (revision 1041)
> +++ kernel/bootstrap.c (working copy)
> @@ -89,7 +89,7 @@
> "here", "here!", "dobranch", "do?branch", "unaligned-w@",
> "unaligned-w!", "unaligned-l@", "unaligned-l!", "ioc@", "iow@",
> "iol@", "ioc!", "iow!", "iol!", "i", "j", "call", "sys-debug",
> - "$include", "$encode-file", "(debug", "(debug-off)"
> + "$include", "$encode-file", "(debug", "(debug-off)", "filll"
>   };
>   /*

This looks reasonably straightforward - again, can you add a reference 
to the documentation for this word as part of the commit message?


ATB,

Mark.

-- 
Mark Cave-Ayland - Senior Technical Architect
PostgreSQL - PostGIS
Sirius Corporation plc - control through freedom
http://www.siriusit.co.uk
t: +44 870 608 0063

Sirius Labs: http://www.siriusit.co.uk/labs



More information about the OpenBIOS mailing list